File: 004-honour-buildflags.patch

package info (click to toggle)
csstidy 1.4-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 388 kB
  • sloc: cpp: 2,570; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 757 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Author: Reiner Herrmann <reiner@reiner-h.de>
Description: Honour exported build flags

--- a/SConstruct
+++ b/SConstruct
@@ -1,3 +1,6 @@
+import SCons.Util
+import os
+
 #This file is adapted from http://www.scons.org/wiki/SconstructMultiple
 
 #get the mode flag from the command line
@@ -17,6 +20,13 @@
 
 env = Environment()
 
+if os.environ.has_key('CPPFLAGS'):
+    env.Append(CPPFLAGS = SCons.Util.CLVar(os.environ['CPPFLAGS']))
+if os.environ.has_key('CXXFLAGS'):
+    env.Append(CCFLAGS = SCons.Util.CLVar(os.environ['CXXFLAGS']))
+if os.environ.has_key('LDFLAGS'):
+    env.Append(LINKFLAGS = SCons.Util.CLVar(os.environ['LDFLAGS']))
+
 #make sure the sconscripts can get to the variables
 Export('env', 'mymode', 'debugcflags', 'releasecflags')