summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-28 15:41:49 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:12 +1000
commit3b380ea7ac9f33f208a9479d34bd514f8e3d5bf4 (patch)
treea397bff2e05acec5212ef3289d634796a88e6e39 /buildtools
parent28a05bc1b0ff7e090753c9d8e248f00136fb491a (diff)
downloadsamba-3b380ea7ac9f33f208a9479d34bd514f8e3d5bf4.tar.gz
samba-3b380ea7ac9f33f208a9479d34bd514f8e3d5bf4.tar.bz2
samba-3b380ea7ac9f33f208a9479d34bd514f8e3d5bf4.zip
build: better control over bundled library extensions
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_bundled.py32
-rw-r--r--buildtools/wafsamba/wscript22
2 files changed, 38 insertions, 16 deletions
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 75317d97ba..d4dbe221db 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -3,18 +3,15 @@
from Configure import conf
from samba_utils import *
-@conf
-def BUNDLED_LIBRARY_EXTENSION(conf, extension):
- '''set extension to add to bundled libraries'''
- if not 'BUNDLED_EXTENSION' in conf.env:
- conf.env.BUNDLED_EXTENSION = extension
-
def BUNDLED_NAME(bld, name, bundled_extension):
'''possibly rename a library to include a bundled extension'''
- if bld.env.DISABLE_SHARED:
+ if bld.env.DISABLE_SHARED or not bundled_extension:
return name
- if bundled_extension and 'BUNDLED_EXTENSION' in bld.env:
- return name + '-' + bld.env.BUNDLED_EXTENSION
+ if name in bld.env.BUNDLED_EXTENSION_EXCEPTION:
+ return name
+ extension = getattr(bld.env, 'BUNDLED_EXTENSION', '')
+ if extension:
+ return name + '-' + extension
return name
@@ -26,3 +23,20 @@ def BUILTIN_LIBRARY(bld, name):
if name in bld.env.BUILTIN_LIBRARIES:
return True
return False
+
+
+def BUILTIN_DEFAULT(opt, builtins):
+ '''set a comma separated default list of builtin libraries for this package'''
+ if 'BUILTIN_LIBRARIES_DEFAULT' in Options.options:
+ return
+ Options.options['BUILTIN_LIBRARIES_DEFAULT'] = builtins
+Options.Handler.BUILTIN_DEFAULT = BUILTIN_DEFAULT
+
+
+def BUNDLED_EXTENSION_DEFAULT(opt, extension, noextenion=''):
+ '''set a default bundled library extension'''
+ if 'BUNDLED_EXTENSION_DEFAULT' in Options.options:
+ return
+ Options.options['BUNDLED_EXTENSION_DEFAULT'] = extension
+ Options.options['BUNDLED_EXTENSION_EXCEPTION'] = noextenion
+Options.Handler.BUNDLED_EXTENSION_DEFAULT = BUNDLED_EXTENSION_DEFAULT
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index dbe06f2477..315c3e58a9 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -14,12 +14,21 @@ def set_options(opt):
opt.add_option('--bundled-libraries',
help=("list of bundled libraries. Can be 'NONE' or 'ALL' [auto]"),
action="store", dest='BUNDLED_LIBS', default='')
+
+ extension_default = Options.options['BUNDLED_EXTENSION_DEFAULT']
opt.add_option('--bundled-library-extension',
- help=("name extension for bundled libraries [auto]"),
- action="store", dest='BUNDLED_EXTENSION', default=None)
+ help=("name extension for bundled libraries [%s]" % extension_default),
+ action="store", dest='BUNDLED_EXTENSION', default=extension_default)
+
+ extension_exception = Options.options['BUNDLED_EXTENSION_EXCEPTION']
+ opt.add_option('--bundled-extension-exception',
+ help=("list of libraries to not apply extension to [%s]" % extension_exception),
+ action="store", dest='BUNDLED_EXTENSION_EXCEPTION', default=extension_exception)
+
+ builtin_defauilt = Options.options['BUILTIN_LIBRARIES_DEFAULT']
opt.add_option('--builtin-libraries',
- help=("list of libraries to build directly into binaries [none]"),
- action="store", dest='BUILTIN_LIBRARIES', default='')
+ help=("list of libraries to build directly into binaries [%s]" % builtin_defauilt),
+ action="store", dest='BUILTIN_LIBRARIES', default=builtin_defauilt)
opt.add_option('--libdir',
help=("object code libraries [PREFIX/lib]"),
@@ -87,11 +96,10 @@ def configure(conf):
conf.env.MODULESDIR = Options.options.MODULESDIR
conf.env.BUNDLED_LIBS = Options.options.BUNDLED_LIBS.split(',')
conf.env.BUILTIN_LIBRARIES = Options.options.BUILTIN_LIBRARIES.split(',')
-
conf.env.DISABLE_SHARED = Options.options.disable_shared
- if Options.options.BUNDLED_EXTENSION:
- conf.env.BUNDLED_EXTENSION = Options.options.BUNDLED_EXTENSION
+ conf.env.BUNDLED_EXTENSION = Options.options.BUNDLED_EXTENSION
+ conf.env.BUNDLED_EXTENSION_EXCEPTION = Options.options.BUNDLED_EXTENSION_EXCEPTION.split(',')
# see if we can compile and run a simple C program
conf.CHECK_CODE('printf("hello world\\n")',