Annotation of python/pyGiNaC/setup.py, revision 1.9

1.1       pearu       1: #!/usr/bin/env python
                      2: 
                      3: import sys,os,string,time
                      4: 
                      5: if eval(sys.version[0])<2:
                      6:     print "You'll need Python 2.0 or higher to build PyGiNaC"
                      7:     sys.exit()
                      8: 
                      9: #++++++++++++++++++++ boost +++++++++++++++++++++
                     10: boost_dir = '/home/pearu/cvs/boost'
1.3       pearu      11: boost_dir = '/usr/local/share/boost'
                     12: 
1.1       pearu      13: bpl_dir = os.path.join(boost_dir,'libs/python/src')
                     14: bpl_src = map(lambda f:os.path.join(bpl_dir,f),
                     15:               ['classes.cpp','conversions.cpp','extension_class.cpp',
                     16:                'functions.cpp','init_function.cpp','module_builder.cpp',
                     17:                'objects.cpp','types.cpp'])
                     18: 
                     19: #++++++++++++++++++++ GiNaC +++++++++++++++++++++
                     20: 
1.3       pearu      21: #ginac = '/usr/local'
1.1       pearu      22: 
                     23: #ginac_lib = 
                     24: 
                     25: 
                     26: #++++++++++++++++++++++++++++++++++++++++++++++++
                     27: from distutils.core import setup, Extension
                     28: 
                     29: #+++++++++++++ replace gcc with g++ +++++++++++++
                     30: from distutils import sysconfig
                     31: save_init_posix = sysconfig._init_posix
                     32: def my_init_posix():
                     33:     save_init_posix()
                     34:     g = sysconfig._config_vars
1.3       pearu      35:     if g['LDSHARED'][:3]=='gcc':
                     36:         print 'my_init_posix: changing LDSHARED =',`g['LDSHARED']`,
                     37:         g['LDSHARED'] = 'g++'+g['LDSHARED'][3:]
                     38:         print 'to',`g['LDSHARED']`
1.1       pearu      39: sysconfig._init_posix = my_init_posix
                     40: 
1.3       pearu      41: #++++++++++++++++++++ GiNaC._ginac +++++++++++++++++++++
1.1       pearu      42: 
1.5       pearu      43: ginac_cpp = os.path.join('src','_ginac.cpp')
                     44: ginac_cpp = os.path.join('tools','wrappers','ginac.cpp')
                     45: 
                     46: cppsrc = [ginac_cpp]
                     47: 
                     48: if 1:
1.6       pearu      49:     wrap_input = ['symbol','numeric','constant','relational',
                     50:                   'lst','idx','varidx','power','add','mul']
1.9     ! pearu      51:     wrap_input = ['ncmul']
1.5       pearu      52:     execfile(os.path.join('tools','wrappers','build.py'))
                     53:     wrapper_dir = os.path.join('tools','wrappers')
                     54:     build_ginac_cpp(wrap_input,ginac_cpp)
1.4       pearu      55: 
1.2       pearu      56: ginac_ext = Extension('GiNaC._ginac',
1.6       pearu      57:                       sources=cppsrc+bpl_src,
                     58:                       include_dirs=[boost_dir],
                     59:                       libraries=['ginac','cln'],
                     60:                       library_dirs=[],
                     61:                       define_macros=[('DEBUG_PYGINAC', None)],
1.2       pearu      62:                      )
1.3       pearu      63: 
1.1       pearu      64: 
                     65: #++++++++++++++++++++ setup +++++++++++++++++++++
                     66: 
                     67: setup (name = "PyGiNaC",
                     68:        version = "0.0.0",
                     69:        description = "",
                     70:        author = "Pearu Peterson",
                     71:        author_email = "pearu@cens.ioc.ee",
                     72:        licence = "LGPL",
                     73:        long_description= "",
                     74:        url = "",
                     75:        ext_modules = [ ginac_ext ],
                     76:        packages = ['GiNaC'],
                     77:        package_dir = {'GiNaC': 'lib'},
                     78:        )

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>