build: added allow_undefined_symbols options for libraries and modules
authorAndrew Tridgell <tridge@samba.org>
Tue, 15 Feb 2011 05:15:15 +0000 (16:15 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 18 Feb 2011 04:09:46 +0000 (15:09 +1100)
the s4 build uses linker flags to disallow undefined symbols in
libraries. To accomodate s3 libraries in the top level build we need
to be able to disable this on a per-library basis.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

buildtools/wafsamba/samba_deps.py
buildtools/wafsamba/wafsamba.py

index 02f23183e726223d78b12cac324baff1501e0ae0..a3968ada8360dfc26158126cdd3d1e97aa1a49f0 100644 (file)
@@ -85,6 +85,10 @@ def build_dependencies(self):
         new_ldflags.extend(ldflags)
         self.ldflags       = new_ldflags
 
+        if getattr(self, 'allow_undefined_symbols', False) and self.env.undefined_ldflags:
+            for f in self.env.undefined_ldflags:
+                self.ldflags.remove(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)
 
@@ -954,7 +958,7 @@ def show_object_duplicates(bld, tgt_list):
 # this provides a way to save our dependency calculations between runs
 savedeps_version = 3
 savedeps_inputs  = ['samba_deps', 'samba_includes', 'local_include', 'local_include_first', 'samba_cflags',
-                    'source', 'grouping_library', 'samba_ldflags']
+                    'source', 'grouping_library', 'samba_ldflags', 'allow_undefined_symbols' ]
 savedeps_outputs = ['uselib', 'uselib_local', 'add_objects', 'includes', 'ccflags', 'ldflags', 'samba_deps_extended']
 savedeps_outenv  = ['INC_PATHS']
 savedeps_envvars = ['NONSHARED_BINARIES', 'GLOBAL_DEPENDENCIES', 'EXTRA_CFLAGS', 'EXTRA_LDFLAGS', 'EXTRA_INCLUDES' ]
index c04be69e505bfbbfb61ad10b32eafc14d7d3ba18..86eb730d5da819bcdac7bb8745760155842aeb13 100644 (file)
@@ -124,6 +124,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                   manpages=None,
                   private_library=False,
                   grouping_library=False,
+                  allow_undefined_symbols=False,
                   enabled=True):
     '''define a Samba library'''
 
@@ -245,7 +246,8 @@ def SAMBA_LIBRARY(bld, libname, source,
         abi_directory   = "%s/%s" % (bld.path.abspath(), abi_directory),
         abi_match       = abi_match,
         private_library = private_library,
-        grouping_library=grouping_library
+        grouping_library=grouping_library,
+        allow_undefined_symbols=allow_undefined_symbols
         )
 
     if realname and not link_name:
@@ -371,6 +373,7 @@ def SAMBA_MODULE(bld, modname, source,
                  vars=None,
                  enabled=True,
                  pyembed=False,
+                 allow_undefined_symbols=False
                  ):
     '''define a Samba module.'''
 
@@ -423,6 +426,7 @@ def SAMBA_MODULE(bld, modname, source,
                       link_name=build_link_name,
                       install_path="${MODULESDIR}/%s" % subsystem,
                       pyembed=pyembed,
+                      allow_undefined_symbols=allow_undefined_symbols
                       )