s4-waf: sanitize library names like the old build system did, only add
authorJelmer Vernooij <jelmer@samba.org>
Mon, 31 May 2010 00:43:17 +0000 (02:43 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 31 May 2010 01:28:42 +0000 (03:28 +0200)
-samba4 suffix for libraries that are bundled.

buildtools/wafsamba/wafsamba.py
lib/popt/wscript
lib/talloc/wscript
lib/tdb/wscript
lib/tevent/wscript

index 4dac6fb290f90a3e80b31bdcbaf4fbff096a456b..eb5aa91d2d726760c6061798910376f52b9b5d52 100644 (file)
@@ -115,6 +115,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                   abi_file=None,
                   abi_match=None,
                   hide_symbols=False,
                   abi_file=None,
                   abi_match=None,
                   hide_symbols=False,
+                  is_bundled=False,
                   enabled=True):
     '''define a Samba library'''
 
                   enabled=True):
     '''define a Samba library'''
 
@@ -163,8 +164,11 @@ def SAMBA_LIBRARY(bld, libname, source,
     deps = TO_LIST(deps)
     deps.append(obj_target)
 
     deps = TO_LIST(deps)
     deps.append(obj_target)
 
-    if target_type == 'PYTHON' or realname:
-        bundled_name = libname
+    if target_type == 'PYTHON' or realname or not is_bundled:
+        # Sanitize the library name
+        bundled_name = libname.lower().replace('_', '-')
+        while bundled_name.startswith("lib"):
+            bundled_name = bundled_name[3:]
     else:
         bundled_name = BUNDLED_NAME(bld, libname, bundled_extension)
 
     else:
         bundled_name = BUNDLED_NAME(bld, libname, bundled_extension)
 
index 425402ebe737120c99b46d740f43cff11d581657..7d236dd3365778fd133468586ebbfee5d7d22d9f 100644 (file)
@@ -14,5 +14,6 @@ def build(bld):
 
     bld.SAMBA_LIBRARY('popt',
                       source='findme.c popt.c poptconfig.c popthelp.c poptparse.c',
 
     bld.SAMBA_LIBRARY('popt',
                       source='findme.c popt.c poptconfig.c popthelp.c poptparse.c',
-                      cflags='-DDBL_EPSILON=__DBL_EPSILON__'
+                      cflags='-DDBL_EPSILON=__DBL_EPSILON__',
+                                         is_bundled=True,
                       )
                       )
index 3a875060d764d0c7efcd1a094234111a091f834c..61930f67e386324175783c3338193c3d226b346e 100644 (file)
@@ -60,14 +60,14 @@ def build(bld):
                           abi_file='ABI/talloc-%s.sigs' % VERSION,
                           abi_match='talloc* _talloc*',
                           hide_symbols=True,
                           abi_file='ABI/talloc-%s.sigs' % VERSION,
                           abi_match='talloc* _talloc*',
                           hide_symbols=True,
-                          vnum=VERSION)
+                          vnum=VERSION, is_bundled=True)
 
         # should we also install the symlink to libtalloc1.so here?
         bld.SAMBA_LIBRARY('talloc-compat1',
                           'compat/talloc_compat1.c',
                           deps='talloc',
                           enabled = bld.env.TALLOC_COMPAT1,
 
         # should we also install the symlink to libtalloc1.so here?
         bld.SAMBA_LIBRARY('talloc-compat1',
                           'compat/talloc_compat1.c',
                           deps='talloc',
                           enabled = bld.env.TALLOC_COMPAT1,
-                          vnum=VERSION)
+                          vnum=VERSION, is_bundled=True)
 
     if not getattr(bld.env, '_SAMBA_BUILD_', 0) == 4:
         # s4 already has the talloc testsuite builtin to smbtorture
 
     if not getattr(bld.env, '_SAMBA_BUILD_', 0) == 4:
         # s4 already has the talloc testsuite builtin to smbtorture
index 70eb8cf5d05455de73d7e80a584be3f292e3e716..084be40c8ff9a347b26a638630c9451dd839374f 100644 (file)
@@ -69,7 +69,7 @@ def build(bld):
                           abi_file='ABI/tdb-%s.sigs' % VERSION,
                           abi_match='tdb_*',
                           hide_symbols=True,
                           abi_file='ABI/tdb-%s.sigs' % VERSION,
                           abi_match='tdb_*',
                           hide_symbols=True,
-                          vnum=VERSION)
+                          vnum=VERSION, is_bundled=not bld.env.standalone_tdb)
 
     bld.SAMBA_BINARY('tdbtorture',
                      'tools/tdbtorture.c',
 
     bld.SAMBA_BINARY('tdbtorture',
                      'tools/tdbtorture.c',
index e61133c2dc46fe99ecf33e7b6f55b0ced3e4e044..46ac62066f82cdee4e05f26751bf1a125820680b 100644 (file)
@@ -57,7 +57,8 @@ def build(bld):
                           enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
                           abi_file='ABI/tevent-%s.sigs' % VERSION,
                           abi_match='tevent_* _tevent_*',
                           enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
                           abi_file='ABI/tevent-%s.sigs' % VERSION,
                           abi_match='tevent_* _tevent_*',
-                          vnum=VERSION)
+                          vnum=VERSION, 
+                                                 is_bundled=not bld.env.standalone_tevent)
 
     if bld.env.standalone_tevent:
         bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
 
     if bld.env.standalone_tevent:
         bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'