Commit c8423574 authored by Jim Fulton's avatar Jim Fulton

Reimplemented ExtensionClass based on new-style classes.

(Jeremy and Tim) Changed the implementation of ZODB no lon-longer
depend on ExtensionClass.
parent 7a596eae
...@@ -169,15 +169,14 @@ class ZopeDistribution(distutils.core.Distribution): ...@@ -169,15 +169,14 @@ class ZopeDistribution(distutils.core.Distribution):
BASE_DIR=os.path.dirname(os.path.abspath(sys.argv[0])) BASE_DIR=os.path.dirname(os.path.abspath(sys.argv[0]))
AUTHOR = 'Zope Corporation and Contributors' AUTHOR = 'Zope Corporation and Contributors'
EXTENSIONCLASS_ROOT = os.path.join(BASE_DIR, 'lib', 'Components',
'ExtensionClass')
EXTENSIONCLASS_SRCDIR = os.path.join(EXTENSIONCLASS_ROOT, 'src')
EXTENSIONCLASS_INCLUDEDIRS = [EXTENSIONCLASS_SRCDIR]
# Most modules are in lib/python in the source distribution # Most modules are in lib/python in the source distribution
PACKAGES_ROOT = os.path.join(BASE_DIR, 'lib', 'python') PACKAGES_ROOT = os.path.join(BASE_DIR, 'lib', 'python')
os.chdir(PACKAGES_ROOT) os.chdir(PACKAGES_ROOT)
EXTENSIONCLASS_INCLUDEDIRS = ['ExtensionClass']
# AccessControl # AccessControl
setup( setup(
name='AccessControl', name='AccessControl',
...@@ -198,8 +197,12 @@ setup( ...@@ -198,8 +197,12 @@ setup(
['AccessControl/www', ['AccessControl/www/*']]], ['AccessControl/www', ['AccessControl/www/*']]],
ext_modules=[ ext_modules=[
Extension(name='AccessControl.cAccessControl', Extension(name='AccessControl.cAccessControl',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['Acquisition'],
sources=['AccessControl/cAccessControl.c'])] sources=['AccessControl/cAccessControl.c'],
depends=['ExtensionClass/ExtensionClass.h',
'ExtensionClass/pickle/pickle.c',
'Acquisition/Acquisition.h'],
)]
) )
# App # App
...@@ -232,49 +235,26 @@ setup( ...@@ -232,49 +235,26 @@ setup(
packages=['BTrees', 'BTrees.tests'], packages=['BTrees', 'BTrees.tests'],
ext_modules=[ ext_modules=[
Extension(name='BTrees._OOBTree', Extension(name='BTrees._OOBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'], include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['persistent'],
sources=['BTrees/_OOBTree.c']), sources=['BTrees/_OOBTree.c']),
Extension(name='BTrees._OIBTree', Extension(name='BTrees._OIBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'], include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['persistent'],
sources=['BTrees/_OIBTree.c']), sources=['BTrees/_OIBTree.c']),
Extension(name='BTrees._IIBTree', Extension(name='BTrees._IIBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'], include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['persistent'],
define_macros=[('EXCLUDE_INTSET_SUPPORT', None)], define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
sources=['BTrees/_IIBTree.c']), sources=['BTrees/_IIBTree.c']),
Extension(name='BTrees._IOBTree', Extension(name='BTrees._IOBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'], include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['persistent'],
define_macros=[('EXCLUDE_INTSET_SUPPORT', None)], define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
sources=['BTrees/_IOBTree.c']), sources=['BTrees/_IOBTree.c']),
Extension(name='BTrees._fsBTree', Extension(name='BTrees._fsBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'], include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['persistent'],
define_macros=[('EXCLUDE_INTSET_SUPPORT', None)], define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
sources=['BTrees/_fsBTree.c'])], sources=['BTrees/_fsBTree.c'])],
data_files=[['BTrees', ['BTrees/Maintainer.txt']]], data_files=[['BTrees', ['BTrees/Maintainer.txt']]],
) )
# BTrees compatibility package
setup(
name='BTree',
author=AUTHOR,
#headers=['../Components/BTree/intSet.h'],
ext_modules=[
Extension(name='BTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'],
sources=['../Components/BTree/BTree.c']),
Extension(name='IIBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'],
sources=['../Components/BTree/IIBTree.c']),
Extension(name='IOBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'],
sources=['../Components/BTree/IOBTree.c']),
Extension(name='OIBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'],
sources=['../Components/BTree/OIBTree.c']),
Extension(name='intSet',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS + ['ZODB'],
sources=['../Components/BTree/intSet.c'])]
)
# DateTime # DateTime
setup( setup(
...@@ -326,31 +306,51 @@ setup( ...@@ -326,31 +306,51 @@ setup(
name='ExtensionClass', name='ExtensionClass',
author=AUTHOR, author=AUTHOR,
packages=['ExtensionClass', 'Acquisition', 'MethodObject', 'MultiMapping',
'ThreadLock', 'Missing', 'Record', 'ComputedAttribute'],
ext_modules=[ ext_modules=[
Extension(name='ExtensionClass', Extension(name='ExtensionClass._ExtensionClass',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=EXTENSIONCLASS_INCLUDEDIRS,
sources=[EXTENSIONCLASS_SRCDIR + "/ExtensionClass.c"]), sources=["ExtensionClass/_ExtensionClass.c"],
Extension(name='Acquisition', depends=["ExtensionClass/ExtensionClass.h"],
),
Extension(name='Acquisition._Acquisition',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=EXTENSIONCLASS_INCLUDEDIRS,
sources=[EXTENSIONCLASS_SRCDIR + "/Acquisition.c"]), sources=["Acquisition/_Acquisition.c"],
Extension(name='MethodObject', depends=["ExtensionClass/ExtensionClass.h",
"Acquisition/Acquisition.h"],
),
Extension(name='MethodObject._MethodObject',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=EXTENSIONCLASS_INCLUDEDIRS,
sources=[EXTENSIONCLASS_SRCDIR + "/MethodObject.c"]), sources=["MethodObject/_MethodObject.c"],
Extension(name='MultiMapping', depends=["ExtensionClass/ExtensionClass.h"],
),
Extension(name='MultiMapping._MultiMapping',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=EXTENSIONCLASS_INCLUDEDIRS,
sources=[EXTENSIONCLASS_SRCDIR + "/MultiMapping.c"]), sources=["MultiMapping/_MultiMapping.c"],
Extension(name='ThreadLock', depends=["ExtensionClass/ExtensionClass.h"],
),
Extension(name='ThreadLock._ThreadLock',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=EXTENSIONCLASS_INCLUDEDIRS,
sources=[EXTENSIONCLASS_SRCDIR + "/ThreadLock.c"]), sources=["ThreadLock/_ThreadLock.c"],
Extension(name='Missing', depends=["ExtensionClass/ExtensionClass.h"],
),
Extension(name='Missing._Missing',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=EXTENSIONCLASS_INCLUDEDIRS,
sources=[EXTENSIONCLASS_SRCDIR + "/Missing.c"]), sources=["Missing/_Missing.c"],
Extension(name='Record', depends=["ExtensionClass/ExtensionClass.h"],
),
Extension(name='Record._Record',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=EXTENSIONCLASS_INCLUDEDIRS,
sources=[EXTENSIONCLASS_SRCDIR + "/Record.c"]), sources=["Record/_Record.c"],
Extension(name='ComputedAttribute', depends=["ExtensionClass/ExtensionClass.h"],
),
Extension(name='ComputedAttribute._ComputedAttribute',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=EXTENSIONCLASS_INCLUDEDIRS,
sources=[EXTENSIONCLASS_SRCDIR + "/ComputedAttribute.c"]), sources=["ComputedAttribute/_ComputedAttribute.c"],
depends=["ExtensionClass/ExtensionClass.h"],
),
] ]
) )
...@@ -560,29 +560,47 @@ setup( ...@@ -560,29 +560,47 @@ setup(
['ZClasses/dtml', ['ZClasses/dtml/*']]], ['ZClasses/dtml', ['ZClasses/dtml/*']]],
) )
# ZODB # ZODB
setup( setup(
name='ZODB', name='ZODB',
author=AUTHOR, author=AUTHOR,
packages=['Persistence', 'ZODB', 'ZODB.tests'], packages=['Persistence', 'persistent', 'ZODB', 'ZODB.tests'],
data_files=[['ZODB', ['ZODB/component.xml']]], data_files=[['ZODB', ['ZODB/component.xml']]],
ext_modules=[ ext_modules=[
Extension(name='ZODB.cPersistence', Extension(name='persistent.cPersistence',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=['persistent'],
sources=['ZODB/cPersistence.c']), sources=['persistent/cPersistence.c',
Extension(name='ZODB.cPickleCache', 'persistent/ring.c'],
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, depends=['persistent/cPersistence.h',
sources=['ZODB/cPickleCache.c']), 'persistent/ring.h',
Extension(name='ZODB.TimeStamp', 'persistent/ring.c'],
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, ),
define_macros=[('USE_EXTENSION_CLASS', 1)], Extension(name='Persistence._Persistence',
sources=['ZODB/TimeStamp.c']), include_dirs=['persistent', 'ExtensionClass'],
sources=['Persistence/_Persistence.c',
],
depends=['persistent/cPersistence.h',
'ExtensionClass/ExtensionClass.h',
],
),
Extension(name='persistent.cPickleCache',
include_dirs=['persistent'],
sources=['persistent/cPickleCache.c',
'persistent/ring.c'],
depends = ['persistent/cPersistence.h',
'persistent/ring.h',
'persistent/ring.c']
),
Extension(name='persistent.TimeStamp',
include_dirs=['persistent'],
sources=['persistent/TimeStamp.c']),
Extension(name='ZODB.coptimizations', Extension(name='ZODB.coptimizations',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=['persistent'],
sources=['ZODB/coptimizations.c']), sources=['ZODB/coptimizations.c']),
Extension(name='ZODB.winlock', Extension(name='ZODB.winlock',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS, include_dirs=['persistent'],
sources=['ZODB/winlock.c'])], sources=['ZODB/winlock.c'])],
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment