swig: Warn on use of incompatible swig/gcc combinations

This patch removes the fixed swig warning concerning 2.0.9/2.0.10 and
adds a warning message for incompatible combinations of swig and gcc.
This commit is contained in:
Andreas Hansson 2013-09-18 08:46:32 -04:00
parent fe5212f932
commit cecb951f60

View file

@ -730,14 +730,16 @@ if compareVersions(swig_version[2], min_swig_version) < 0:
print ' Installed version:', swig_version[2] print ' Installed version:', swig_version[2]
Exit(1) Exit(1)
if swig_version[2] in ["2.0.9", "2.0.10"]: # Older versions of swig do not play well with more recent versions of
# gcc due to assumptions on implicit includes (cstddef) and use of
# namespaces
if main['GCC'] and compareVersions(gcc_version, '4.6') > 0 and \
compareVersions(swig_version[2], '2') < 0:
print '\n' + termcap.Yellow + termcap.Bold + \ print '\n' + termcap.Yellow + termcap.Bold + \
'Warning: SWIG version 2.0.9/10 sometimes generates broken code.\n' + \ 'Warning: SWIG 1.x cause issues with gcc 4.6 and later.\n' + \
termcap.Normal + \ termcap.Normal + \
'This problem only affects some platforms and some Python\n' + \ 'Use SWIG 2.x to avoid assumptions on implicit includes\n' + \
'versions. See the following SWIG bug report for details:\n' + \ 'and use of namespaces\n'
'http://sourceforge.net/p/swig/bugs/1297/\n'
# Set up SWIG flags & scanner # Set up SWIG flags & scanner
swig_flags=Split('-c++ -python -modern -templatereduce $_CPPINCFLAGS') swig_flags=Split('-c++ -python -modern -templatereduce $_CPPINCFLAGS')