From: stevenknight Date: Fri, 8 Oct 2004 11:11:50 +0000 (+0000) Subject: ParseConfig and -Ifilename. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=d23ea5f076b187c5ad8c43897b60b980cd5bdf80;p=scons.git ParseConfig and -Ifilename. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1123 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 0b647c9f..d8ce645e 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 8f76d557..caa3b85b 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 b2f35363..27e7e8bc 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: