waf: introduce reverse logic for allowing unknown symbols
authorMatthieu Patou <mat@matws.net>
Fri, 15 Apr 2011 21:15:51 +0000 (01:15 +0400)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Apr 2011 07:16:34 +0000 (17:16 +1000)
Some os (ie OSX 10.6) forbids by default unknown symbols so in order to
allow them (for special case) we have no to remove linker option *but*
to add options to ask the linker to be more relax.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_deps.py
wscript

index adeb3645ce16b58815463eebe08eed958be133d0..0bd2c6cf67bb6e75870343dd13558318e2ea060c 100644 (file)
@@ -89,6 +89,10 @@ def build_dependencies(self):
             for f in self.env.undefined_ldflags:
                 self.ldflags.remove(f)
 
+        if getattr(self, 'allow_undefined_symbols', False) and self.env.undefined_ignore_ldflags:
+            for f in self.env.undefined_ignore_ldflags:
+                self.ldflags.append(f)
+
         debug('deps: computed dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s',
               self.sname, self.uselib, self.uselib_local, self.add_objects)
 
diff --git a/wscript b/wscript
index 46773bfd86ad45a0c052b090ad2bc8b2c9f76b2e..7e9d7730ab7d9f0994c0fae085d2a37a6dd7ae27 100755 (executable)
--- a/wscript
+++ b/wscript
@@ -122,6 +122,11 @@ def configure(conf):
     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']
+
+
     # gentoo always adds this. We want our normal build to be as
     # strict as the strictest OS we support, so adding this here
     # allows us to find problems on our development hosts faster.