summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-08-31 10:00:42 -0400
committerNathan Binkert <binkertn@umich.edu>2005-08-31 10:00:42 -0400
commit1b39eb38bdb285e13314c3dc0943392eb5c54419 (patch)
tree0a34879a75ab0d7825dd3c07a66b8179203ba6a8 /build
parent919aa6dd0065d3c7992a7984469a3ef856b9a128 (diff)
downloadgem5-1b39eb38bdb285e13314c3dc0943392eb5c54419.tar.xz
more scons fixes for mysql
build/SConstruct: Only the major and minor mysql version numbers are guaranteed to be integers (e.g. 4.1.10a), and since that's all we care about only try to deal with those. for older versions of mysql, the strings returned by mysql_config may have quotes in them, remove those so things work --HG-- extra : convert_revision : de32f3e76618f0caf4d5578edd61beaeef666eb6
Diffstat (limited to 'build')
-rw-r--r--build/SConstruct12
1 files changed, 8 insertions, 4 deletions
diff --git a/build/SConstruct b/build/SConstruct
index 2aac28379..5dd847ba4 100644
--- a/build/SConstruct
+++ b/build/SConstruct
@@ -196,11 +196,15 @@ 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('.')]
+ mysql_version = os.popen(mysql_config + ' --version').read()
+ mysql_version = mysql_version.split('.')
+ mysql_major = int(mysql_version[0])
+ mysql_minor = int(mysql_version[1])
# 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):
+ if mysql_major < 3 or \
+ mysql_major == 3 and mysql_minor < 23 or \
+ mysql_major == 4 and mysql_minor < 1:
print "Warning: MySQL v3.23 or v4.1 or newer required."
have_mysql = False
@@ -210,7 +214,7 @@ if have_mysql:
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'
+ mysql_config_include = mysql_config + ' --cflags | sed s/\\\'//g'
# This seems to work in all versions
mysql_config_libs = mysql_config + ' --libs'