Commit f889c326 authored by Ben Cooksley's avatar Ben Cooksley

Don't alter PATH or the library search path if we're handling a system prefix.

This breaks badly on FreeBSD, as it's loader will end up trying to load 32bit libraries to support a 64bit process.
parent 2902c967
......@@ -25,7 +25,7 @@ def generateFor( installPrefix ):
if sys.platform != 'win32' and sys.platform != 'darwin':
# The we need to consider the system install prefix
# Normally these would be setup for us, but this is just to be absolutely sure everything is right
envChanges = changesForPrefix( "/usr/", envChanges )
envChanges = changesForPrefix( "/usr/", envChanges, systemPrefix=True )
# Now we can merge this into the real environment
splitChar = separatorCharacter()
......@@ -47,7 +47,7 @@ def generateFor( installPrefix ):
# All done
return clonedEnv
def changesForPrefix( installPrefix, envChanges ):
def changesForPrefix( installPrefix, envChanges, systemPrefix=False ):
# Setup CMAKE_PREFIX_PATH
extraLocation = os.path.join( installPrefix )
if os.path.exists( extraLocation ):
......@@ -55,14 +55,14 @@ def changesForPrefix( installPrefix, envChanges ):
# Setup PATH
extraLocation = os.path.join( installPrefix, 'bin' )
if os.path.exists( extraLocation ):
if os.path.exists( extraLocation ) and not systemPrefix:
envChanges['PATH'].append(extraLocation)
# Handle those paths which involve $prefix/lib*
for libraryDirName in ['lib', 'lib32', 'lib64', 'lib/x86_64-linux-gnu', 'libdata']:
# Do LD_LIBRARY_PATH
extraLocation = os.path.join( installPrefix, libraryDirName )
if os.path.exists( extraLocation ):
if os.path.exists( extraLocation ) and not systemPrefix:
envChanges[ libraryPathVariableName() ].append(extraLocation)
# Now do PKG_CONFIG_PATH
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment