ParseConfig and -I<space>filename.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 8 Oct 2004 11:11:50 +0000 (11:11 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 8 Oct 2004 11:11:50 +0000 (11:11 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1123 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Environment.py
src/engine/SCons/EnvironmentTests.py

index 0b647c9f24b8f2b6c8fe2b7ef8e70d0f6313ae47..d8ce645e09f63cd1583412c95e76fbae0d03860c 100644 (file)
@@ -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
index 8f76d557463cb8b3fd3a4e8ed549861695981cee..caa3b85bb63a4cbeea5c49bd102d41082e498aeb 100644 (file)
@@ -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,':
index b2f35363c0f624f231e74cc6807f2c2c8cfc6fa2..27e7e8bc2a9afd2bce03beaceb1e1d4d70fce3b1 100644 (file)
@@ -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: