summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2005-08-30 23:34:36 -0400
committerSteve Reinhardt <stever@eecs.umich.edu>2005-08-30 23:34:36 -0400
commit87dfb4050e1136a3bc90762a50b84ada0ada1ced (patch)
tree1d48dd26acbbc0d163a851d6e22ea9decfcaccb0
parentc4793184bd32e97e8932a9a0355d8a7b8a214752 (diff)
downloadgem5-87dfb4050e1136a3bc90762a50b84ada0ada1ced.tar.xz
Fix to work with older versions of mysql_config that don't support --include.
Also add mysql version check. --HG-- extra : convert_revision : 36b6174ed1c64e8c5516f6adee71f27e068ceca2
-rw-r--r--build/SConstruct26
1 files changed, 23 insertions, 3 deletions
diff --git a/build/SConstruct b/build/SConstruct
index c091f4795..f30014154 100644
--- a/build/SConstruct
+++ b/build/SConstruct
@@ -196,10 +196,30 @@ if not have_fenv:
print "Warning: Header file <fenv.h> not found."
print " This host has no IEEE FP rounding mode control."
-# Check for mysql
+# Check for mysql.
mysql_config = WhereIs('mysql_config')
have_mysql = mysql_config != None
+# Check MySQL version.
+if have_mysql:
+ mysql_vers = os.popen(mysql_config + ' --version').read()
+ mv = [int(v) for v in mysql_vers.split('.')]
+ # This version check is probably overly conservative, but it deals
+ # with the versions we have installed.
+ if mv[0] < 3 or (mv[0] == 3 and mv[1] < 23) or (mv[0] == 4 and mv[1] < 1):
+ print "Warning: MySQL v3.23 or v4.1 or newer required."
+ have_mysql = False
+
+# Set up mysql_config commands.
+if have_mysql:
+ mysql_config_include = mysql_config + ' --include'
+ if os.system(mysql_config_include + ' > /dev/null') != 0:
+ # older mysql_config versions don't support --include, use
+ # --cflags instead
+ mysql_config_include = mysql_config + ' --cflags'
+ # This seems to work in all versions
+ mysql_config_libs = mysql_config + ' --libs'
+
env = conf.Finish()
# The source operand is a Value node containing the value of the option.
@@ -283,8 +303,8 @@ for build_dir in build_dirs:
env['USE_MYSQL'] = False
else:
print "Compiling in", build_dir, "with MySQL support."
- env.ParseConfig(mysql_config + ' --libs')
- env.ParseConfig(mysql_config + ' --include')
+ env.ParseConfig(mysql_config_libs)
+ env.ParseConfig(mysql_config_include)
# The m5/SConscript file sets up the build rules in 'env' according
# to the configured options.