summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-04-22 22:45:23 (GMT)
committerSteven Knight <knight@baldmt.com>2002-04-22 22:45:23 (GMT)
commit359e8303a9423cb0ed8ee250042941866eaa64c8 (patch)
tree9ccd8c13b988e3a0969a1bad5e1baeed6d9f0a04 /src
parent094f305d5d6e668a8273b1efc67d89e2414314f6 (diff)
downloadSCons-359e8303a9423cb0ed8ee250042941866eaa64c8.zip
SCons-359e8303a9423cb0ed8ee250042941866eaa64c8.tar.gz
SCons-359e8303a9423cb0ed8ee250042941866eaa64c8.tar.bz2
Small fix for yacc: only look for a .h file if they used the -d option. (Charles Crain)
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Defaults.py30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index ac04d9a..8d6bd34 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -80,9 +80,11 @@ class SharedCmdGenerator:
def yaccEmitter(target, source, env, **kw):
# Yacc can be configured to emit a .h file as well
- # as a .c file. Append that as a target.
- if len(source) and os.path.splitext(SCons.Util.to_String(source[0]))[1] in \
- [ '.y', '.yy']:
+ # as a .c file, if -d is specified on the command line.
+ if len(source) and \
+ os.path.splitext(SCons.Util.to_String(source[0]))[1] in \
+ [ '.y', '.yy'] and \
+ '-d' in string.split(env.subst("$YACCFLAGS")):
target.append(os.path.splitext(SCons.Util.to_String(target[0]))[0] + \
'.h')
return (target, source)
@@ -191,21 +193,13 @@ def win32LinkGenerator(env, target, source, **kw):
args.extend(map(SCons.Util.to_String, source))
return win32TempFileMunge(env, args)
-kw = {
- 'name' : 'Program',
- 'prefix' : '$PROGPREFIX',
- 'suffix' : '$PROGSUFFIX',
- 'src_suffix' : '$OBJSUFFIX',
- 'src_builder' : Object,
- 'scanner' : SCons.Scanner.Prog.ProgScan()
-}
-
-if sys.platform == 'win32':
- kw['generator'] = win32LinkGenerator
-else:
- kw['action'] = '$LINKCOM'
-
-Program = apply(SCons.Builder.Builder, (), kw)
+Program = SCons.Builder.Builder(name='Program',
+ action='$LINKCOM',
+ prefix='$PROGPREFIX',
+ suffix='$PROGSUFFIX',
+ src_suffix='$OBJSUFFIX',
+ src_builder=Object,
+ scanner = SCons.Scanner.Prog.ProgScan())
class LibAffixGenerator:
def __init__(self, static, shared):