Do not build the shared library. Do not build csvdiff. Do not install install_tsc Do not install man pages (handled by debhelper) Skip csvdiff for Debian package More things not installed with Debian
79 lines
2.9 KiB
Python
79 lines
2.9 KiB
Python
from buildutils import *
|
|
|
|
Import('env', 'build', 'install', 'libraryTargets')
|
|
|
|
def defaultSetup(env, subdir, extensions):
|
|
return mglob(env, subdir, *extensions)
|
|
|
|
def baseSetup(env, subdir, extensions):
|
|
escaped_datadir = '\\"' + env['ct_datadir'].replace('\\', '\\\\') + '\\"'
|
|
env.Append(CPPDEFINES={'CANTERA_DATA': escaped_datadir})
|
|
return defaultSetup(env, subdir, extensions)
|
|
|
|
def equilSetup(env, subdir, extensions):
|
|
env.Append(CPPPATH=['#ext/f2c_libs'])
|
|
return defaultSetup(env, subdir, extensions)
|
|
|
|
def numericsSetup(env, subdir, extensions):
|
|
if env['use_sundials'] == 'y':
|
|
remove = 'CVodeInt.cpp'
|
|
else:
|
|
remove = 'CVodesIntegrator.cpp'
|
|
return [s for s in mglob(env, subdir, *extensions)
|
|
if s.name != remove]
|
|
|
|
# (subdir, (file extensions), (extra setup(env)))
|
|
libs = [('base', ['cpp'], baseSetup),
|
|
('thermo', ['cpp'], defaultSetup),
|
|
('tpx', ['cpp'], defaultSetup),
|
|
('equil', ['cpp','c'], equilSetup),
|
|
('converters', ['cpp'], defaultSetup),
|
|
('numerics', ['cpp'], numericsSetup),
|
|
('kinetics', ['cpp'], defaultSetup),
|
|
('transport', ['cpp'], defaultSetup),
|
|
('spectra', ['cpp'], defaultSetup),
|
|
('oneD', ['cpp'], defaultSetup),
|
|
('zeroD', ['cpp'], defaultSetup),
|
|
('clib', ['cpp'], defaultSetup),
|
|
]
|
|
|
|
for subdir, extensions, setup in libs:
|
|
localenv = env.Clone()
|
|
localenv.Append(CPPPATH=Dir('#include'))
|
|
localenv.Append(CPPPATH=Dir('#src')) # todo: remove when not needed
|
|
source = setup(localenv, subdir, extensions)
|
|
objects = localenv.SharedObject(source)
|
|
localenv.Depends(objects, localenv['config_h_target'])
|
|
libraryTargets.extend(objects)
|
|
|
|
|
|
# build the Cantera static library
|
|
localenv = env.Clone()
|
|
lib = build(localenv.StaticLibrary('../lib/cantera', libraryTargets,
|
|
SPAWN=getSpawn(localenv)))
|
|
localenv.Depends(lib, localenv['config_h_target'])
|
|
install('$inst_libdir', lib)
|
|
env['cantera_staticlib'] = lib
|
|
|
|
# OS X requires the shared libraries at link time
|
|
if (localenv['use_sundials'] == 'y' and
|
|
localenv['OS'] in ('Darwin', 'Windows')):
|
|
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 using the correct name
|
|
if localenv['layout'] != 'debian':
|
|
# Define the name according to the environmental variable
|
|
if localenv['renamed_shared_libraries'] == True:
|
|
sharedName = '../lib/cantera_shared'
|
|
else:
|
|
sharedName = '../lib/cantera'
|
|
|
|
lib = build(localenv.SharedLibrary(sharedName, libraryTargets,
|
|
SPAWN=getSpawn(localenv)))
|
|
install('$inst_libdir', lib)
|
|
env['cantera_shlib'] = lib
|
|
localenv.Depends(lib, localenv['config_h_target'])
|