# HG changeset patch # User Radek Brich # Date 1243781585 -7200 # Node ID f3abdaa2e8fb3a09ee7417164bf1397810526a5f # Parent 64638385798a6dbb3671ebbd2bf30ccc0d157e2d build script: updated for latest SCons, moved config.h to build/, help and clean targets does not run configure any more, fixed GCC check, added check for zlib diff -r 64638385798a -r f3abdaa2e8fb SConstruct --- a/SConstruct Mon May 19 22:59:04 2008 +0200 +++ b/SConstruct Sun May 31 16:53:05 2009 +0200 @@ -42,33 +42,35 @@ else: tools = ['default'] -env = Environment(tools = tools, CPPPATH = ['.','#include']) +env = Environment(tools = tools, CPPPATH = ['.','#include','#build/include']) -opt = Options(['build/.optioncache']) -opt.AddOptions( - BoolOption('simd', 'allow SSE intrinsics', True), +vars = Variables(files=['build/.varscache']) +vars.AddVariables( + BoolVariable('simd', 'allow SSE intrinsics', True), ('precision', 'floating point number precision (single/double)', "single"), ('flags', 'add additional compiler flags', ""), - BoolOption('force_flags', "use only flags specified by 'flags' option (do not autodetect arch/sse flags)", False), + BoolVariable('force_flags', "use only flags specified by 'flags' option (do not autodetect arch/sse flags)", False), ('ldflags', 'add additional linker flags', ""), - BoolOption('profile', "enable gcc's profiling support (-pg)", False), + BoolVariable('profile', "enable gcc's profiling support (-pg)", False), ) if env['PLATFORM'] == 'win32': - opt.AddOptions( - BoolOption('mingw', 'use Mingw and GCC compiler, if available', False), + vars.AddVariables( + BoolVariable('mingw', 'use Mingw and GCC compiler, if available', False), ('pythonpath', 'path to Python installation', 'C:\\Python%c%c' % (sys.version[0], sys.version[2])), ) else: - opt.AddOptions( - BoolOption('intelc', 'use Intel C++ Compiler, if available', False), + vars.AddVariables( + BoolVariable('intelc', 'use Intel C++ Compiler, if available', False), ) -opt.Update(env) -opt.Save('build/.optioncache', env) -Help(opt.GenerateHelpText(env)) +vars.Update(env) +vars.Save('build/.varscache', env) +Help(vars.GenerateHelpText(env)) +if env.GetOption('help') == True or env.GetOption('clean') == True: + Return() ### configure @@ -102,9 +104,10 @@ def CheckGCC(context): global gcc, gccversion context.Message('Checking for GCC compiler... ') - gcc = "g++" in env['TOOLS'] + testenv = Environment() + gcc = "g++" in testenv['TOOLS'] if gcc: - gccversion = env['CCVERSION'] + gccversion = testenv['CCVERSION'] context.Result(gccversion) else: gccversion = '' @@ -133,10 +136,11 @@ context.Result(cpu) return True -conf_dir = "#/build/.sconf_temp" -log_file="#/build/config.log" -config_h="#/include/config.h" +conf_dir = "#build/.sconf_temp" +log_file="#build/config.log" +config_h="#build/include/config.h" conf = Configure(env, conf_dir=conf_dir, log_file=log_file, config_h=config_h, + clean=False, help=False, custom_tests = { 'CheckPlatform' : CheckPlatform, 'CheckCPUFlags' : CheckCPUFlags, 'CheckIntelC' : CheckIntelC, 'CheckGCC' : CheckGCC, 'CheckMSVC' : CheckMSVC}) @@ -231,7 +235,7 @@ # configure libpng -if conf.CheckLibWithHeader('libpng', 'png.h', 'C'): +if conf.CheckLibWithHeader('zlib', 'zlib.h', 'C') and conf.CheckLibWithHeader('libpng', 'png.h', 'C'): conf.Define('HAVE_PNG') env = conf.Finish() @@ -243,12 +247,12 @@ if platform == 'win32': pythonver = '%c%c' % (sys.version[0], sys.version[2]) pythonlib = 'python'+pythonver - pythonpath = [env['pythonpath'], - 'C:\\Program Files\\Python'+pythonver] + pythonpath = [env['pythonpath']] pyenv.Append(CPPPATH=[s+'\\include' for s in pythonpath]) pyenv.Append(LIBPATH=[s+'\\libs' for s in pythonpath]) pyenv.Replace(SHLIBSUFFIX='.pyd') - conf = Configure(pyenv, conf_dir=conf_dir, log_file=log_file, config_h=config_h) + conf = Configure(pyenv, conf_dir=conf_dir, log_file=log_file, config_h=config_h, + clean=False, help=False) if not conf.CheckLib(pythonlib): have_python = False pyenv = conf.Finish() @@ -286,6 +290,7 @@ return False conf = Configure(sdlenv, conf_dir=conf_dir, log_file=log_file, config_h=config_h, + clean=False, help=False, custom_tests = {'CheckSDL' : CheckSDL} ) have_sdl = conf.CheckSDL() sdlenv = conf.Finish() diff -r 64638385798a -r f3abdaa2e8fb models/SConscript --- a/models/SConscript Mon May 19 22:59:04 2008 +0200 +++ b/models/SConscript Sun May 31 16:53:05 2009 +0200 @@ -11,8 +11,11 @@ env.Alias('local-models', l) plydir = Dir('#build/models/ply/') + import os -env.Command(plydir, [], '"'+Dir('#models/').abspath+os.sep+'download-stanford" $TARGET') +env.Command(plydir, [], + '"'+Dir('#models/').abspath+os.sep+'download-stanford" $TARGET', + ENV = {'PATH':os.environ['PATH']}) Clean(plydir, plydir) env.Alias('download-models', plydir) diff -r 64638385798a -r f3abdaa2e8fb src/SConscript --- a/src/SConscript Mon May 19 22:59:04 2008 +0200 +++ b/src/SConscript Sun May 31 16:53:05 2009 +0200 @@ -29,7 +29,10 @@ else: objs = [] for src in sources: - objs.append( env.Object(src) ) + o = env.Object(src) + objs.append( o ) + if src == 'common.cc' or src == 'pixmap.cc': + env.Depends(o, '#build/include/config.h') lib = env.StaticLibrary('pyrit', objs) env.Alias('objs', objs) env.Alias('static-lib', lib) diff -r 64638385798a -r f3abdaa2e8fb src/raytracermodule.cc --- a/src/raytracermodule.cc Mon May 19 22:59:04 2008 +0200 +++ b/src/raytracermodule.cc Sun May 31 16:53:05 2009 +0200 @@ -1645,7 +1645,7 @@ }; -extern "C" void initpyrit(void) +PyMODINIT_FUNC initpyrit(void) { PyObject* m;