Changeset 1135 for trunk/SConstruct
- Timestamp:
- 08/14/06 15:59:40 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r1130 r1135 1 1 import os 2 2 import sys 3 import glob4 3 import distutils.sysconfig 5 4 import platform … … 17 16 moduledir), 18 17 ("rpfitsdir", "Alternative rpfits location.", ""), 19 ("casadir", "Alternative rpfitslocation", ""),18 ("casadir", "Alternative casa location", ""), 20 19 EnumOption("mode", "The type of build.", "debug", 21 ["release","debug"], ignorecase=1) 20 ["release","debug"], ignorecase=1), 21 BoolOption("staticlink", 22 "Should extrenal libs be linked in statically", 23 False) 22 24 ) 23 25 24 def SGlob(pattern): 25 path = GetBuildPath('SConscript').replace('SConscript', '') 26 return [ i.replace(path, '') for i in glob.glob(path + pattern) ] 27 28 29 env = Environment( toolpath = ['./scons'], tools = ["default", "disttar", "installtree", "malte"], 30 ENV = { 'PATH' : os.environ[ 'PATH' ], 26 env = Environment( toolpath = ['./scons'], 27 tools = ["default", "disttar", "installtree", "casa", 28 "utils"], 29 ENV = { 'PATH' : os.environ[ 'PATH' ], 31 30 'HOME' : os.environ[ 'HOME' ] }, 32 options = opts)31 options = opts) 33 32 34 33 Help(opts.GenerateHelpText(env)) 35 34 env.SConsignFile() 36 #env.Append(CASAARCH = '') 37 #env.Append(CASAROOT = '') 35 env.Append(CASAARCH = '', CASAROOT = '') 38 36 39 37 if not env.GetOption('clean'): 40 38 conf = Configure(env) 41 39 # import Custom tests 42 env.AddC ustomTests(conf)40 env.AddCasaTest(conf) 43 41 pylib = 'python'+distutils.sysconfig.get_python_version() 44 42 pyinc = "Python.h" … … 63 61 env = conf.Finish() 64 62 65 env["dist_dir"] = "#/dist/asap" 63 env["stage_dir"] = Dir("#/stage/asap") 64 66 65 # general CPPFLAGS 67 env.Append(CPPFLAGS= '-O3 -Wno-long-long'.split())66 env.Append(CPPFLAGS=['-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-O3']) 68 67 # 64bit flags 69 68 if platform.architecture()[0] == '64bit': 70 env.Append(CPPFLAGS= '-fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__x86_64__ -DAIPS_64B'.split())69 env.Append(CPPFLAGS=['-fPIC', '-D__x86_64__', '-DAIPS_64B']) 71 70 # hack to install into /usr/lib64 if scons is in the 32bit /usr/lib/ 72 71 if moduledir.startswith("/usr/lib/"): 73 72 moduledir.replace("lib","lib64") 74 if sys.platform== "darwin":75 env['SHLINKFLAGS'] = '$LINKFLAGS - dynamiclib -single_module'76 env['SHLIBSUFFIX'] = '.dylib'73 if env["PLATFORM"] == "darwin": 74 env['SHLINKFLAGS'] = '$LINKFLAGS -bundle' 75 #env['SHLIBSUFFIX'] = '.dylib' 77 76 78 77 if env['mode'] == 'release': 79 78 env.Append(LINKFLAGS=['-Wl,-O1']) 80 Export("env" ,"SGlob")79 Export("env") 81 80 82 81 so = env.SConscript("src/SConscript", build_dir="build", duplicate=0) 83 env.Install(env[" dist_dir"], so )82 env.Install(env["stage_dir"], so ) 84 83 85 84 pys = env.SConscript("python/SConscript") 86 85 asapmod = env.InstallTree(dest_dir = os.path.join(env["moduledir"], "asap"), 87 src_dir = "dist/asap",88 includes = ['*.py', '*.so'],89 excludes = [])86 src_dir = "stage/asap", 87 includes = ['*.py', '*.so'], 88 excludes = []) 90 89 asapbin = env.Install(os.path.join(env["prefix"], "bin"), "bin/asap") 91 90 env.Alias('install', [asapmod, asapbin]) 92 93 #if env['mode'] == "release":94 # env.DistTar("dist/asap", ["README", "INSTALL", Dir(env["dist_dir"])])
Note:
See TracChangeset
for help on using the changeset viewer.