wafsamba: move WERROR_CFLAGS checks from lib/replace to wafsamba
authorStefan Metzmacher <metze@samba.org>
Wed, 7 Jan 2015 08:52:53 +0000 (09:52 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 8 Jan 2015 22:38:07 +0000 (23:38 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
buildtools/wafsamba/wscript
lib/replace/wscript

index 917a692153973680b4f4c67efadaa23e96057fad..0e2afe11490c0cf1b452650f365c1a4a2727f5b7 100755 (executable)
@@ -295,6 +295,19 @@ def configure(conf):
                     headers='stdio.h',
                     msg='Checking simple C program')
 
+    # Try to find the right extra flags for -Werror behaviour
+    for f in ["-Werror",       # GCC
+              "-errwarn=%all", # Sun Studio
+              "-qhalt=w",     # IBM xlc
+              "-w2",           # Tru64
+             ]:
+        if conf.CHECK_CFLAGS([f], '''
+'''):
+            if not 'WERROR_CFLAGS' in conf.env:
+                conf.env['WERROR_CFLAGS'] = []
+            conf.env['WERROR_CFLAGS'].extend([f])
+            break
+
     # check which compiler/linker flags are needed for rpath support
     if not conf.CHECK_LDFLAGS(['-Wl,-rpath,.']) and conf.CHECK_LDFLAGS(['-Wl,-R,.']):
         conf.env['RPATH_ST'] = '-Wl,-R,%s'
index 0f295140edac78980bb6362501070dac7e3c45d9..60b714a501ee132978393bb08c6060f941674866 100644 (file)
@@ -36,19 +36,6 @@ def configure(conf):
         conf.ADD_CFLAGS('-fstack-protector')
         conf.ADD_LDFLAGS('-fstack-protector')
 
-    # Try to find the right extra flags for -Werror behaviour
-    for f in ["-Werror",       # GCC
-              "-errwarn=%all", # Sun Studio
-              "-qhalt=w",     # IBM xlc
-              "-w2",           # Tru64
-             ]:
-        if conf.CHECK_CFLAGS([f], '''
-'''):
-            if not 'WERROR_CFLAGS' in conf.env:
-                conf.env['WERROR_CFLAGS'] = []
-            conf.env['WERROR_CFLAGS'].extend([f])
-            break
-
     conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
     conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
     conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')