From d0acf56c9c4ee38ab3c709eb173a42bf3d6d4349 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Sun, 15 Jun 2003 01:45:15 +0000 Subject: Portability fixes for non-GNU lex and yacc. (Chad Austin) --- src/CHANGES.txt | 2 ++ src/engine/SCons/Tool/lex.py | 4 ++-- src/engine/SCons/Tool/yacc.py | 4 ++-- src/setupTests.py | 2 +- test/YACC.py | 1 + test/YACCFLAGS.py | 1 + 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() -- cgit v0.12