File:  [CENS] / python / pyGiNaC / setup.py
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 7 19:58:28 2001 UTC (16 years, 8 months ago) by pearu
Branches: pearu
CVS tags: ver0
importing

#!/usr/bin/env python

import sys,os,string,time

if eval(sys.version[0])<2:
    print "You'll need Python 2.0 or higher to build PyGiNaC"
    sys.exit()

#++++++++++++++++++++ boost +++++++++++++++++++++
boost_dir = '/home/pearu/cvs/boost'
bpl_dir = os.path.join(boost_dir,'libs/python/src')
bpl_src = map(lambda f:os.path.join(bpl_dir,f),
              ['classes.cpp','conversions.cpp','extension_class.cpp',
               'functions.cpp','init_function.cpp','module_builder.cpp',
               'objects.cpp','types.cpp'])

#++++++++++++++++++++ GiNaC +++++++++++++++++++++

ginac = '/opt/GiNaC-0.7.3'

#ginac_lib = 


#++++++++++++++++++++++++++++++++++++++++++++++++
from distutils.core import setup, Extension

#+++++++++++++ replace gcc with g++ +++++++++++++
from distutils import sysconfig
save_init_posix = sysconfig._init_posix
def my_init_posix():
    print 'my_init_posix: changing gcc to g++'
    save_init_posix()
    g = sysconfig._config_vars
    g['CC'] = 'g++'
    g['LDSHARED'] = 'g++ -shared'
sysconfig._init_posix = my_init_posix

#++++++++++++++++++++ test a1 +++++++++++++++++++++

a1_ext = Extension('GiNaC.a1',
                     sources=[os.path.join('src','a1.cpp')]+bpl_src,
                     include_dirs=[boost_dir],
                     libraries=[],
                     library_dirs=[]
                     )

a2_ext = Extension('GiNaC.a2',
                     sources=[os.path.join('src','a2.cpp')]+bpl_src,
                     include_dirs=[boost_dir],
                     libraries=[],
                     library_dirs=[]
                     )


a3_ext = Extension('GiNaC.a3',
                     sources=[os.path.join('src','a3.cpp')]+bpl_src,
                     include_dirs=[boost_dir],
                     libraries=['cln','ginac'],
                     library_dirs=[]
                     )

ginac_ext = Extension('GiNaC.ginac',
                     sources=[os.path.join('src','ginac.cpp')]+bpl_src,
                     include_dirs=[boost_dir],
                     libraries=['cln','ginac'],
                     library_dirs=[]
                     )

#++++++++++++++++++++ setup +++++++++++++++++++++

setup (name = "PyGiNaC",
       version = "0.0.0",
       description = "",
       author = "Pearu Peterson",
       author_email = "pearu@cens.ioc.ee",
       licence = "LGPL",
       long_description= "",
       url = "",
       ext_modules = [ ginac_ext ],
       packages = ['GiNaC'],
       package_dir = {'GiNaC': 'lib'},
       )

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