[SCons] Correctly identify Cygwin builds

The correct preprocessor macro to use is the one provided by the
compiler, '__CYGWIN__'.
This commit is contained in:
Ray Speth 2014-02-20 03:00:52 +00:00
parent ca0ea8bc35
commit 13259299ba
2 changed files with 2 additions and 5 deletions

View file

@ -138,6 +138,8 @@ env = Environment(tools=toolchain+['textfile', 'subst', 'recursiveInstall', 'wix
env['OS'] = platform.system()
env['OS_BITS'] = int(platform.architecture()[0][:2])
if 'cygwin' in env['OS'].lower():
env['OS'] = 'Cygwin' # remove Windows version suffix
# Fixes a linker error in Windows
if os.name == 'nt' and 'TMP' in os.environ:
@ -1118,7 +1120,6 @@ cdefine('DEBUG_MODE', 'debug_verbose')
# Need to test all of these to see what platform.system() returns
configh['SOLARIS'] = 1 if env['OS'] == 'Solaris' else None
configh['DARWIN'] = 1 if env['OS'] == 'Darwin' else None
configh['CYGWIN'] = 1 if env['OS'] == 'Cygwin' else None
cdefine('NEEDS_GENERIC_TEMPL_STATIC_DECL', 'OS', 'Solaris')
if env['python_package'] == 'none' and env['python3_package'] == 'n':

View file

@ -65,10 +65,6 @@ typedef int ftnlen; // Fortran hidden string length type
// data file search path.
%(DARWIN)s
// Identify whether the operating system is cygwin's overlay of
// windows, with gcc being used as the compiler.
%(CYGWIN)s
// Identify whether the operating system is Solaris
// with a native compiler
%(SOLARIS)s