waf: Put private libraries in a separate directory when building.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 5 Nov 2010 01:30:01 +0000 (02:30 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 5 Nov 2010 02:06:06 +0000 (02:06 +0000)
Thanks to Tridge for pointing out what exactly I had to change. :-)

buildtools/wafsamba/samba_install.py
buildtools/wafsamba/samba_utils.py
buildtools/wafsamba/wafsamba.py
source4/selftest/wscript
source4/wscript

index 8b9a308a2c35e66a6a78e96406800d6047990de2..9401d228c56384d3eb20cfb2a27c2ec030df7a79 100644 (file)
@@ -160,7 +160,11 @@ def symlink_lib(self):
 
     link_target = getattr(self, 'link_name', '')
     if link_target == '':
-        link_target = '%s/%s' % (LIB_PATH, self.bld.make_libname(self.target, version=soext))
+        basename = self.bld.make_libname(self.target, version=soext)
+        if getattr(self, "private_library", False):
+            link_target = '%s/private/%s' % (LIB_PATH, basename)
+        else:
+            link_target = '%s/%s' % (LIB_PATH, basename)
 
     link_target = os.path.join(blddir, link_target)
 
index b9c8eca1bbd3478487d2d9aecc1c4273f588f9b0..7006381ae6034a4a54e362d03050514825a6515f 100644 (file)
@@ -76,11 +76,12 @@ def install_rpath(bld):
 
 def build_rpath(bld):
     '''the rpath value for build'''
-    rpath = os.path.normpath('%s/%s' % (bld.env.BUILD_DIRECTORY, LIB_PATH))
+    rpaths = [os.path.normpath('%s/%s' % (bld.env.BUILD_DIRECTORY, d)) for d in ("shared", "shared/private")]
     bld.env['RPATH'] = []
     if bld.env.RPATH_ON_BUILD:
-        return [rpath]
-    ADD_LD_LIBRARY_PATH(rpath)
+        return rpaths
+    for rpath in rpaths:
+        ADD_LD_LIBRARY_PATH(rpath)
     return []
 
 
index daab00c33cbbaa085090779ab1d414b3771961ed..dc25145de74c097cfe48a0991742ce7567639f77 100644 (file)
@@ -56,6 +56,7 @@ def SAMBA_BUILD_ENV(conf):
     '''create the samba build environment'''
     conf.env.BUILD_DIRECTORY = conf.blddir
     mkdir_p(os.path.join(conf.blddir, LIB_PATH))
+    mkdir_p(os.path.join(conf.blddir, LIB_PATH, "private"))
     mkdir_p(os.path.join(conf.blddir, "modules"))
     mkdir_p(os.path.join(conf.blddir, 'python/samba/dcerpc'))
     # this allows all of the bin/shared and bin/python targets
index 2273def93095f127f1a0606d88fe3880b9339395..19f7a0bb932644f62f406614a3985aeb97155bad 100644 (file)
@@ -140,6 +140,7 @@ def cmd_testonly(opt):
 
     # this is needed for systems without rpath, or with rpath disabled
     ADD_LD_LIBRARY_PATH('bin/shared')
+    ADD_LD_LIBRARY_PATH('bin/shared/private')
 
     # if we are using a system version of ldb then we need to tell it to
     # load modules from our modules path
index fad9c3451f933d7dfe5c3bc2470da96b390172a6..8b2ab58d273bff7a0b155ebabc7890671c868e7e 100644 (file)
@@ -156,7 +156,7 @@ def build(bld):
 
 def pydoctor(ctx):
     '''build python apidocs'''
-    cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package bin/python/samba'
+    cmd='PYTHONPATH=bin/python pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package bin/python/samba'
     print("Running: %s" % cmd)
     os.system(cmd)
 
@@ -166,7 +166,7 @@ def wafdocs(ctx):
     os.system('pwd')
     list = recursive_dirlist('../buildtools/wafsamba', '.', pattern='*.py')
 
-    cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
+    cmd='PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
     print(list)
     for f in list:
         cmd += ' --add-module %s' % f