[Zope-Checkins] SVN: Zope/branches/2.10-with-ZODB3.8/setup.py added
setup code for new flavours of BTree extensions (borrowed
from `ZODB/setup.py`)
Andreas Zeidler
az at zitc.de
Sat Jun 2 17:29:44 EDT 2007
Log message for revision 76175:
added setup code for new flavours of BTree extensions (borrowed from `ZODB/setup.py`)
Changed:
U Zope/branches/2.10-with-ZODB3.8/setup.py
-=-
Modified: Zope/branches/2.10-with-ZODB3.8/setup.py
===================================================================
--- Zope/branches/2.10-with-ZODB3.8/setup.py 2007-06-02 21:21:12 UTC (rev 76174)
+++ Zope/branches/2.10-with-ZODB3.8/setup.py 2007-06-02 21:29:44 UTC (rev 76175)
@@ -307,30 +307,6 @@
'ExtensionClass/pickle/pickle.c',
'Acquisition/Acquisition.h']),
- # BTrees
- Extension(name='BTrees._OOBTree',
- include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
- sources=['BTrees/_OOBTree.c']),
- Extension(name='BTrees._OIBTree',
- include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
- sources=['BTrees/_OIBTree.c']),
- Extension(name='BTrees._IIBTree',
- include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
- define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
- sources=['BTrees/_IIBTree.c']),
- Extension(name='BTrees._IOBTree',
- include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
- define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
- sources=['BTrees/_IOBTree.c']),
- Extension(name='BTrees._IFBTree',
- include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
- define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
- sources=['BTrees/_IFBTree.c']),
- Extension(name='BTrees._fsBTree',
- include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
- define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
- sources=['BTrees/_fsBTree.c']),
-
# DocumentTemplate
Extension(name='DocumentTemplate.cDocumentTemplate',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS,
@@ -413,9 +389,6 @@
Extension(name = 'persistent.TimeStamp',
sources= ['persistent/TimeStamp.c']
),
- Extension(name = 'ZODB.winlock',
- sources = ['ZODB/winlock.c']
- ),
#zope
Extension("zope.proxy._zope_proxy_proxy",
@@ -457,6 +430,50 @@
]
+# BTree extension modules (code borrowed from ZODB/setup.py)
+
+# Include directories for C extensions
+include = ['.']
+
+# Set up dependencies for the BTrees package
+base_btrees_depends = [
+ "BTrees/BTreeItemsTemplate.c",
+ "BTrees/BTreeModuleTemplate.c",
+ "BTrees/BTreeTemplate.c",
+ "BTrees/BucketTemplate.c",
+ "BTrees/MergeTemplate.c",
+ "BTrees/SetOpTemplate.c",
+ "BTrees/SetTemplate.c",
+ "BTrees/TreeSetTemplate.c",
+ "BTrees/sorters.c",
+ "persistent/cPersistence.h",
+ ]
+
+_flavors = {"O": "object", "I": "int", "F": "float", 'L': 'int'}
+
+KEY_H = "BTrees/%skeymacros.h"
+VALUE_H = "BTrees/%svaluemacros.h"
+
+def BTreeExtension(flavor):
+ key = flavor[0]
+ value = flavor[1]
+ name = "BTrees._%sBTree" % flavor
+ sources = ["BTrees/_%sBTree.c" % flavor]
+ kwargs = {"include_dirs": include}
+ if flavor != "fs":
+ kwargs["depends"] = (base_btrees_depends + [KEY_H % _flavors[key],
+ VALUE_H % _flavors[value]])
+ else:
+ kwargs["depends"] = base_btrees_depends
+ if key != "O":
+ kwargs["define_macros"] = [('EXCLUDE_INTSET_SUPPORT', None)]
+ return Extension(name, sources, **kwargs)
+
+ext_modules += [BTreeExtension(flavor)
+ for flavor in ("OO", "IO", "OI", "II", "IF",
+ "fs", "LO", "OL", "LL", "LF",
+ )]
+
# We're using the module docstring as the distutils descriptions.
doclines = __doc__.split("\n")
More information about the Zope-Checkins
mailing list