summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorChristian Goetze (CG) <cg@lindenlab.com>2010-09-13 14:05:53 -0700
committerChristian Goetze (CG) <cg@lindenlab.com>2010-09-13 14:05:53 -0700
commit3a8a3301f94032af315f11e55148c6f82f6d7d73 (patch)
treecfe397695272284a08c50c9a97723e8e6ea1e17a /indra/cmake
parente0da08da6942139424aab07f8ed05845b2238be6 (diff)
Prepend passed in path arguments, except when they are system paths.
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/run_build_test.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py
index 1236604b21..e377aeef48 100644
--- a/indra/cmake/run_build_test.py
+++ b/indra/cmake/run_build_test.py
@@ -82,15 +82,23 @@ def main(command, libpath=[], vars={}):
dirs = os.environ.get(var, "").split(os.pathsep)
# Append the sequence in libpath
print "%s += %r" % (var, libpath)
- dirs.extend(libpath)
+ for dir in libpath:
+ # append system paths at the end
+ if dir in ('/lib', '/usr/lib'):
+ dirs.append(dir)
+ # prepend non-system paths
+ else:
+ dirs.insert(0, dir)
+
# Filter out some useless pieces
clean_dirs = []
for dir in dirs:
if dir and dir not in ('', '.'):
clean_dirs.append(dir)
+
# Now rebuild the path string. This way we use a minimum of separators
# -- and we avoid adding a pointless separator when libpath is empty.
- os.environ[var] = os.pathsep.join(dirs)
+ os.environ[var] = os.pathsep.join(clean_dirs)
print "%s = %r" % (var, os.environ[var])
# Now handle arbitrary environment variables. The tricky part is ensuring
# that all the keys and values we try to pass are actually strings.