changeset 24a198a46ff0 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=24a198a46ff0
description:
scons: compile on systems where python2 and python3 co-exist
Compile gem5 on systems where python2 and python3 co-exists without any
changes in path. python2-config is chosen over python-config if it
exists.
Committed by: Nilay Vaish <[email protected]>
diffstat:
SConstruct | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r 5c2ecad1a3c9 -r 24a198a46ff0 SConstruct
--- a/SConstruct Wed Apr 09 16:01:58 2014 +0200
+++ b/SConstruct Thu Apr 10 13:40:15 2014 -0500
@@ -872,7 +872,12 @@
# we add them explicitly below. If you want to link in an alternate
# version of python, see above for instructions on how to invoke
# scons with the appropriate PATH set.
-py_includes = readCommand(['python-config', '--includes'],
+#
+# First we check if python2-config exists, else we use python-config
+python_config = readCommand(['which', 'python2-config'], exception='').strip()
+if not os.path.exists(python_config):
+ python_config = readCommand(['which', 'python-config'], exception='')
+py_includes = readCommand([python_config, '--includes'],
exception='').split()
# Strip the -I from the include folders before adding them to the
# CPPPATH
@@ -880,7 +885,7 @@
# Read the linker flags and split them into libraries and other link
# flags. The libraries are added later through the call the CheckLib.
-py_ld_flags = readCommand(['python-config', '--ldflags'], exception='').split()
+py_ld_flags = readCommand([python_config, '--ldflags'], exception='').split()
py_libs = []
for lib in py_ld_flags:
if not lib.startswith('-l'):
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev