Changeset 2525 for trunk


Ignore:
Timestamp:
05/16/12 09:23:15 (13 years ago)
Author:
Malte Marquarding
Message:

make extension into module to hide from setup.py

Location:
trunk
Files:
2 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r2518 r2525  
    3232opts.AddVariables(
    3333                ("extraroot", "Addition tree to look for packages", None),
     34                ("extraflags", "Additional build flags", None),
    3435                ("FORTRAN", "The fortran compiler", None),
    3536                ("f2clib", "The fortran to c library", None),
     
    212213    if conf.env["alma"]:
    213214        conf.env.Append(CPPFLAGS=['-DUSE_CASAPY'])
     215    if conf.env.get("extraflags"):
     216        flags = conf.env.ParseFlags(conf.env["extraflags"])
     217        conf.env.MergeFlags(flags)
    214218    env = conf.Finish()
    215219
  • trunk/setup.py

    r2517 r2525  
    1 import glob
    2 try:
    3     from setuptools import setup
    4 except ImportError, ex:
    5     from distutils.core import setup
    6 from distutils.core import Extension
    7 from scons_ext import scons_ext
    8 from distutils import ccompiler
     1from setup_ext import setup
    92
    103PKGNAME = "asap"
    11 asapso = Extension(name="%s._%s" % (PKGNAME, PKGNAME), sources=[])
    124
    135setup(name = PKGNAME,
     
    2719      install_requires = ["ipython>=0.11", "matplotlib>=0.99", "numpy>=1.3"],
    2820#      setup_requires = [ "scons>=1.0" ],
    29       ext_modules =[ asapso ],
    30       cmdclass={'build_ext': scons_ext}
    31 
    3221      )
  • trunk/setup_ext/__init__.py

    r2517 r2525  
    11import os, sys, platform
    22import subprocess
     3import glob
    34import shutil
    45from distutils.command import build_ext
     6
     7try:
     8    from setuptools import setup as _setup
     9    from setuptools import Extension
     10except ImportError, ex:
     11    from distutils.core import setup as _setup
     12    from distutils.core import Extension
     13
     14def setup(*args, **kwargs):
     15    asapso = Extension(name="%s._%s".format(kwargs['name'],kwargs['name']),
     16                                            sources=[])
     17    d = {'ext_modules': [ asapso ],
     18         'cmdclass': {'build_ext': scons_ext}
     19         }
     20    kwargs.update(d)
     21    print kwargs
     22    _setup(*args, **kwargs)
     23   
    524
    625class scons_ext(build_ext.build_ext):
     
    2847             ('f2clib=', None, 'Name of the fortran-to-c library'),
    2948             ('jobs=','j', 'Number of processes'),
     49             ('extraflags=', None,
     50              'Extra build flags e.g. static libs, defines etc.'),
    3051             ('extraroot=', None,
    3152              'Extra root directory where muiltple packages could be found,'
     
    4465        self.jobs = None
    4566        self.extraroot = None
     67        self.extraflags = None
    4668        self.casacoreroot = None
    4769        self.casacorestatic = None
Note: See TracChangeset for help on using the changeset viewer.