From f6b3406d7e481afc88d56ce474ef6986230f2b58 Mon Sep 17 00:00:00 2001 From: GregNoel Date: Thu, 14 Aug 2008 23:33:59 +0000 Subject: [PATCH] Issue 2162: YACC fix for OS X git-svn-id: http://scons.tigris.org/svn/scons/trunk@3275 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Tool/yacc.py | 15 +++++++++------ test/YACC/live.py | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/engine/SCons/Tool/yacc.py b/src/engine/SCons/Tool/yacc.py index 0b648e81..3d13dd0e 100644 --- a/src/engine/SCons/Tool/yacc.py +++ b/src/engine/SCons/Tool/yacc.py @@ -109,12 +109,15 @@ def generate(env): env['YACCCOM'] = '$YACC $YACCFLAGS -o $TARGET $SOURCES' env['YACCHFILESUFFIX'] = '.h' - if env['PLATFORM'] == 'darwin': - # Bison on Mac OS X just appends ".h" to the generated target .cc - # or .cpp file name. Hooray for delayed expansion of variables. - env['YACCHXXFILESUFFIX'] = '${TARGET.suffix}.h' - else: - env['YACCHXXFILESUFFIX'] = '.hpp' + # Apparently, OS X now creates file.hpp like everybody else + # I have no idea when it changed; it was fixed in 10.4 + #if env['PLATFORM'] == 'darwin': + # # Bison on Mac OS X just appends ".h" to the generated target .cc + # # or .cpp file name. Hooray for delayed expansion of variables. + # env['YACCHXXFILESUFFIX'] = '${TARGET.suffix}.h' + #else: + # env['YACCHXXFILESUFFIX'] = '.hpp' + env['YACCHXXFILESUFFIX'] = '.hpp' env['YACCVCGFILESUFFIX'] = '.vcg' diff --git a/test/YACC/live.py b/test/YACC/live.py index 3c5050ec..88cbafbe 100644 --- a/test/YACC/live.py +++ b/test/YACC/live.py @@ -56,7 +56,7 @@ yacc = foo.Dictionary('YACC') bar = Environment(YACC = r'%(_python_)s wrapper.py ' + yacc) foo.Program(target = 'foo', source = 'foo.y') bar.Program(target = 'bar', source = 'bar.y') -foo.Program(target = 'hello', source = ['hello.cpp']) +foo.Program(target = 'hello', source = ['hello.cpp']) foo.CXXFile(target = 'file.cpp', source = ['file.yy'], YACCFLAGS='-d') foo.CFile(target = 'not_foo', source = 'foo.y') """ % locals()) @@ -103,11 +103,14 @@ graph: GRAPH_T %% """) -import sys -if sys.platform[:6] == 'darwin': - file_hpp = 'file.cpp.h' -else: - file_hpp = 'file.hpp' +# Apparently, OS X now creates file.hpp like everybody else +# I have no idea when it changed; it was fixed in 10.4 +#import sys +#if sys.platform[:6] == 'darwin': +# file_hpp = 'file.cpp.h' +#else: +# file_hpp = 'file.hpp' +file_hpp = 'file.hpp' test.write("hello.cpp", """\ #include "%(file_hpp)s" -- 2.26.2