From aad284cce7bf3b4972e55c68afe559f0da2dd442 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 20 Feb 2014 03:01:01 +0000 Subject: [PATCH] [SCons] Fix library linking issues under Cygwin --- interfaces/cython/SConscript | 6 +++++- src/SConscript | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/interfaces/cython/SConscript b/interfaces/cython/SConscript index 9c122714f..4e2723fc2 100644 --- a/interfaces/cython/SConscript +++ b/interfaces/cython/SConscript @@ -12,17 +12,21 @@ def configure_python(env, python_command): "import numpy", "print(get_config_var('EXT_SUFFIX') or get_config_var('SO'))", "print(get_config_var('INCLUDEPY'))", + "print(get_config_var('LDLIBRARY'))", "print(get_config_var('prefix'))", "print(get_python_version())", "print(numpy.get_include())")) info = getCommandOutput(python_command, '-c', script) - module_ext, inc, prefix, py_version, numpy_include = info.splitlines()[-5:] + module_ext, inc, pylib, prefix, py_version, numpy_include = info.splitlines()[-6:] env.Append(CPPPATH=[inc, numpy_include, Dir('#include')]) env.Prepend(LIBS=env['cantera_libs']) if env['OS'] == 'Darwin': env.Append(LINKFLAGS='-undefined dynamic_lookup') elif env['OS'] == 'Windows': env.Append(LIBPATH=prefix+'/libs') + elif env['OS'] == 'Cygwin': + # extract 'pythonX.Y' from 'libpythonX.Y.dll.a' + env.Append(LIBS=pylib[3:-6]) return module_ext, py_version diff --git a/src/SConscript b/src/SConscript index 9fd72bb6b..a17351389 100644 --- a/src/SConscript +++ b/src/SConscript @@ -56,7 +56,7 @@ install('$inst_libdir', lib) env['cantera_staticlib'] = lib # Windows and OS X require shared libraries at link time -if localenv['OS'] in ('Darwin', 'Windows'): +if localenv['OS'] in ('Darwin', 'Windows', 'Cygwin'): localenv.Append(LIBS=localenv['FORTRANSYSLIBS']) if (localenv['use_sundials'] == 'y'): localenv.Append(LIBS=localenv['sundials_libs'],