Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
Handling of CFLAGS etc. is misdesigned. Environmental variables are ignored. Even when I explicitly specify CFLAGS on command line, then they are not fully respected:
$ scons CFLAGS="-march=native -O3"
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o context.o -c -march=native -O3 -std=c89 -Wdeclaration-after-statement -Wmissing-prototypes -Wall -O2 -pthread -DNDEBUG -DLINUX -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/include/apr-1 -I/usr/include/db5.2 -I/usr/include context.c
gcc -o incoming.o -c -march=native -O3 -std=c89 -Wdeclaration-after-statement -Wmissing-prototypes -Wall -O2 -pthread -DNDEBUG -DLINUX -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/include/apr-1 -I/usr/include/db5.2 -I/usr/include incoming.c
gcc -o outgoing.o -c -march=native -O3 -std=c89 -Wdeclaration-after-statement -Wmissing-prototypes -Wall -O2 -pthread -DNDEBUG -DLINUX -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/include/apr-1 -I/usr/include/db5.2 -I/usr/include outgoing.c
gcc -o ssltunnel.o -c -march=native -O3 -std=c89 -Wdeclaration-after-statement -Wmissing-prototypes -Wall -O2 -pthread -DNDEBUG -DLINUX -D_REENTRANT -D_GNU_SOURCE -I. -I/usr/include/apr-1 -I/usr/include/db5.2 -I/usr/include ssltunnel.c
...
-O2 is appended and overrides flags set by user (which include -O3 in above example).
Original issue reported by Arfrever.FTA