summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-10-08 11:11:50 (GMT)
committerSteven Knight <knight@baldmt.com>2004-10-08 11:11:50 (GMT)
commit6f708d0ca8b7f61a1d7ba98a945e32b25417952d (patch)
treec4649cf1d7c7a956c6b3521e08f60fdb30457137
parent94c0c7bf4cf4e35e73ce10fdb1b795fbf7ff1d2e (diff)
downloadSCons-6f708d0ca8b7f61a1d7ba98a945e32b25417952d.zip
SCons-6f708d0ca8b7f61a1d7ba98a945e32b25417952d.tar.gz
SCons-6f708d0ca8b7f61a1d7ba98a945e32b25417952d.tar.bz2
ParseConfig and -I<space>filename.
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Environment.py15
-rw-r--r--src/engine/SCons/EnvironmentTests.py6
3 files changed, 18 insertions, 6 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 0b647c9..d8ce645 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -91,6 +91,9 @@ RELEASE 0.97 - XXX
- Add a missing newline to the end of the --debug=explain "unknown
reasons" message.
+ - Enhance ParseConfig() to work properly for spaces in between the -I,
+ -L and -l options and their arguments.
+
From Clive Levinson:
- Make ParseConfig() recognize and add -mno-cygwin to $LINKFLAGS and
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 8f76d55..caa3b85 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -763,11 +763,20 @@ class Base:
elif arg[0] != '-':
dict['LIBS'].append(fs.File(arg))
elif arg[:2] == '-L':
- dict['LIBPATH'].append(arg[2:])
+ if arg[2:]:
+ dict['LIBPATH'].append(arg[2:])
+ else:
+ append_next_arg_to = 'LIBPATH'
elif arg[:2] == '-l':
- dict['LIBS'].append(arg[2:])
+ if arg[2:]:
+ dict['LIBS'].append(arg[2:])
+ else:
+ append_next_arg_to = 'LIBS'
elif arg[:2] == '-I':
- dict['CPPPATH'].append(arg[2:])
+ if arg[2:]:
+ dict['CPPPATH'].append(arg[2:])
+ else:
+ append_next_arg_to = 'CPPPATH'
elif arg[:4] == '-Wa,':
dict['ASFLAGS'].append(arg)
elif arg[:4] == '-Wl,':
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index b2f3536..27e7e8b 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -1349,8 +1349,8 @@ def exists(env):
save_command.append(command)
class fake_file:
def read(self):
- return "-I/usr/include/fum -Ibar -X\n" + \
- "-L/usr/fax -Lfoo -lxxx " + \
+ return "-I/usr/include/fum -I bar -X\n" + \
+ "-L/usr/fax -L foo -lxxx -l yyy " + \
"-Wa,-as -Wl,-link -Wp,-cpp abc " + \
"-pthread -framework Carbon " + \
"-mno-cygwin -mwindows"
@@ -1363,7 +1363,7 @@ def exists(env):
assert env['CPPPATH'] == ['string', '/usr/include/fum', 'bar'], env['CPPPATH']
assert env['CPPFLAGS'] == ['', '-Wp,-cpp'], env['CPPFLAGS']
assert env['LIBPATH'] == ['list', '/usr/fax', 'foo'], env['LIBPATH']
- assert env['LIBS'] == ['xxx', env.File('abc')], env['LIBS']
+ assert env['LIBS'] == ['xxx', 'yyy', env.File('abc')], env['LIBS']
assert env['LINKFLAGS'] == ['', '-Wl,-link', '-pthread', '-framework', 'Carbon', '-mno-cygwin', '-mwindows'], env['LINKFLAGS']
assert env['CCFLAGS'] == ['', '-X', '-pthread', '-mno-cygwin'], env['CCFLAGS']
finally: