summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-05-31 15:33:17 -0400
committerAli Saidi <saidi@eecs.umich.edu>2007-05-31 15:33:17 -0400
commit473bf1a66a3e89659fe46b547d380c65073a5e7c (patch)
tree3f0353215edc33b0cfde1414caf0c4f1f693c915 /ext
parent0193476ea790963884059c27d7fdd607a6f79019 (diff)
downloadgem5-473bf1a66a3e89659fe46b547d380c65073a5e7c.tar.xz
check that m4 is available before trying to use it
--HG-- extra : convert_revision : 8d4d75451fc003e3843e306008ad0632bbf0217a
Diffstat (limited to 'ext')
-rw-r--r--ext/libelf/SConscript6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/libelf/SConscript b/ext/libelf/SConscript
index aebd0da85..d6f1e351b 100644
--- a/ext/libelf/SConscript
+++ b/ext/libelf/SConscript
@@ -92,11 +92,17 @@ if env.get('CC'):
m4env['CC'] = env['CC']
if env.get('CXX'):
m4env['CXX'] = env['CXX']
+
# If we have gm4 use it
if subprocess.Popen("gm4 --version", shell=True, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, close_fds=True).communicate()[0].find('GNU') >= 0:
m4env['M4'] = 'gm4'
+# Check that m4 is available
+if not m4env.get('M4'):
+ print "Error: Can't find version of M4 macro processor. Please install M4 and try again."
+ Exit(1)
+
m4env.Append(M4FLAGS='-DSRCDIR=%s' % Dir('.').path)
m4env['M4COM'] = '$M4 $M4FLAGS $SOURCES > $TARGET'
m4env.M4(target=File('libelf_convert.c'),