Add --disable-rpath-private-install flag.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 4 Nov 2010 23:03:20 +0000 (00:03 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 5 Nov 2010 02:06:05 +0000 (02:06 +0000)
buildtools/wafsamba/samba_utils.py
buildtools/wafsamba/wscript

index 2a06449a1a2ff2b05af005c6b819ea6612a7e0cb..95ad86e38e180df42f0ee79300995888926146e6 100644 (file)
@@ -66,9 +66,12 @@ def ADD_LD_LIBRARY_PATH(path):
 def install_rpath(bld):
     '''the rpath value for installation'''
     bld.env['RPATH'] = []
+    ret = set()
     if bld.env.RPATH_ON_INSTALL:
-        return [bld.env.LIBDIR]
-    return []
+        ret.add(bld.env.LIBDIR)
+    if bld.env.RPATH_ON_INSTALL_PRIVATE:
+        ret.add(bld.env.PRIVATELIBDIR)
+    return list(ret)
 
 
 def build_rpath(bld):
index 7d8bb2441423c9ad8abaf9f87fe0803f72998b75..78ccaa77f21fb1ece843011e0431a39031b8b4d4 100644 (file)
@@ -53,8 +53,11 @@ def set_options(opt):
                    help=("Disable use of rpath for build binaries"),
                    action="store_true", dest='disable_rpath_build', default=False)
     gr.add_option('--disable-rpath-install',
-                   help=("Disable use of rpath for installed binaries"),
+                   help=("Disable use of rpath for library path in installed files"),
                    action="store_true", dest='disable_rpath_install', default=False)
+    gr.add_option('--disable-rpath-private-install',
+                   help=("Disable use of rpath for private library path in installed files"),
+                   action="store_true", dest='disable_rpath_private_install', default=False)
     gr.add_option('--nonshared-binary',
                    help=("Disable use of shared libs for the listed binaries"),
                    action="store", dest='NONSHARED_BINARIES', default='')
@@ -65,7 +68,7 @@ def set_options(opt):
 
     opt.add_option('--with-privatelibdir',
                    help=("private library directory [PREFIX/lib/samba4]"),
-                   action="store", dest='PRIVATELIBDIR', default='${PREFIX}/lib/samba4')
+                   action="store", dest='PRIVATELIBDIR', default=None)
 
     gr = opt.option_group('developer options')
 
@@ -264,9 +267,19 @@ def configure(conf):
         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)
+        if not conf.env.PRIVATELIBDIR:
+            conf.env.PRIVATELIBDIR = '${PREFIX}/lib/samba4'
+        conf.env.RPATH_ON_INSTALL_PRIVATE = (
+            not Options.options.disable_rpath_private_install)
     else:
         conf.env.RPATH_ON_INSTALL = False
         conf.env.RPATH_ON_BUILD   = False
+        conf.env.RPATH_ON_INSTALL_PRIVATE = False
+        if not conf.env.PRIVATELIBDIR:
+            # rpath is not possible so there is no sense in having a
+            # private library directory by default.
+            # the user can of course always override it.
+            conf.env.PRIVATELIBDIR = conf.env.LIBDIR
 
     # we should use the PIC options in waf instead
     # Some compilo didn't support -fPIC but just print a warning