diff options
author | Fred Drake <fdrake@acm.org> | 2003-10-21 15:41:15 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2003-10-21 15:41:15 (GMT) |
commit | 2d59a4921234333b55e4f7b7f54d5649771d7c09 (patch) | |
tree | ad1494d4dc5137d3071051d75101366163ef325f /setup.py | |
parent | 08317aefef89ca18ce12e53c0cdb3c8e132a6201 (diff) | |
download | cpython-2d59a4921234333b55e4f7b7f54d5649771d7c09.zip cpython-2d59a4921234333b55e4f7b7f54d5649771d7c09.tar.gz cpython-2d59a4921234333b55e4f7b7f54d5649771d7c09.tar.bz2 |
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.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -737,21 +737,26 @@ class PyBuildExt(build_ext): else: xmlbo = "4321" 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_DTD', '1'), ('BYTEORDER', xmlbo), ('XML_CONTEXT_BYTES','1024'), - ], - include_dirs = [expatinc] - )) + ] + 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', + ], + )) # Dynamic loading module if sys.maxint == 0x7fffffff: |