mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Provide a bit more information to the compiler when building Expat.
This avoids having to modify the Expat sources in any way starting with Expat 1.95.7.
This commit is contained in:
parent
08317aefef
commit
2d59a49212
1 changed files with 16 additions and 11 deletions
21
setup.py
21
setup.py
|
@ -737,20 +737,25 @@ class PyBuildExt(build_ext):
|
||||||
else:
|
else:
|
||||||
xmlbo = "4321"
|
xmlbo = "4321"
|
||||||
expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')
|
expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')
|
||||||
exts.append(Extension('pyexpat',
|
|
||||||
sources = [
|
|
||||||
'pyexpat.c',
|
|
||||||
'expat/xmlparse.c',
|
|
||||||
'expat/xmlrole.c',
|
|
||||||
'expat/xmltok.c',
|
|
||||||
],
|
|
||||||
define_macros = [
|
define_macros = [
|
||||||
('XML_NS', '1'),
|
('XML_NS', '1'),
|
||||||
('XML_DTD', '1'),
|
('XML_DTD', '1'),
|
||||||
('BYTEORDER', xmlbo),
|
('BYTEORDER', xmlbo),
|
||||||
('XML_CONTEXT_BYTES','1024'),
|
('XML_CONTEXT_BYTES','1024'),
|
||||||
|
]
|
||||||
|
config_h = sysconfig.get_config_h_filename()
|
||||||
|
config_h_vars = sysconfig.parse_config_h(open(config_h))
|
||||||
|
for feature_macro in ['HAVE_MEMMOVE', 'HAVE_BCOPY']:
|
||||||
|
if config_h_vars.has_key(feature_macro):
|
||||||
|
define_macros.append((feature_macro, '1'))
|
||||||
|
exts.append(Extension('pyexpat',
|
||||||
|
define_macros = define_macros,
|
||||||
|
include_dirs = [expatinc],
|
||||||
|
sources = ['pyexpat.c',
|
||||||
|
'expat/xmlparse.c',
|
||||||
|
'expat/xmlrole.c',
|
||||||
|
'expat/xmltok.c',
|
||||||
],
|
],
|
||||||
include_dirs = [expatinc]
|
|
||||||
))
|
))
|
||||||
|
|
||||||
# Dynamic loading module
|
# Dynamic loading module
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue