summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-06-15 01:45:15 (GMT)
committerSteven Knight <knight@baldmt.com>2003-06-15 01:45:15 (GMT)
commitd0acf56c9c4ee38ab3c709eb173a42bf3d6d4349 (patch)
tree43ce58bd9f5dc689acb78a78f83b79c601eb3cfd
parent7414ccf0c3ddcdde49574a3a0e6f36c96908c549 (diff)
downloadSCons-d0acf56c9c4ee38ab3c709eb173a42bf3d6d4349.zip
SCons-d0acf56c9c4ee38ab3c709eb173a42bf3d6d4349.tar.gz
SCons-d0acf56c9c4ee38ab3c709eb173a42bf3d6d4349.tar.bz2
Portability fixes for non-GNU lex and yacc. (Chad Austin)
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/Tool/lex.py4
-rw-r--r--src/engine/SCons/Tool/yacc.py4
-rw-r--r--src/setupTests.py2
-rw-r--r--test/YACC.py1
-rw-r--r--test/YACCFLAGS.py1
6 files changed, 9 insertions, 5 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 3c38ecf..9b326d3 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -14,6 +14,8 @@ RELEASE 0.15 - XXX
- Fix the _concat() documentation, and add a test for it.
+ - Portability fixes for non-GNU versions of lex and yacc.
+
From Matt Balvin:
- Fix handling of library prefixes when the subdirectory matches
diff --git a/src/engine/SCons/Tool/lex.py b/src/engine/SCons/Tool/lex.py
index 95a5315..9ef2167 100644
--- a/src/engine/SCons/Tool/lex.py
+++ b/src/engine/SCons/Tool/lex.py
@@ -43,9 +43,9 @@ def generate(env):
c_file.add_action('.l', '$LEXCOM')
cxx_file.add_action('.ll', '$LEXCOM')
- env['LEX'] = 'lex'
+ env['LEX'] = env.Detect('flex') or 'lex'
env['LEXFLAGS'] = ''
env['LEXCOM'] = '$LEX $LEXFLAGS -t $SOURCES > $TARGET'
def exists(env):
- return env.Detect('lex')
+ return env.Detect(['flex', 'lex'])
diff --git a/src/engine/SCons/Tool/yacc.py b/src/engine/SCons/Tool/yacc.py
index 0c80cf8..7fabbf2 100644
--- a/src/engine/SCons/Tool/yacc.py
+++ b/src/engine/SCons/Tool/yacc.py
@@ -42,9 +42,9 @@ def generate(env):
c_file.add_action('.y', '$YACCCOM')
cxx_file.add_action('.yy', '$YACCCOM')
- env['YACC'] = 'yacc'
+ env['YACC'] = env.Detect('bison') or 'yacc'
env['YACCFLAGS'] = ''
env['YACCCOM'] = '$YACC $YACCFLAGS -o $TARGET $SOURCES'
def exists(env):
- return env.Detect('yacc')
+ return env.Detect(['bison', 'yacc'])
diff --git a/src/setupTests.py b/src/setupTests.py
index 6f73e5e..b7adf0c 100644
--- a/src/setupTests.py
+++ b/src/setupTests.py
@@ -77,7 +77,7 @@ version_lib = '%s/usr/lib/%s' % (root, scons_version)
def installed(lib):
return 'Installed SCons library modules into %s' % lib
-os.system("tar zxf %s" % tar_gz)
+os.system("gunzip -c %s | tar xf -" % tar_gz)
# Verify that a virgin installation installs the standalone library.
test.run(chdir = scons_version,
diff --git a/test/YACC.py b/test/YACC.py
index b44add1..68a0ba5 100644
--- a/test/YACC.py
+++ b/test/YACC.py
@@ -118,6 +118,7 @@ yyerror(s)
char *s;
{
fprintf(stderr, "%%s\n", s);
+ return 0;
}
yylex()
diff --git a/test/YACCFLAGS.py b/test/YACCFLAGS.py
index 3ed6b6b..022b238 100644
--- a/test/YACCFLAGS.py
+++ b/test/YACCFLAGS.py
@@ -107,6 +107,7 @@ yyerror(s)
char *s;
{
fprintf(stderr, "%%s\n", s);
+ return 0;
}
yylex()