X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-afs.git/blobdiff_plain/7f4b67d7f215fd22223ced8526783cd45f7b0e29..0a84865f183dcecb5711250a1a96fa18ad5d3125:/setup.py diff --git a/setup.py b/setup.py index 1e7b770..2a66b67 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages from distutils.extension import Extension -from Pyrex.Distutils import build_ext +from Cython.Distutils import build_ext import sys import os @@ -17,6 +17,22 @@ include_dirs = [os.path.join(os.path.dirname(__file__), 'afs'), '%s/include' % root] library_dirs = ['%s/lib' % root, '%s/lib/afs' % root] +libraries = ['bos', 'volser', 'vldb', 'afsrpc', 'afsauthent', 'cmd', 'usd', + 'audit', 'util', + 'util', 'afsrpc', 'util', + 'util', 'afsauthent', 'util', + 'resolv'] +extra_objects = [] +define_macros = [('AfS_PTHREAD_ENV', None)] + +for i, l in enumerate(libraries): + if l in ('util', 'vlib') and \ + not os.path.exists('%s/lib/afs/lib%s.a' % (root, l)): + libraries.pop(i) + extra_objects.append('%s/lib/afs/%s.a' % (root, l)) + elif l == 'com_err': + libraries.pop(i) + extra_objects.append('%s/lib/afs/libcom_err.a') setup( name="PyAFS", @@ -24,16 +40,17 @@ setup( description="PyAFS - Python bindings for AFS", author="Evan Broder", author_email="broder@mit.edu", - license="MIT", - requires=['Pyrex'], + license="GPL", + requires=['Cython'], packages=find_packages(), ext_modules=[ Extension("afs._pts", ["afs/_pts.pyx"], - libraries=['bos', 'volser', 'vldb', 'afsrpc', 'afsauthent', - 'cmd', 'usd', 'audit'], + libraries=libraries, include_dirs=include_dirs, - library_dirs=library_dirs) + library_dirs=library_dirs, + extra_objects=extra_objects, + define_macros=define_macros) ], cmdclass= {"build_ext": build_ext} )