mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Merged revisions 77169 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77169 | benjamin.peterson | 2009-12-30 21:17:18 -0600 (Wed, 30 Dec 2009) | 2 lines add a --with-system-expat option to build pyexpat against the system's lib #7609 ........
This commit is contained in:
parent
587a31001e
commit
b2d9046792
4 changed files with 61 additions and 27 deletions
30
setup.py
30
setup.py
|
@ -1104,19 +1104,26 @@ class PyBuildExt(build_ext):
|
|||
#
|
||||
# More information on Expat can be found at www.libexpat.org.
|
||||
#
|
||||
expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')
|
||||
define_macros = [
|
||||
('HAVE_EXPAT_CONFIG_H', '1'),
|
||||
]
|
||||
if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
|
||||
expat_inc = []
|
||||
define_macros = []
|
||||
expat_lib = ['expat']
|
||||
expat_sources = []
|
||||
else:
|
||||
expat_inc = [os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')]
|
||||
define_macros = [
|
||||
('HAVE_EXPAT_CONFIG_H', '1'),
|
||||
]
|
||||
expat_lib = []
|
||||
expat_sources = ['expat/xmlparse.c',
|
||||
'expat/xmlrole.c',
|
||||
'expat/xmltok.c']
|
||||
|
||||
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 = expat_inc,
|
||||
libraries = expat_lib,
|
||||
sources = ['pyexpat.c'] + expat_sources
|
||||
))
|
||||
|
||||
# Fredrik Lundh's cElementTree module. Note that this also
|
||||
|
@ -1126,7 +1133,8 @@ class PyBuildExt(build_ext):
|
|||
define_macros.append(('USE_PYEXPAT_CAPI', None))
|
||||
exts.append(Extension('_elementtree',
|
||||
define_macros = define_macros,
|
||||
include_dirs = [expatinc],
|
||||
include_dirs = expat_inc,
|
||||
libraries = expat_lib,
|
||||
sources = ['_elementtree.c'],
|
||||
))
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue