summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2016-01-04 17:18:41 -0500
committerEric S. Raymond <esr@thyrsus.com>2016-01-04 17:18:41 -0500
commit46127111c3cad66f6ec1e6db1d75e3db063fd1a0 (patch)
treedc1778f6b028b63865d3dc5849c4b813d8e52a34 /SConstruct
parent772eedf8a13c2c0468b1fd94beb5406dbfcb3b6e (diff)
downloadgpsd-46127111c3cad66f6ec1e6db1d75e3db063fd1a0.tar.gz
Address Savannah bug #44648: GPSD won't build...
...if CCFLAGS contains options that are only compatible with the cross-compiler
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct13
1 files changed, 13 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index c47924d1..b6a79bc3 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1094,10 +1094,23 @@ else:
# ensure that we build the python modules with scan-build, too
if env['CC'] is None or env['CC'].find('scan-build') < 0:
python_env['CC'] = cc
+ # As we seem to be changing compilers we must assume that the
+ # CCFLAGS are incompatible with the new compiler. If we should
+ # use other flags, the variable or the variable for this
+ # should be predefined.
+ if cc.split()[0] != env['CC']:
+ python_env['CCFLAGS'] = ''
else:
python_env['CC'] = ' '.join([env['CC']] + cc.split()[1:])
if env['CXX'] is None or env['CXX'].find('scan-build') < 0:
python_env['CXX'] = cxx
+ # As we seem to be changing compilers we must assume that the
+ # CCFLAGS or CXXFLAGS are incompatible with the new
+ # compiler. If we should use other flags, the variable or the
+ # variable for this should be predefined.
+ if cxx.split()[0] != env['CXX']:
+ python_env['CCFLAGS'] = ''
+ python_env['CXXFLAGS'] = ''
else:
python_env['CXX'] = ' '.join([env['CXX']] + cxx.split()[1:])