-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')
+def PyAFSExtension(module, *args, **kwargs):
+ kwargs.setdefault('libraries', []).extend(libraries)
+ kwargs.setdefault('include_dirs', []).extend(include_dirs)
+ kwargs.setdefault('library_dirs', []).extend(library_dirs)
+ kwargs.setdefault('define_macros', []).extend(define_macros)
+ return Extension(module,
+ ["%s.pyx" % module.replace('.', '/')],
+ *args,
+ **kwargs)