waf: Factor checking for undefined symbol flags out into separate method.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 13 Nov 2011 17:01:09 +0000 (18:01 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 13 Nov 2011 18:38:38 +0000 (19:38 +0100)
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Nov 13 19:38:38 CET 2011 on sn-devel-104

buildtools/wafsamba/samba_autoconf.py
lib/ldb/wscript
lib/talloc/wscript
lib/tdb/wscript
lib/tevent/wscript
wscript

index 909e836fdb045581592815d230487a44affb45a7..1ea818ef30985b6896a5708c4667ec5f406cab29 100644 (file)
@@ -712,3 +712,15 @@ def SETUP_CONFIGURE_CACHE(conf, enable):
         preproc.recursion_limit = 1
     # in either case we don't need to scan system includes
     preproc.go_absolute = False
+
+
+@conf
+def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
+    # we don't want any libraries or modules to rely on runtime
+    # resolution of symbols
+    if sys.platform != "openbsd4":
+        conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
+
+    if sys.platform != "openbsd4" and conf.env.undefined_ignore_ldflags == []:
+        if conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup']):
+            conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
index a3af27515cb43109a2fab839a5e6e2bb8a16b682..088292cd9ea527db902001ce5e8b2805f336cee0 100755 (executable)
@@ -75,6 +75,8 @@ def configure(conf):
 
     conf.SAMBA_CONFIG_H()
 
+    conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
+
 def build(bld):
     bld.RECURSE('lib/tdb_compat')
     bld.RECURSE('lib/tevent')
index 72e954ad6505aacdded7bc2cf8e368b45edf3e2e..447406bf6e7a4be320f32c9a2f5d5b4e2db01fe5 100644 (file)
@@ -67,6 +67,8 @@ def configure(conf):
 
     conf.SAMBA_CONFIG_H()
 
+    conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
+
 
 def build(bld):
     bld.RECURSE('lib/replace')
index 678d2f2847abec866d3ff55d19aedd73c4aefd38..ebbab2cc92101b82c04e631695ecfae4cc4ba722 100644 (file)
@@ -55,6 +55,8 @@ def configure(conf):
 
     conf.SAMBA_CONFIG_H()
 
+    conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
+
 def build(bld):
     bld.RECURSE('lib/replace')
 
index 63b27e542ee3587d68cbf8d3f8ef524db5f43861..6f94d803b506e96a6069a1761fec66faf0ba0832 100644 (file)
@@ -58,6 +58,8 @@ def configure(conf):
 
     conf.SAMBA_CONFIG_H()
 
+    conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
+
 def build(bld):
     bld.RECURSE('lib/replace')
     bld.RECURSE('lib/talloc')
diff --git a/wscript b/wscript
index fb9cc4096d04f5e2836d5c400b956443b453cd21..5ccb74d91dbae36666176f414fd372ff476261b5 100755 (executable)
--- a/wscript
+++ b/wscript
@@ -101,15 +101,7 @@ def configure(conf):
     conf.RECURSE('selftest')
     conf.RECURSE('source3')
 
-    # we don't want any libraries or modules to rely on runtime
-    # resolution of symbols
-    if sys.platform != "openbsd4":
-        conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
-
-    if sys.platform != "openbsd4" and conf.env.undefined_ignore_ldflags == []:
-        if conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup']):
-            conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
-
+    conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
 
     # gentoo always adds this. We want our normal build to be as
     # strict as the strictest OS we support, so adding this here