Portability fixes for non-GNU lex and yacc. (Chad Austin)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 15 Jun 2003 01:45:15 +0000 (01:45 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 15 Jun 2003 01:45:15 +0000 (01:45 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@713 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Tool/lex.py
src/engine/SCons/Tool/yacc.py
src/setupTests.py
test/YACC.py
test/YACCFLAGS.py

index 3c38ecf1c69e2815041d9c66a40d70031daed273..9b326d366cbb5d0042c95305c0127dc32826d6c1 100644 (file)
@@ -14,6 +14,8 @@ RELEASE 0.15 - XXX
 
   - Fix the _concat() documentation, and add a test for it.
 
 
   - 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
   From Matt Balvin:
 
   - Fix handling of library prefixes when the subdirectory matches
index 95a53156f6e24aabf9f07d40bdde350d9cac1c1b..9ef21673fa55a689f2d0967e35bc9eafc93ca178 100644 (file)
@@ -43,9 +43,9 @@ def generate(env):
     c_file.add_action('.l', '$LEXCOM')
     cxx_file.add_action('.ll', '$LEXCOM')
 
     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):
     env['LEXFLAGS'] = ''
     env['LEXCOM']   = '$LEX $LEXFLAGS -t $SOURCES > $TARGET'
     
 def exists(env):
-    return env.Detect('lex')
+    return env.Detect(['flex', 'lex'])
index 0c80cf83910bf5a46d3b1b9dfbbf5059a73c8c5d..7fabbf240dcf0adaf238db7492a9795c5aaf631f 100644 (file)
@@ -42,9 +42,9 @@ def generate(env):
     c_file.add_action('.y', '$YACCCOM')
     cxx_file.add_action('.yy', '$YACCCOM')
 
     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):
     env['YACCFLAGS'] = ''
     env['YACCCOM']   = '$YACC $YACCFLAGS -o $TARGET $SOURCES'
 
 def exists(env):
-    return env.Detect('yacc')
+    return env.Detect(['bison', 'yacc'])
index 6f73e5ead486e2435885b9f459d57021b9713289..b7adf0cf493ad5bac20e73cf0327c0a15cb7f676 100644 (file)
@@ -77,7 +77,7 @@ version_lib = '%s/usr/lib/%s' % (root, scons_version)
 def installed(lib):
     return 'Installed SCons library modules into %s' % lib
 
 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,
 
 # Verify that a virgin installation installs the standalone library.
 test.run(chdir = scons_version,
index b44add173c9cdf8ce3703ae621a9e050af91773f..68a0ba52e132887376961699a99f66bdfef42ef1 100644 (file)
@@ -118,6 +118,7 @@ yyerror(s)
 char *s;
 {
     fprintf(stderr, "%%s\n", s);
 char *s;
 {
     fprintf(stderr, "%%s\n", s);
+    return 0;
 }
 
 yylex()
 }
 
 yylex()
index 3ed6b6b25b33581c51ab397f7b4fa1c0135e0c18..022b23834d39ded57286e3cc90708c1c0dab48b9 100644 (file)
@@ -107,6 +107,7 @@ yyerror(s)
 char *s;
 {
     fprintf(stderr, "%%s\n", s);
 char *s;
 {
     fprintf(stderr, "%%s\n", s);
+    return 0;
 }
 
 yylex()
 }
 
 yylex()