mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-22 01:49:48 +00:00
[#3729] Added check for environ vs shlib
This commit is contained in:
parent
8f9ac9da55
commit
922c51596f
5
compiler-checks/environ-in-shlib.cc
Normal file
5
compiler-checks/environ-in-shlib.cc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
extern char **environ;
|
||||||
|
|
||||||
|
char** fn() {
|
||||||
|
return environ;
|
||||||
|
}
|
12
meson.build
12
meson.build
@ -269,6 +269,18 @@ result = cpp.run(
|
|||||||
)
|
)
|
||||||
conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', result.returncode() == 0)
|
conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', result.returncode() == 0)
|
||||||
|
|
||||||
|
ENVIRON_SHLIB_FLAGS = []
|
||||||
|
if cpp.has_link_argument('-Wl,--no-undefined')
|
||||||
|
result = cpp.links(
|
||||||
|
fs.read('compiler-checks/environ-in-shlib.cc'),
|
||||||
|
name: 'ENVIRON_SHLIB_FLAGS',
|
||||||
|
args: ['--shared', '-fPIC', '-Wl,--no-undefined'],
|
||||||
|
)
|
||||||
|
if not result
|
||||||
|
ENVIRON_SHLIB_FLAGS += ['b_lundef=false']
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
#### System-specific Variables
|
#### System-specific Variables
|
||||||
|
|
||||||
SYSTEM = build_machine.system()
|
SYSTEM = build_machine.system()
|
||||||
|
@ -19,8 +19,7 @@ kea_asiolink_lib = library(
|
|||||||
install: true,
|
install: true,
|
||||||
install_dir: 'lib',
|
install_dir: 'lib',
|
||||||
link_with: LIBS_BUILT_SO_FAR,
|
link_with: LIBS_BUILT_SO_FAR,
|
||||||
# The only way to avoid on FreeBSD: ld: error: undefined symbol: environ
|
override_options: ENVIRON_SHLIB_FLAGS,
|
||||||
override_options: ['b_lundef=false'],
|
|
||||||
)
|
)
|
||||||
LIBS_BUILT_SO_FAR = [kea_asiolink_lib] + LIBS_BUILT_SO_FAR
|
LIBS_BUILT_SO_FAR = [kea_asiolink_lib] + LIBS_BUILT_SO_FAR
|
||||||
subdir('testutils')
|
subdir('testutils')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user