Changeset 2517 for trunk/SConstruct


Ignore:
Timestamp:
05/15/12 15:17:10 (13 years ago)
Author:
Malte Marquarding
Message:

More updates to get a distutils/scons build going

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r2510 r2517  
    2121            pass
    2222    return ""
     23
     24def get_libdir():
     25    return os.path.basename(distutils.sysconfig.get_config_var('LIBDIR'))
     26
     27LIBDIR = "lib' #get_libdir()
    2328
    2429EnsureSConsVersion(1,0,0)
     
    127132    else:
    128133        conf.env.AppendUnique(CPPPATH=[conf.env["numpyincdir"]])
    129         # numpy 1.0 uses config.h; numpy >= 1.1 uses numpyconfig.h
    130134        if conf.CheckHeader("numpy/numpyconfig.h"):
    131135            conf.env.Append(CPPDEFINES=["-DAIPS_USENUMPY"])
     
    136140    conf.env.Append(CPPFLAGS=['-DHAVE_LIBPYRAP'])
    137141
     142    if not conf.CheckLib("m"):
     143        Exit(1)
    138144    # test for cfitsio
    139     if not conf.CheckLib("m"): Exit(1)
    140145    conf.env.AddCustomPackage('cfitsio')
    141146    libname = conf.env["cfitsiolib"]
    142     if libname.find(".") > -1 and os.path.exists(libname):
    143         conf.env.AppendUnique(LIBS=[env.File(libname)])
    144     else:
    145         if not conf.CheckLibWithHeader(libname,
    146                                        'fitsio.h', language='c'):
     147    if not conf.CheckHeader("fitsio.h"):
     148        #SuSE is being special
     149        conf.env.AppendUnique(CPPPATH=['/usr/include/libcfitsio0'])
     150        if not conf.CheckHeader("fitsio.h"):
     151            Exit(1)
     152    if libname.find(".") > -1 and os.path.exists(libname):
     153        conf.env.AppendUnique(LIBS=[env.File(libname)])
     154    else:
     155        if not conf.CheckLib(libname, language='c'):
    147156            Exit(1)
    148157    conf.env.AddCustomPackage('wcs')
     
    156165
    157166    conf.env.AddCustomPackage('rpfits')
    158     if not conf.CheckLib(conf.env["rpfitslib"], language="c"):
     167    if not conf.CheckLibWithHeader(conf.env["rpfitslib"], "RPFITS.h",
     168                                   language="c"):
    159169        Exit(1)
    160170   
     
    163173        pth = os.path.join(p, "include", "casacore")       
    164174        if os.path.exists(pth):
    165             libpth = os.path.join(p, "lib")
     175            libpth = os.path.join(p, LIBDIR)
    166176            conf.env.AppendUnique(CPPPATH=[pth])
    167177            break
     
    169179              "casa_coordinates", "casa_lattices",
    170180              "casa_fits", "casa_measures", "casa_scimath",
    171               "casa_scimath_f", "casa_tables",
    172               "casa_mirlib", "casa_casa"]
     181              "casa_scimath_f", "casa_tables", "casa_casa"]
    173182    if conf.env["casacorestatic"]:
    174183        libs = [ env.File(os.path.join(libpth, "lib"+lib+".a")) \
Note: See TracChangeset for help on using the changeset viewer.