build: added --disable-shared option
authorAndrew Tridgell <tridge@samba.org>
Sun, 21 Mar 2010 00:04:57 +0000 (11:04 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:59 +0000 (20:26 +1000)
buildtools/wafsamba/wafsamba.py
lib/replace/wscript

index 7324f8ff48c6e73919f7925ded2940f4868fb054..bfe20ce5ebda1729aa3737478ac3bb4179337bf3 100644 (file)
@@ -79,10 +79,10 @@ def SAMBA_LIBRARY(bld, libname, source,
         SET_TARGET_TYPE(bld, libname, 'EMPTY')
         return
 
-    if not SET_TARGET_TYPE(bld, libname, 'LIBRARY'):
-        return
-
-    obj_target = libname + '.objlist'
+    if bld.env.DISABLE_SHARED:
+        obj_target = libname
+    else:
+        obj_target = libname + '.objlist'
 
     # first create a target for building the object files for this library
     # by separating in this way, we avoid recompiling the C files
@@ -99,6 +99,12 @@ def SAMBA_LIBRARY(bld, libname, source,
                         depends_on     = depends_on,
                         local_include  = local_include)
 
+    if bld.env.DISABLE_SHARED:
+        return
+
+    if not SET_TARGET_TYPE(bld, libname, 'LIBRARY'):
+        return
+
     # the library itself will depend on that object target
     deps += ' ' + public_deps
     deps = TO_LIST(deps)
@@ -283,7 +289,7 @@ def SAMBA_MODULE(bld, modname, source,
     # all disabled
     bld.ADD_INIT_FUNCTION(subsystem, modname, init_function)
 
-    if internal_module:
+    if internal_module or bld.env.DISABLE_SHARED:
         # treat internal modules as subsystems for now
         SAMBA_SUBSYSTEM(bld, modname, source,
                         deps=deps,
index 97e5534d5db897d49b72384c3b6082f5f3c4cceb..f6c19030913c266f6248c955cf1e53b3a9431a7b 100644 (file)
@@ -20,6 +20,9 @@ def set_options(opt):
     opt.add_option('--sbindir',
                    help=("system admin executables [PREFIX/sbin]"),
                    action="store", dest='SBINDIR', default='${PREFIX}/sbin')
+    opt.add_option('--disable-shared',
+                   help=("Disable all use of shared libraries"),
+                   action="store_true", dest='disable_shared', default=False)
     opt.add_option('--disable-rpath',
                    help=("Disable use of rpath for build binaries"),
                    action="store_true", dest='disable_rpath_build', default=False)
@@ -70,8 +73,10 @@ def configure(conf):
     conf.env.BINDIR = Options.options.BINDIR
     conf.env.SBINDIR = Options.options.SBINDIR
 
+    conf.env.DISABLE_SHARED = Options.options.disable_shared
+
     # check for rpath
-    if conf.CHECK_RPATH_SUPPORT():
+    if not conf.env.DISABLE_SHARED and conf.CHECK_RPATH_SUPPORT():
         conf.env.RPATH_ON_BUILD   = not Options.options.disable_rpath_build
         conf.env.RPATH_ON_INSTALL = (conf.env.RPATH_ON_BUILD and
                                      not Options.options.disable_rpath_install)