setup.py 1.11 KB
Newer Older
1
#!/usr/bin/env python
Uwe Schulzweida's avatar
Uwe Schulzweida committed
2
3
4
5
6
7
import os, string

INCFLAGS = []
CFLAGS   = []
LDFLAGS  = []
LIBS     = []
8
9
10
11
12
13
14
15
16
17
18
if 'INCFLAGS' in os.environ:
   INCFLAGS = os.environ['INCFLAGS'].split()

if 'CFLAGS' in os.environ:
   CFLAGS  = os.environ['CFLAGS'].split()

if 'LDFLAGS' in os.environ:
   LDFLAGS  = os.environ['LDFLAGS'].split('-L')

if 'LIBS' in os.environ:
   LIBS     = os.environ['LIBS'].split()
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41


from distutils.core import setup, Extension
from setup import *

cdiobj_module = Extension('_Cdi',
                  sources=['cdi_wrapper.cpp'],
                  extra_compile_args = INCFLAGS,
                  library_dirs = LDFLAGS,
                  extra_objects = ['../cdi.o'],
                  runtime_library_dirs = [os.environ['BUILDLIBDIR'],os.environ['LIBDIR']],
                  extra_link_args = LIBS,
                  libraries    = ['cdi','stdc++'],
                  language = 'c++',
                  )

setup (name = 'Cdi',
       version = '0.1',
       author      = "Ralf Mueller",
       description = """pyhton bindings to CDI class library""",
       ext_modules = [cdiobj_module],
       py_modules = ["Cdi"],
       )