From 63a44d0cb5494ed1078de411b55cb1c9a8307cec Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 18 Nov 2011 19:09:27 -0500 Subject: [PATCH] make chrpath optional There's no reason to require chrpath for distributions who only want to compile locally and then install elsewhere for packaging. So allow them to specify CHRPATH='' via the env to disable this requirement. Signed-off-by: Mike Frysinger --- SConstruct | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-) diff --git a/SConstruct b/SConstruct index ccaca7d..68bf367 100644 --- a/SConstruct +++ b/SConstruct @@ -270,7 +270,7 @@ def installdir(dir, add_destdir=True): # Honor the specified installation prefix in link paths. env.Prepend(LIBPATH=[installdir('libdir')]) -if env["shared"]: +if env["shared"] and env['CHRPATH']: env.Prepend(RPATH=[installdir('libdir')]) # Give deheader a way to set compiler flags @@ -390,17 +390,18 @@ config = Configure(env, custom_tests = { 'CheckPKG' : CheckPKG, 'CheckXsltproc' : CheckXsltproc}) env.Prepend(LIBPATH=[os.path.realpath(os.curdir)]) -if config.CheckExecutable('$CHRPATH -v', 'chrpath'): - # Tell generated binaries to look in the current directory for - # shared libraries so we can run tests without hassle. Should be - # handled sanely by scons on all systems. Not good to use '.' or - # a relative path here; it's a security risk. At install time we - # use chrpath to edit this out of RPATH. - if env["shared"]: - env.Prepend(RPATH=[os.path.realpath(os.curdir)]) -else: - print "chrpath is not available, forcing static linking." - env["shared"] = False +if env['CHRPATH']: + if config.CheckExecutable('$CHRPATH -v', 'chrpath'): + # Tell generated binaries to look in the current directory for + # shared libraries so we can run tests without hassle. Should be + # handled sanely by scons on all systems. Not good to use '.' or + # a relative path here; it's a security risk. At install time we + # use chrpath to edit this out of RPATH. + if env["shared"]: + env.Prepend(RPATH=[os.path.realpath(os.curdir)]) + else: + print "chrpath is not available, forcing static linking." + env["shared"] = False confdefs = ["/* gpsd_config.h. Generated by scons, do not hand-hack. */\n"] @@ -1140,7 +1141,7 @@ if qt_env: binaryinstall.append(LibraryInstall(qt_env, installdir('libdir'), compiled_qgpsmmlib)) # We don't use installdir here in order to avoid having DESTDIR affect the rpath -if env["shared"]: +if env['CHRPATH']: env.AddPostAction(binaryinstall, '$CHRPATH -r "%s" "$TARGET"' \ % (installdir('libdir', False), )) -- 1.7.8.3