mirror of
https://github.com/python/cpython.git
synced 2025-09-17 22:20:23 +00:00
add a --with-system-expat option to build pyexpat against the system's lib #7609
This commit is contained in:
parent
df6f963f15
commit
2c19674b51
4 changed files with 61 additions and 27 deletions
|
@ -93,6 +93,10 @@ C-API
|
||||||
Build
|
Build
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #7609: Add a --with-system-expat option that causes the system's expat
|
||||||
|
library to be used for the pyexpat module instead of the one included with
|
||||||
|
Python.
|
||||||
|
|
||||||
- Issue #7589: Only build the nis module when the correct header files are
|
- Issue #7589: Only build the nis module when the correct header files are
|
||||||
found.
|
found.
|
||||||
|
|
||||||
|
|
47
configure
vendored
47
configure
vendored
|
@ -1,5 +1,5 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# From configure.in Revision: 76644 .
|
# From configure.in Revision: 77031 .
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.61 for python 2.7.
|
# Generated by GNU Autoconf 2.61 for python 2.7.
|
||||||
#
|
#
|
||||||
|
@ -1348,6 +1348,8 @@ Optional Packages:
|
||||||
--with-suffix=.exe set executable suffix
|
--with-suffix=.exe set executable suffix
|
||||||
--with-pydebug build with Py_DEBUG defined
|
--with-pydebug build with Py_DEBUG defined
|
||||||
--with-libs='lib1 ...' link against additional libs
|
--with-libs='lib1 ...' link against additional libs
|
||||||
|
--with-system-expat build pyexpat module using an installed expat
|
||||||
|
library
|
||||||
--with-system-ffi build _ctypes module using an installed ffi library
|
--with-system-ffi build _ctypes module using an installed ffi library
|
||||||
--with-dbmliborder=db1:db2:...
|
--with-dbmliborder=db1:db2:...
|
||||||
order to check db backends for dbm. Valid value is a
|
order to check db backends for dbm. Valid value is a
|
||||||
|
@ -3857,7 +3859,7 @@ else
|
||||||
{ echo "$as_me:$LINENO: result: no" >&5
|
{ echo "$as_me:$LINENO: result: no" >&5
|
||||||
echo "${ECHO_T}no" >&6; }
|
echo "${ECHO_T}no" >&6; }
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5410,7 +5412,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
else
|
else
|
||||||
ac_cv_header_stdc=no
|
ac_cv_header_stdc=no
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -5431,7 +5433,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
else
|
else
|
||||||
ac_cv_header_stdc=no
|
ac_cv_header_stdc=no
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6529,7 +6531,7 @@ _ACEOF
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
{ echo "$as_me:$LINENO: result: $was_it_defined" >&5
|
{ echo "$as_me:$LINENO: result: $was_it_defined" >&5
|
||||||
echo "${ECHO_T}$was_it_defined" >&6; }
|
echo "${ECHO_T}$was_it_defined" >&6; }
|
||||||
|
@ -7059,7 +7061,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
else
|
else
|
||||||
ac_cv_type_uid_t=no
|
ac_cv_type_uid_t=no
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
fi
|
fi
|
||||||
{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
|
{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
|
||||||
|
@ -15513,6 +15515,19 @@ echo "${ECHO_T}no" >&6; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Check for use of the system expat library
|
||||||
|
{ echo "$as_me:$LINENO: checking for --with-system-expat" >&5
|
||||||
|
echo $ECHO_N "checking for --with-system-expat... $ECHO_C" >&6; }
|
||||||
|
|
||||||
|
# Check whether --with-system_expat was given.
|
||||||
|
if test "${with_system_expat+set}" = set; then
|
||||||
|
withval=$with_system_expat;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
{ echo "$as_me:$LINENO: result: $with_system_expat" >&5
|
||||||
|
echo "${ECHO_T}$with_system_expat" >&6; }
|
||||||
|
|
||||||
# Check for use of the system libffi library
|
# Check for use of the system libffi library
|
||||||
{ echo "$as_me:$LINENO: checking for --with-system-ffi" >&5
|
{ echo "$as_me:$LINENO: checking for --with-system-ffi" >&5
|
||||||
echo $ECHO_N "checking for --with-system-ffi... $ECHO_C" >&6; }
|
echo $ECHO_N "checking for --with-system-ffi... $ECHO_C" >&6; }
|
||||||
|
@ -15719,7 +15734,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
else
|
else
|
||||||
unistd_defines_pthreads=no
|
unistd_defines_pthreads=no
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
{ echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
|
{ echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
|
||||||
echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
|
echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
|
||||||
|
@ -17333,7 +17348,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
$EGREP "yes" >/dev/null 2>&1; then
|
$EGREP "yes" >/dev/null 2>&1; then
|
||||||
ipv6type=$i
|
ipv6type=$i
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
;;
|
;;
|
||||||
kame)
|
kame)
|
||||||
|
@ -17356,7 +17371,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
ipv6libdir=/usr/local/v6/lib
|
ipv6libdir=/usr/local/v6/lib
|
||||||
ipv6trylibc=yes
|
ipv6trylibc=yes
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
;;
|
;;
|
||||||
linux-glibc)
|
linux-glibc)
|
||||||
|
@ -17377,7 +17392,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
ipv6type=$i;
|
ipv6type=$i;
|
||||||
ipv6trylibc=yes
|
ipv6trylibc=yes
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
;;
|
;;
|
||||||
linux-inet6)
|
linux-inet6)
|
||||||
|
@ -17415,7 +17430,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
ipv6lib=inet6;
|
ipv6lib=inet6;
|
||||||
ipv6libdir=/usr/local/v6/lib
|
ipv6libdir=/usr/local/v6/lib
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
;;
|
;;
|
||||||
v6d)
|
v6d)
|
||||||
|
@ -17438,7 +17453,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
ipv6libdir=/usr/local/v6/lib;
|
ipv6libdir=/usr/local/v6/lib;
|
||||||
BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
|
BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
;;
|
;;
|
||||||
zeta)
|
zeta)
|
||||||
|
@ -17460,7 +17475,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
ipv6lib=inet6;
|
ipv6lib=inet6;
|
||||||
ipv6libdir=/usr/local/v6/lib
|
ipv6libdir=/usr/local/v6/lib
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -26003,7 +26018,7 @@ cat >>confdefs.h <<\_ACEOF
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
/* confdefs.h. */
|
/* confdefs.h. */
|
||||||
|
@ -26022,7 +26037,7 @@ cat >>confdefs.h <<\_ACEOF
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -26292,7 +26307,7 @@ cat >>confdefs.h <<\_ACEOF
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
rm -f -r conftest*
|
rm -f conftest*
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1964,6 +1964,13 @@ LIBS="$withval $LIBS"
|
||||||
],
|
],
|
||||||
[AC_MSG_RESULT(no)])
|
[AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
|
# Check for use of the system expat library
|
||||||
|
AC_MSG_CHECKING(for --with-system-expat)
|
||||||
|
AC_ARG_WITH(system_expat,
|
||||||
|
AC_HELP_STRING(--with-system-expat, build pyexpat module using an installed expat library))
|
||||||
|
|
||||||
|
AC_MSG_RESULT($with_system_expat)
|
||||||
|
|
||||||
# Check for use of the system libffi library
|
# Check for use of the system libffi library
|
||||||
AC_MSG_CHECKING(for --with-system-ffi)
|
AC_MSG_CHECKING(for --with-system-ffi)
|
||||||
AC_ARG_WITH(system_ffi,
|
AC_ARG_WITH(system_ffi,
|
||||||
|
|
24
setup.py
24
setup.py
|
@ -1220,19 +1220,26 @@ class PyBuildExt(build_ext):
|
||||||
#
|
#
|
||||||
# More information on Expat can be found at www.libexpat.org.
|
# More information on Expat can be found at www.libexpat.org.
|
||||||
#
|
#
|
||||||
expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')
|
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 = [
|
define_macros = [
|
||||||
('HAVE_EXPAT_CONFIG_H', '1'),
|
('HAVE_EXPAT_CONFIG_H', '1'),
|
||||||
]
|
]
|
||||||
|
expat_lib = []
|
||||||
|
expat_sources = ['expat/xmlparse.c',
|
||||||
|
'expat/xmlrole.c',
|
||||||
|
'expat/xmltok.c']
|
||||||
|
|
||||||
exts.append(Extension('pyexpat',
|
exts.append(Extension('pyexpat',
|
||||||
define_macros = define_macros,
|
define_macros = define_macros,
|
||||||
include_dirs = [expatinc],
|
include_dirs = expat_inc,
|
||||||
sources = ['pyexpat.c',
|
libraries = expat_lib,
|
||||||
'expat/xmlparse.c',
|
sources = ['pyexpat.c'] + expat_sources
|
||||||
'expat/xmlrole.c',
|
|
||||||
'expat/xmltok.c',
|
|
||||||
],
|
|
||||||
))
|
))
|
||||||
|
|
||||||
# Fredrik Lundh's cElementTree module. Note that this also
|
# Fredrik Lundh's cElementTree module. Note that this also
|
||||||
|
@ -1242,7 +1249,8 @@ class PyBuildExt(build_ext):
|
||||||
define_macros.append(('USE_PYEXPAT_CAPI', None))
|
define_macros.append(('USE_PYEXPAT_CAPI', None))
|
||||||
exts.append(Extension('_elementtree',
|
exts.append(Extension('_elementtree',
|
||||||
define_macros = define_macros,
|
define_macros = define_macros,
|
||||||
include_dirs = [expatinc],
|
include_dirs = expat_inc,
|
||||||
|
libraries = expat_lib,
|
||||||
sources = ['_elementtree.c'],
|
sources = ['_elementtree.c'],
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue