- Timestamp:
- 08/14/06 15:59:40 (18 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 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"])]) -
trunk/python/SConscript
r1122 r1135 2 2 3 3 # import root environment 4 Import( "env" , "SGlob")4 Import( "env") 5 5 myenv = env.Copy() 6 6 7 7 # gather python files 8 pys = SGlob("*.py")8 pys = myenv.SGlob("*.py") 9 9 pymods = [] 10 10 for p in pys: 11 myenv.Install(myenv[" dist_dir"],p)11 myenv.Install(myenv["stage_dir"],p) 12 12 -
trunk/scons/casa.py
r1129 r1135 1 1 import os 2 2 import re 3 import sys 4 import platform 3 5 4 6 def generate(env): … … 15 17 lattices fits measures measures_f \ 16 18 tables scimath scimath_f casa wcs".split() 17 #env.Prepend( LIBS = casalibs )19 env.Prepend( LIBS = casalibs ) 18 20 casaincd = [os.path.join(env['CASAROOT'], 'code/include'), \ 19 21 os.path.join(env['CASAROOT'], 'code/casa')] … … 33 35 return True 34 36 casaarch = 'linux_gnu' 35 if sys.platform== 'darwin':37 if context.env["PLATFORM"] == 'darwin': 36 38 casaarch = 'darwin' 37 39 elif sys.platform == 'linux2' and platform.architecture()[0] == '64bit': … … 52 54 53 55 54 def AddCustomTests(conf): 55 conf.AddTests({ 56 'CheckCasa' : CheckCasa, 57 }) 56 def AddCasaTest(conf): 57 conf.AddTests({'CheckCasa': CheckCasa}) 58 58 59 env.AddCustomTests = AddCustomTests 60 61 def AddCustomPath(path=""): 62 if not len(path) or not os.path.exists(path): 63 return 64 env.PrependUnique(CPPPATH = [os.path.join(path, "include")]) 65 env.PrependUnique(LIBPATH = [os.path.join(path, "lib")]) 66 env.AddCustomPath = AddCustomPath 59 env.AddCasaTest = AddCasaTest 67 60 68 61 def exists(env): -
trunk/src/SConscript
r1121 r1135 2 2 3 3 # import root environment 4 Import( "env" , "SGlob")4 Import( "env") 5 5 myenv = env.Copy() 6 6 7 7 # gather cpp files 8 cpps = SGlob("*.cpp")9 pycpps = SGlob("python_*.cpp")8 cpps = env.SGlob("*.cpp") 9 pycpps = env.SGlob("python_*.cpp") 10 10 for pf in pycpps: cpps.remove(pf) 11 11
Note:
See TracChangeset
for help on using the changeset viewer.