+ if Options.options.enable_pie != False:
+ if Options.options.enable_pie == True:
+ need_pie = True
+ else:
+ # not specified, only build PIEs if supported by compiler
+ need_pie = False
+ if conf.check_cc(cflags='-fPIE', ldflags='-pie', mandatory=need_pie,
+ msg="Checking compiler for PIE support"):
+ conf.env['ENABLE_PIE'] = True
+
+ if Options.options.enable_relro != False:
+ if Options.options.enable_relro == True:
+ need_relro = True
+ else:
+ # not specified, only build RELROs if supported by compiler
+ need_relro = False
+ if conf.check_cc(cflags='', ldflags='-Wl,-z,relro,-z,now', mandatory=need_relro,
+ msg="Checking compiler for full RELRO support"):
+ conf.env['ENABLE_RELRO'] = True
+
+ if Options.options.enable_systemd != False:
+ conf.check_cfg(package='libsystemd-daemon', args='--cflags --libs',
+ msg='Checking for libsystemd-daemon', uselib_store="SYSTEMD-DAEMON")
+ conf.CHECK_HEADERS('systemd/sd-daemon.h', lib='systemd-daemon')
+ conf.CHECK_LIB('systemd-daemon', shlib=True)
+
+ if (conf.CONFIG_SET('HAVE_SYSTEMD_SD_DAEMON_H') and
+ conf.CONFIG_SET('HAVE_LIBSYSTEMD_DAEMON')):
+ conf.DEFINE('HAVE_SYSTEMD', '1')
+ conf.env['ENABLE_SYSTEMD'] = True
+ else:
+ conf.SET_TARGET_TYPE('systemd-daemon', 'EMPTY')
+ conf.undefine('HAVE_SYSTEMD')
+
+ conf.SAMBA_CONFIG_H('include/config.h')