summaryrefslogtreecommitdiff
path: root/media-gfx/mypaint/files/mypaint-1.1.0-build-env-vars.patch
blob: 7d7ac3e363590726b3c8e3eed14714920fa68603 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 516d184b5db8ebdd8b184ef871050c3ab3f03fdf Mon Sep 17 00:00:00 2001
From: Andrew Chadwick <andrewc-git@piffle.org>
Date: Sun, 21 Apr 2013 22:51:05 +0100
Subject: [PATCH] SConstruct: support standard build environ vars

Support the standard build environment vars CC, CXX, CFLAGS, CXXFLAGS,
CPPFLAGS, and LDFLAGS everywhere.

Partially addresses https://gna.org/bugs/?20754
---
 SConstruct |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/SConstruct b/SConstruct
index 0b55da1..ef39b9e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,6 +1,7 @@
 import os, sys
 from os.path import join, basename
 from SCons.Script.SConscript import SConsEnvironment
+import SCons.Util
 
 EnsureSConsVersion(1, 0)
 
@@ -45,6 +46,24 @@ print('using %r (use scons python_config=xxx to change)' % env['python_config'])
 if sys.platform == "win32":
     # remove this mingw if trying VisualStudio
     env = Environment(tools=tools + ['mingw'], ENV=os.environ, options=opts)
+
+# Respect some standard build environment stuff
+if os.environ.has_key('CC'):
+   env['CC'] = os.environ['CC']
+if os.environ.has_key('CFLAGS'):
+   env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
+if os.environ.has_key('CXX'):
+   env['CXX'] = os.environ['CXX']
+if os.environ.has_key('CXXFLAGS'):
+   env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
+if os.environ.has_key('CPPFLAGS'):
+   env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CPPFLAGS'])
+   env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CPPFLAGS'])
+if os.environ.has_key('LDFLAGS'):
+   env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
+if "$CCFLAGS" in env['CXXCOM']:
+   env['CXXCOM'] = env['CXXCOM'].replace("$CCFLAGS","")
+
 opts.Update(env)
 
 env.Append(CXXFLAGS=' -Wall -Wno-sign-compare -Wno-write-strings')
-- 
1.7.10.4