gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH 3/3] make chrpath optional


From: Mike Frysinger
Subject: [gpsd-dev] [PATCH 3/3] make chrpath optional
Date: Fri, 18 Nov 2011 19:29:15 -0500

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 <address@hidden>
---
 SConstruct |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/SConstruct b/SConstruct
index 0b3113f..c7f24fe 100644
--- a/SConstruct
+++ b/SConstruct
@@ -260,7 +260,7 @@ def installdir(dir):
 
 # 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
@@ -380,17 +380,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"]
 
@@ -1127,7 +1128,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"' \
                       % (env['prefix'] + env['libdir']))
 
-- 
1.7.6.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]