]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
wafsamba: make it possible to specify ADDITIONAL_{CFLAGS,LDFLAGS} as env var to ...
authorStefan Metzmacher <metze@samba.org>
Wed, 7 Jan 2015 10:13:04 +0000 (11:13 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 27 Jan 2015 10:02:16 +0000 (11:02 +0100)
CFLAGS and LDFLAGS are also used during the configure checks and might impact
their results.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit d744c7c080d81121b84a592a95761e03c2a1090c)

buildtools/wafsamba/samba_autoconf.py

index dc76673613884095fd5fae031c5cf12e3d8851d4..cb33630bb362c31acb80393091f1b2cfbb119e05 100644 (file)
@@ -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: