wafsamba: Move version script handling out of SAMBA_LIBRARY.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 17 Dec 2010 18:16:33 +0000 (19:16 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 17 Dec 2010 18:16:33 +0000 (19:16 +0100)
buildtools/wafsamba/samba_deps.py
buildtools/wafsamba/samba_install.py
buildtools/wafsamba/wafsamba.py

index 1f27026a8511e81c9a7ba34b9703785aaf19032c..6bd2cca99e1209fd21783d533f6e8c697e1b068a 100644 (file)
@@ -1099,7 +1099,7 @@ def check_project_rules(bld):
     global tstart
     tstart = time.clock()
 
     global tstart
     tstart = time.clock()
 
-    bld.new_rules = True    
+    bld.new_rules = True
     Logs.info("Checking project rules ...")
 
     debug('deps: project rules checking started')
     Logs.info("Checking project rules ...")
 
     debug('deps: project rules checking started')
index 471ef5a49eaed33ce17d0339e580c7e6edb412a0..3c24679a72e0c489c921f068f78dd2e1d757c4b4 100644 (file)
@@ -148,6 +148,18 @@ def apply_soname(self):
         self.env.append_value('LINKFLAGS', self.env.SONAME_ST % self.soname)
         self.env.SONAME_ST = ''
 
         self.env.append_value('LINKFLAGS', self.env.SONAME_ST % self.soname)
         self.env.SONAME_ST = ''
 
+@feature('cshlib')
+@after('apply_implib')
+@before('apply_vnum')
+def apply_vscript(self):
+    '''add version-script arguments to library build'''
+
+    if self.env.HAVE_LD_VERSION_SCRIPT and getattr(self, 'version_script', ''):
+        self.env.append_value('LINKFLAGS', "-Wl,--version-script=%s" %
+            os.path.join(self.path.abspath(self.env), self.version_script))
+        self.version_script = None
+
+
 ##############################
 # handle the creation of links for libraries and binaries in the build tree
 
 ##############################
 # handle the creation of links for libraries and binaries in the build tree
 
index 40dae9bd0aab8a094d369dbf4b96e9a930d4dd73..33ed018d4a5fea7e84c48a5837f5eba455cb7385 100644 (file)
@@ -212,13 +212,14 @@ def SAMBA_LIBRARY(bld, libname, source,
             version = None
         if version:
             bld.ABI_VSCRIPT(libname, abi_directory, version, vscript)
             version = None
         if version:
             bld.ABI_VSCRIPT(libname, abi_directory, version, vscript)
-            ldflags.append("-Wl,--version-script=%s/%s" % (bld.path.abspath(bld.env), vscript))
             fullname = bld.env.shlib_PATTERN % bundled_name
             bld.add_manual_dependency(bld.path.find_or_declare(fullname), bld.path.find_or_declare(vscript))
             if Options.is_install:
                 # also make the .inst file depend on the vscript
                 instname = bld.env.shlib_PATTERN % (bundled_name + '.inst')
                 bld.add_manual_dependency(bld.path.find_or_declare(instname), bld.path.find_or_declare(vscript))
             fullname = bld.env.shlib_PATTERN % bundled_name
             bld.add_manual_dependency(bld.path.find_or_declare(fullname), bld.path.find_or_declare(vscript))
             if Options.is_install:
                 # also make the .inst file depend on the vscript
                 instname = bld.env.shlib_PATTERN % (bundled_name + '.inst')
                 bld.add_manual_dependency(bld.path.find_or_declare(instname), bld.path.find_or_declare(vscript))
+    else:
+        vscript = None
 
     bld.SET_BUILD_GROUP(group)
     t = bld(
 
     bld.SET_BUILD_GROUP(group)
     t = bld(
@@ -229,6 +230,7 @@ def SAMBA_LIBRARY(bld, libname, source,
         samba_ldflags   = ldflags,
         samba_deps      = deps,
         samba_includes  = includes,
         samba_ldflags   = ldflags,
         samba_deps      = deps,
         samba_includes  = includes,
+        version_script  = vscript,
         local_include   = local_include,
         vnum            = vnum,
         soname          = soname,
         local_include   = local_include,
         vnum            = vnum,
         soname          = soname,