wzugang / serf

Automatically exported from code.google.com/p/serf
Apache License 2.0
0 stars 0 forks source link

scons CFLAGS doesn't accept more than one flag #121

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. scons CFLAGS=-g,-O0
2. scons

=> this builds scons correctly with the added flags.

3. cat .saved_config
CC = ['gcc']
CFLAGS = ['-g -O0']
LINKFLAGS = ['']

4. scons -c
5. scons
gcc -o context.o -c "-g -O0" -std=c89 -Wdeclaration-after-statement 
-Wmissing-prototypes -Wall -O2 -DNDEBUG -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK 
-I. -I/usr/include/apr-1 -I/usr/include context.c
cc1: error: unrecognised debug output level " -O0"
scons: *** [context.o] Error 1
scons: building terminated because of errors.

So saving the CFLAGS flags works but then using them in a next invocation of 
scons adds double quotes.

Possibly the same issue with the other LINKFLAGS and LIBS.

Original issue reported on code.google.com by lieven.govaerts@gmail.com on 12 Aug 2013 at 9:22

GoogleCodeExporter commented 9 years ago
Also, the value is now comma separated, but that doesn't work with e.g. :
scons CFLAGS="-Wl,-foo,fooval -g -O0"

Attached patch solves both issues:

Index: SConstruct
===================================================================
--- SConstruct  (revision 2122)
+++ SConstruct  (working copy)
@@ -34,7 +34,7 @@
     if val == 'none':
       val = []
     else:
-      val = val.split(',')
+      val = val.split(' ')
     return val

 def RawListVariable(key, help, default):

Original comment by lieven.govaerts@gmail.com on 12 Aug 2013 at 11:48

GoogleCodeExporter commented 9 years ago
This was reported by philipm on #svn-dev.

Original comment by lieven.govaerts@gmail.com on 12 Aug 2013 at 4:38

GoogleCodeExporter commented 9 years ago
Fixed in r2125: Make CFLAGS, LIBS, LINKFLAGS and CPPFLAGS take a 
space-separated list.

Original comment by lieven.govaerts@gmail.com on 12 Aug 2013 at 5:28