[SCons] Cleanup of the build scripts

This commit is contained in:
Ray Speth
2013-02-01 23:39:53 +00:00
parent 0dc32b6a61
commit 978e3605bd
2 changed files with 18 additions and 26 deletions

View File

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

View File

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