[SCons] Fix library linking issues under Cygwin

This commit is contained in:
Ray Speth 2014-02-20 03:01:01 +00:00
parent 44847515ca
commit aad284cce7
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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'],