Changeset 1135 for trunk/SConstruct


Ignore:
Timestamp:
08/14/06 15:59:40 (18 years ago)
Author:
mar637
Message:

more work on a modular scons set up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r1130 r1135  
    11import os
    22import sys
    3 import glob
    43import distutils.sysconfig
    54import platform
     
    1716                            moduledir),
    1817                ("rpfitsdir", "Alternative rpfits location.", ""),
    19                 ("casadir", "Alternative rpfits location", ""),
     18                ("casadir", "Alternative casa location", ""),
    2019                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)
    2224                )
    2325
    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' ],
     26env = Environment( toolpath = ['./scons'],
     27                   tools = ["default", "disttar", "installtree", "casa",
     28                            "utils"],
     29                   ENV = { 'PATH' : os.environ[ 'PATH' ],
    3130                          'HOME' : os.environ[ 'HOME' ] },
    32                   options = opts)
     31                   options = opts)
    3332
    3433Help(opts.GenerateHelpText(env))
    3534env.SConsignFile()
    36 #env.Append(CASAARCH = '')
    37 #env.Append(CASAROOT = '')
     35env.Append(CASAARCH = '', CASAROOT = '')
    3836
    3937if not env.GetOption('clean'):
    4038    conf = Configure(env)
    4139    # import Custom tests
    42     env.AddCustomTests(conf)
     40    env.AddCasaTest(conf)
    4341    pylib = 'python'+distutils.sysconfig.get_python_version()
    4442    pyinc = "Python.h"
     
    6361    env = conf.Finish()
    6462
    65 env["dist_dir"] = "#/dist/asap"
     63env["stage_dir"] = Dir("#/stage/asap")
     64
    6665# general CPPFLAGS
    67 env.Append(CPPFLAGS='-O3 -Wno-long-long'.split())
     66env.Append(CPPFLAGS=['-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-O3'])
    6867# 64bit flags
    6968if  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'])
    7170    # hack to install into /usr/lib64 if scons is in the 32bit /usr/lib/
    7271    if moduledir.startswith("/usr/lib/"):
    7372        moduledir.replace("lib","lib64")
    74 if sys.platform == "darwin":
    75     env['SHLINKFLAGS'] = '$LINKFLAGS -dynamiclib -single_module'
    76     env['SHLIBSUFFIX'] = '.dylib'
     73if env["PLATFORM"] == "darwin":
     74    env['SHLINKFLAGS'] = '$LINKFLAGS -bundle'
     75    #env['SHLIBSUFFIX'] = '.dylib'
    7776
    7877if env['mode'] == 'release':
    7978    env.Append(LINKFLAGS=['-Wl,-O1'])
    80 Export("env","SGlob")
     79Export("env")
    8180
    8281so = env.SConscript("src/SConscript", build_dir="build", duplicate=0)
    83 env.Install(env["dist_dir"], so )
     82env.Install(env["stage_dir"], so )
    8483
    8584pys = env.SConscript("python/SConscript")
    8685asapmod = 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 = [])
    9089asapbin = env.Install(os.path.join(env["prefix"], "bin"), "bin/asap")
    9190env.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.