diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-03-22 16:57:05 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-06 20:27:00 +1000 |
commit | b18f85041e65c7ebf47d6cd5b51e90a5f06129b4 (patch) | |
tree | d964af08d2e2bbdcfe475529bdfd4795f7f8be1a /buildtools/wafsamba | |
parent | 0dc64c745891725a6a5bf1b71749c9dceacdd519 (diff) | |
download | samba-b18f85041e65c7ebf47d6cd5b51e90a5f06129b4.tar.gz samba-b18f85041e65c7ebf47d6cd5b51e90a5f06129b4.tar.bz2 samba-b18f85041e65c7ebf47d6cd5b51e90a5f06129b4.zip |
build: don't use double binaries/libs if not needed
when rpath is disabled on both install and build we don't need the
double binaries
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r-- | buildtools/wafsamba/wafsamba.py | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 7289b07cf0..8a37edfb88 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -128,14 +128,21 @@ def SAMBA_LIBRARY(bld, libname, source, install_path = '${LIBDIR}' install_path = SUBST_VARS_RECURSIVE(install_path, bld.env) - if install: + # we don't need the double libraries if rpath is off + if (bld.env.RPATH_ON_INSTALL == False and + bld.env.RPATH_ON_BUILD == False): + install_target = libname + else: + install_target = libname + '.inst' + + if install and install_target != libname: # create a separate install library, which may have # different rpath settings - SET_TARGET_TYPE(bld, libname + '.inst', 'LIBRARY') + SET_TARGET_TYPE(bld, install_target, 'LIBRARY') t = bld( features = 'cc cshlib', source = [], - target = libname + '.inst', + target = install_target, samba_cflags = CURRENT_CFLAGS(bld, libname, cflags), depends_on = depends_on, samba_deps = deps, @@ -147,6 +154,7 @@ def SAMBA_LIBRARY(bld, libname, source, ) t.env['RPATH'] = install_rpath(bld) + if install: if vnum: vnum_base = vnum.split('.')[0] install_name = 'lib%s.so.%s' % (libname, vnum) @@ -160,7 +168,6 @@ def SAMBA_LIBRARY(bld, libname, source, if install_link: bld.symlink_as(os.path.join(install_path, install_link), install_name) - if autoproto is not None: bld.SAMBA_AUTOPROTO(autoproto, source) @@ -235,14 +242,21 @@ def SAMBA_BINARY(bld, binname, source, install_path = '${BINDIR}' install_path = SUBST_VARS_RECURSIVE(install_path, bld.env) - if install: + # we don't need the double binaries if rpath is off + if (bld.env.RPATH_ON_INSTALL == False and + bld.env.RPATH_ON_BUILD == False): + install_target = binname + else: + install_target = binname + '.inst' + + if install and install_target != binname: # we create a separate 'install' binary, which # will have different rpath settings - SET_TARGET_TYPE(bld, binname + '.inst', 'BINARY') + SET_TARGET_TYPE(bld, install_target, 'BINARY') t = bld( features = features, source = [], - target = binname + '.inst', + target = install_target, samba_cflags = CURRENT_CFLAGS(bld, binname, cflags), samba_deps = deps, samba_includes = includes, @@ -254,8 +268,9 @@ def SAMBA_BINARY(bld, binname, source, ) t.env['RPATH'] = install_rpath(bld) + if install: bld.install_as(os.path.join(install_path, binname), - binname + '.inst', + install_target, chmod=0755) # setup the subsystem_name as an alias for the real |