From 978e3605bd446cb38e82528ba79e1c6d2adcaa69 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 1 Feb 2013 23:39:53 +0000 Subject: [PATCH] [SCons] Cleanup of the build scripts --- ext/SConscript | 41 +++++++++++++++++---------------------- platform/posix/SConscript | 3 --- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/ext/SConscript b/ext/SConscript index 95e638bb8..554ba369e 100644 --- a/ext/SConscript +++ b/ext/SConscript @@ -3,18 +3,17 @@ from buildutils import * Import('env', 'build', 'install', 'libraryTargets') localenv = env.Clone() -# -# prep function seem to return the environment -# def prep_default(env): return env.Clone() + def prep_fortran(env): localenv = env.Clone() - localenv.Prepend(CPPPATH='#include/cantera/base') # for config.h + localenv.Prepend(CPPPATH='#include/cantera/base') # for config.h return localenv + def prep_f2c(env): localenv = env.Clone() @@ -23,15 +22,10 @@ def prep_f2c(env): localenv.Append(CPPDEFINES=['USE_CLOCK']) if not localenv['HAS_UNISTD_H']: localenv.Append(CPPDEFINES=['MSDOS']) - if env['VERBOSE'] : - print "INFO 2: prep_f2c: adding MSDOS to CPPDEFINES" + if env['VERBOSE']: + print "INFO 2: prep_f2c: adding MSDOS to CPPDEFINES" + print "INFO 2: CPPDEFINES ", localenv['CPPDEFINES'] - if env['VERBOSE'] : - print "INFO 2: CPPDEFINES ", localenv['CPPDEFINES'] - #print "localenv", localenv.Dump() - #exit(0) - - # The F2C code generates a lot of warnings designed to catch # programmer errors, but since this is autogenerated code, those # warnings are irrelevant. @@ -47,6 +41,7 @@ def prep_f2c(env): return localenv + def prep_sundials(env): localenv = env.Clone() localenv.Prepend(CPPPATH=Dir('#ext/cvode/include')) @@ -57,6 +52,7 @@ def prep_sundials(env): return localenv + def prep_gtest(env): localenv = env.Clone() localenv.Prepend(CPPPATH=[Dir('#ext/gtest'), @@ -113,7 +109,9 @@ if env['use_sundials'] == 'n': for subdir, extensions, prepFunction in libs: if env['VERBOSE']: - print "INFO 2: Prep the environment for ", subdir, ' with extensions ', extensions, ' by calling func ', prepFunction.__name__ + print 'INFO 2: Prep the environment for ', subdir, + print ' with extensions ', extensions, + print ' by calling func ', prepFunction.__name__ localenv = prepFunction(env) @@ -126,24 +124,24 @@ for subdir, extensions, prepFunction in libs: libName = 'ctblas' if libName == 'ctf2c_lapack': libName = 'ctlapack' - if libName == 'ctf2c_math' : + if libName == 'ctf2c_math': libName = 'ctmath' - if libName == 'ctcvode/source' : + if libName == 'ctcvode/source': libName = 'cvode' - if libName == 'ctlibexecstream' : + if libName == 'ctlibexecstream': libName = 'execstream' if libName == 'ctf2c_libs': libName = 'ctf2c' - if localenv['renamed_shared_libraries'] : + if localenv['renamed_shared_libraries']: sharedLibName = libName + '_shared' else: sharedLibName = libName - if env['VERBOSE'] : - print "INFO 2:" , subdir , ' with ', extensions + if env['VERBOSE']: + print "INFO 2:", subdir, ' with ', extensions print " libName = ", libName, " sharedLibName = ", sharedLibName - + objects = localenv.SharedObject(mglob(localenv, subdir, *extensions)) # Build the static library @@ -161,6 +159,3 @@ localenv.Prepend(CPPPATH=[Dir('#ext/gtest'), CPPDEFINES={'GTEST_HAS_PTHREAD': 0}) build(localenv.Library(pjoin('../lib', 'gtest'), source=['gtest/src/gtest-all.cc'])) - - - diff --git a/platform/posix/SConscript b/platform/posix/SConscript index 0a6213c29..4654468dc 100644 --- a/platform/posix/SConscript +++ b/platform/posix/SConscript @@ -105,9 +105,6 @@ if not localenv['build_with_f2c']: else: localenv['mak_syslibs'] = '' -# print localenv.Dump() -# exit(0) - mak = build(localenv.SubstFile('Cantera.mak', 'Cantera.mak.in')) install('$inst_incdir', mak)