Fixes to allow building the Matlab toolbox with MinGW

This commit is contained in:
Ray Speth 2012-03-07 00:50:58 +00:00
parent 6f306dbc1c
commit 559163d2ca
2 changed files with 7 additions and 0 deletions

View file

@ -59,6 +59,9 @@ if localenv['OS'] == 'Darwin' and localenv['use_sundials'] == 'y':
localenv.Append(LIBS=localenv['sundials_libs'],
LIBPATH=localenv['sundials_libdir'])
if localenv['toolchain'] == 'mingw':
localenv.Append(LINKFLAGS=['-static-libgcc', '-static-libstdc++'])
# Build the Cantera shared library
lib = build(localenv.SharedLibrary('../lib/cantera_shared', libraryTargets,
SPAWN=getSpawn(localenv)))

View file

@ -21,6 +21,9 @@ if localenv['OS'] == 'Windows':
if localenv['CC'] == 'cl':
linkflags.append('/export:mexFunction')
linkflags.append('/MACHINE:X%i' % localenv['OS_BITS'])
elif localenv['CC'] == 'gcc':
linkflags.append('-Wl,--export-all-symbols')
linkflags.extend(['-static-libgcc', '-static-libstdc++'])
elif localenv['OS'] == 'Darwin':
linklibs = ['cantera']
@ -55,6 +58,7 @@ linklibs += localenv['blas_lapack_libs']
ctmethods = build(localenv.SharedLibrary('#interfaces/matlab/toolbox/ctmethods',
mglob(localenv, '.', 'cpp'),
LIBPREFIX='',
SHLIBPREFIX='',
SHLIBSUFFIX=mexSuffix,
LIBS=linklibs,