From: Fred Drake Date: Tue, 21 Oct 2003 20:01:21 +0000 (+0000) Subject: Provide a bit more information to the compiler when building Expat. X-Git-Tag: v2.3.3c1~119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb97fa81ef7d84072cc2f5d819c14ff01faf9b2c;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/setup.py b/setup.py index 3fec4f7770db..d2cae8ae7f2f 100644 --- a/setup.py +++ b/setup.py @@ -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: