build: remove warnings about redifinition of boolean use -KPIC on suncc
authorMatthieu Patou <mat@matws.net>
Wed, 27 Oct 2010 22:12:53 +0000 (02:12 +0400)
committerMatthieu Patou <mat@samba.org>
Wed, 27 Oct 2010 22:57:19 +0000 (22:57 +0000)
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Oct 27 22:57:19 UTC 2010 on sn-devel-104

buildtools/wafsamba/wscript

index d705216ba7530942719a9b804d98d749a5dc7cc3..f134c07b11dccdeecba4d7f533527b2750eee05e 100644 (file)
@@ -260,7 +260,15 @@ def configure(conf):
         conf.env.RPATH_ON_BUILD   = False
 
     # we should use the PIC options in waf instead
-    conf.ADD_CFLAGS('-fPIC', testflags=True)
+    # Some compilo didn't support -fPIC but just print a warning
+    if conf.env['COMPILER_CC'] == "suncc":
+        conf.ADD_CFLAGS('-KPIC', testflags=True)
+        # we really want define here as we need to have this
+        # define even during the tests otherwise detection of
+        # boolean is broken
+        conf.DEFINE('_STDC_C99', 1, add_to_cflags=True)
+    else:
+        conf.ADD_CFLAGS('-fPIC', testflags=True)
 
     conf.CHECK_INLINE()