)
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 = build_machine.system()
install: true,
install_dir: 'lib',
link_with: LIBS_BUILT_SO_FAR,
- # The only way to avoid on FreeBSD: ld: error: undefined symbol: environ
- override_options: ['b_lundef=false'],
+ override_options: ENVIRON_SHLIB_FLAGS,
)
LIBS_BUILT_SO_FAR = [kea_asiolink_lib] + LIBS_BUILT_SO_FAR
subdir('testutils')