wafsamba: move compiler / cflags related stuff from lib/replace to wafsamba
authorStefan Metzmacher <metze@samba.org>
Wed, 7 Jan 2015 08:48:38 +0000 (09:48 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 8 Jan 2015 22:38:07 +0000 (23:38 +0100)
We should have this just in one central place.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
buildtools/wafsamba/wscript
lib/replace/wscript

index 1a30d2fa9366ab00b09182de6aa9884f245ff6e6..917a692153973680b4f4c67efadaa23e96057fad 100755 (executable)
@@ -363,6 +363,27 @@ def configure(conf):
     conf.DEFINE('_GNU_SOURCE', 1, add_to_cflags=True)
     conf.DEFINE('_XOPEN_SOURCE_EXTENDED', 1, add_to_cflags=True)
 
+    # on Tru64 certain features are only available with _OSF_SOURCE set to 1
+    # and _XOPEN_SOURCE set to 600
+    if conf.env['SYSTEM_UNAME_SYSNAME'] == 'OSF1':
+        conf.DEFINE('_OSF_SOURCE', 1, add_to_cflags=True)
+        conf.DEFINE('_XOPEN_SOURCE', 600, add_to_cflags=True)
+
+    # SCM_RIGHTS is only avail if _XOPEN_SOURCE iѕ defined on IRIX
+    if conf.env['SYSTEM_UNAME_SYSNAME'] == 'IRIX':
+        conf.DEFINE('_XOPEN_SOURCE', 600, add_to_cflags=True)
+        conf.DEFINE('_BSD_TYPES', 1, add_to_cflags=True)
+
+    # Try to find the right extra flags for C99 initialisers
+    for f in ["", "-AC99", "-qlanglvl=extc99", "-qlanglvl=stdc99", "-c99"]:
+        if conf.CHECK_CFLAGS([f], '''
+struct foo {int x;char y;};
+struct foo bar = { .y = 'X', .x = 1 };
+'''):
+            if f != "":
+                conf.ADD_CFLAGS(f)
+            break
+
     # get the base headers we'll use for the rest of the tests
     conf.CHECK_HEADERS('stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.h',
                        add_headers=True)
index 7bbe1d6de1eaeca56394b47603c4709173bcabaf..0f295140edac78980bb6362501070dac7e3c45d9 100644 (file)
@@ -32,27 +32,6 @@ def configure(conf):
     conf.DEFINE('HAVE_LIBREPLACE', 1)
     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
 
-    # on Tru64 certain features are only available with _OSF_SOURCE set to 1
-    # and _XOPEN_SOURCE set to 600
-    if conf.env['SYSTEM_UNAME_SYSNAME'] == 'OSF1':
-        conf.DEFINE('_OSF_SOURCE', 1, add_to_cflags=True)
-        conf.DEFINE('_XOPEN_SOURCE', 600, add_to_cflags=True)
-
-    # SCM_RIGHTS is only avail if _XOPEN_SOURCE iѕ defined on IRIX
-    if conf.env['SYSTEM_UNAME_SYSNAME'] == 'IRIX':
-        conf.DEFINE('_XOPEN_SOURCE', 600, add_to_cflags=True)
-        conf.DEFINE('_BSD_TYPES', 1, add_to_cflags=True)
-
-    # Try to find the right extra flags for C99 initialisers
-    for f in ["", "-AC99", "-qlanglvl=extc99", "-qlanglvl=stdc99", "-c99"]:
-        if conf.CHECK_CFLAGS([f], '''
-struct foo {int x;char y;};
-struct foo bar = { .y = 'X', .x = 1 };
-'''):
-            if f != "":
-                conf.ADD_CFLAGS(f)
-            break
-
     if conf.CHECK_CFLAGS(['-fstack-protector']) and conf.CHECK_LDFLAGS(['-fstack-protector']):
         conf.ADD_CFLAGS('-fstack-protector')
         conf.ADD_LDFLAGS('-fstack-protector')