import scripts import os from scripts import * #SourceSignatures('timestamp') # Create environment opts = scripts.SetupOptions() env = Environment(options = opts) if not env['PLATFORM'] in ('posix', 'win32', 'darwin'): print 'WARNING! VOS has not been tested on this platform.' if os.getcwd().find(' ') > -1: print 'WARNING! The current path contains spaces. Some tools may not handle spaces correctly.' # Set up some preliminary variables env.Replace(PACKAGE = 'voss5') env.Replace(VERSION = '0.1') if env['BUILDCFG'] == 'debug': if env['PLATFORM'] == 'win32': env.Append(CXXFLAGS = ['/Zi', '/MDd']) env.Append(LINKFLAGS = ['/DEBUG']) else: env.Append(CXXFLAGS = ['-g', '-Wall']) elif env['PLATFORM'] == 'win32': env.Append(CXXFLAGS = ['/MD']) if env['PLATFORM'] == 'win32': env.Append(CXXFLAGS = ['/EHsc']) env.Append(CPPPATH = os.environ['INCLUDE'].split(';')) env.Append(LIBPATH = os.environ['LIB'].split(';')) if env['PLATFORM'] == 'darwin': env.Append(CPPPATH = '/sw/include') env.Append(LIBPATH = '/sw/lib') env.Tool('wixtool', toolpath=['scripts']) scripts.SetupExtensions(env) env.Help(opts.GenerateHelpText(env)) print 'BUILDCFG', env['BUILDCFG'] print 'BUILDDIR', env['BUILDDIR'] print 'THIRDPARTY', env['THIRDPARTY'] print 'THIRDPARTY_STAGEDIR', env['THIRDPARTY_STAGEDIR'] print 'STAGEDIR', env['STAGEDIR'] print 'DESTDIR', env['DESTDIR'] print 'DOWNLOAD_OPT', env['DOWNLOAD_OPT'] # doesn't work, because we need the results of the tests # in order to build. # #if not (env.GetOption('clean') or env.GetOption('help')): # Do feature tests conf = Configure(env, custom_tests = scripts.CustomTests) conf.CheckBzr() conf.CheckHg() if env['PLATFORM'] == 'win32': conf.CheckWiX() if env['PLATFORM'] == 'posix': conf.CheckEPM() if env['PLATFORM'] != 'win32': conf.CheckAutoconf() conf.CheckAutomake() conf.CheckLibtool() conf.CheckZlib() conf.CheckPNG() conf.CheckJpeg() boostTests = [['thread', 'boost/thread.hpp', True, None], ['unit_test_framework', 'boost/test/unit_test.hpp', False, """ #include boost::unit_test::test_suite* init_unit_test_suite(int argc, char** argv) { return 0; } int main(int argc, char** argv) { return 0; } """]] if env['PLATFORM'] == 'cygwin': conf.CheckBoost1_33(boostTests) else: conf.CheckBoost1_34(boostTests) if conf.CheckHeader('dlfcn.h'): conf.env.Append(CCFLAGS = '-DHAVE_DLFCN_H') conf.env['DL_LIBS'] = '-ldl' conf.CheckCryptoPP() conf.CheckWxWidgets() conf.CheckLightfeather() conf.CheckLFPE() conf.CheckICU() conf.CheckXerces() # XXX Need to be able to report (and stop building) if anything went wrong env = conf.Finish() # Call scripts for individual directories Export('env') scripts.SConscripts(env, ['src/lib/vos', 'src/app/uiprototype', 'src/app/interreality3d', 'src/app/lftest', 'src/app/generator', 'src/app/helloworld', 'src/test']) env.Default(env.Install(os.path.join(env['STAGEDIR'], 'bin'), os.path.join('data', 'park.cod'))) env.Default(env.Install(os.path.join(env['STAGEDIR'], 'bin'), os.path.join('data', 'redrobot.cod'))) if env['PLATFORM'] == 'win32': env['WIXLIGHTFLAGS'] = ['-nologo', '-loc', 'release\\thirdparty\\wix-2.0.5325.0-binaries\\WiXUI_en-us.wxl'] inst = env.WiX('interreality3d-${VERSION}.msi', ['interreality3d.wxs', 'release\\thirdparty\\wix-2.0.5325.0-binaries\\wixui.wixlib']) env.Alias('installer', inst) if env['PLATFORM'] == 'posix': env.Replace(EPM_ARCH = ARGUMENTS.get('EPM_ARCH', '')) if env['EPM_ARCH'] != '': env['EPM_ARCH'] = '-a ' + env['EPM_ARCH'] inst = env.Command('deb', 'interreality3d.list', 'fakeroot ${EPM} -f deb ${EPM_ARCH} interreality3d ${SOURCE}') env.Alias('installer', inst) scripts.RunFinalizers(env)