From: Stefan Metzmacher Date: Wed, 7 Jan 2015 10:13:04 +0000 (+0100) Subject: wafsamba: make it possible to specify ADDITIONAL_{CFLAGS,LDFLAGS} as env var to ... X-Git-Tag: samba-4.2.0rc5~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2a5e0818fa61118d352b7367785ad72688feb77;p=thirdparty%2Fsamba.git wafsamba: make it possible to specify ADDITIONAL_{CFLAGS,LDFLAGS} as env var to ./configure CFLAGS and LDFLAGS are also used during the configure checks and might impact their results. Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme (cherry picked from commit d744c7c080d81121b84a592a95761e03c2a1090c) --- diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index dc766736138..cb33630bb36 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -703,6 +703,19 @@ int main(void) { if Options.options.pedantic: conf.ADD_CFLAGS('-W', testflags=True) + + # Let people pass an additional ADDITIONAL_{CFLAGS,LDFLAGS} + # environment variables which are only used the for final build. + # + # The CFLAGS and LDFLAGS environment variables are also + # used for the configure checks which might impact their results. + conf.add_os_flags('ADDITIONAL_CFLAGS') + if conf.env.ADDITIONAL_CFLAGS and conf.CHECK_CFLAGS(conf.env['ADDITIONAL_CFLAGS']): + conf.env['EXTRA_CFLAGS'].extend(conf.env['ADDITIONAL_CFLAGS']) + conf.add_os_flags('ADDITIONAL_LDFLAGS') + if conf.env.ADDITIONAL_LDFLAGS and conf.CHECK_LDFLAGS(conf.env['ADDITIONAL_LDFLAGS']): + conf.env['EXTRA_LDFLAGS'].extend(conf.env['ADDITIONAL_LDFLAGS']) + if path is None: conf.write_config_header('config.h', top=True) else: