From: stevenknight Date: Sun, 15 Jun 2003 01:45:15 +0000 (+0000) Subject: Portability fixes for non-GNU lex and yacc. (Chad Austin) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=daec12aa6e04ebf599ad5e1e1a198958e5487b68;p=scons.git Portability fixes for non-GNU lex and yacc. (Chad Austin) git-svn-id: http://scons.tigris.org/svn/scons/trunk@713 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 3c38ecf1..9b326d36 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 95a53156..9ef21673 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 0c80cf83..7fabbf24 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 6f73e5ea..b7adf0cf 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 b44add17..68a0ba52 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 3ed6b6b2..022b2383 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()