void-packages/srcpkgs/mod_wsgi/patches/cross-python.patch

115 lines
4.0 KiB
Diff

--- a/configure.ac
+++ b/configure.ac
@@ -106,26 +106,24 @@
AC_SUBST(PYTHON)
-PYTHON_VERSION=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var("VERSION"))'`
-
-PYTHON_LDVERSION=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var("LDVERSION") or "")'`
+if test x"${PYTHON_VERSION}" = x""; then
+ PYTHON_VERSION=`${PYTHON} -c 'from sys import stdout; \
+ import sysconfig; \
+ stdout.write(sysconfig.get_config_var("VERSION"))'`
+fi
+
+if test x"${PYTHON_LDVERSION}" = x""; then
+ PYTHON_LDVERSION=`${PYTHON} -c 'from sys import stdout; \
+ import sysconfig; \
+ stdout.write(sysconfig.get_config_var("LDVERSION") or "")'`
+fi
if test x"${PYTHON_LDVERSION}" = x""; then
PYTHON_LDVERSION=${PYTHON_VERSION}
fi
-CPPFLAGS1=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write("-I" + sysconfig.get_config_var("INCLUDEPY"))'`
-
-CPPFLAGS2=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(" ".join(filter(lambda x: x.startswith("-D"), \
- sysconfig.get_config_var("CFLAGS").split())))'`
+CPPFLAGS1=$($PYTHON-config --includes)
+CPPFLAGS2=$($PYTHON-config --cflags | tr ' \t' '\n\n' | grep '^-D' | tr '\n' ' ')
if test "${ENABLE_EMBEDDED}" != "yes"; then
CPPFLAGS3="-DMOD_WSGI_DISABLE_EMBEDDED"
@@ -137,70 +135,7 @@
AC_SUBST(CPPFLAGS)
-PYTHONLIBDIR=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var("LIBDIR"))'`
-PYTHONCFGDIR=`${PYTHON} -c 'from sys import stdout; \
- import distutils.sysconfig; \
- stdout.write(distutils.sysconfig.get_python_lib(plat_specific=1, \
- standard_lib=1) +"/config")'`
-PYTHONFRAMEWORKDIR=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORKDIR"))'`
-PYTHONFRAMEWORKPREFIX=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX"))'`
-PYTHONFRAMEWORK=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORK"))'`
-
-if test "${PYTHON_LDVERSION}" != "${PYTHON_VERSION}"; then
- PYTHONCFGDIR="${PYTHONCFGDIR}-${PYTHON_LDVERSION}"
-fi
-
-if test "${PYTHONFRAMEWORKDIR}" = "no-framework" -o \
- "${ENABLE_FRAMEWORK}" != "yes"; then
- if test "${PYTHONLIBDIR}" != "${APXS_LIBDIR}" ; then
- LDFLAGS1="-L${PYTHONLIBDIR}"
- fi
- if test "${PYTHONCFGDIR}" != "${APXS_LIBDIR}" ; then
- LDFLAGS2="-L${PYTHONCFGDIR}"
- fi
-
- LDLIBS1="-lpython${PYTHON_LDVERSION}"
-
- # MacOS X seems to be broken and doesn't use ABIFLAGS suffix
- # so add a check to try and work out what we need to do.
-
- if test -f "${PYTHONLIBDIR}/libpython${PYTHON_VERSION}.a"; then
- LDLIBS1="-lpython${PYTHON_VERSION}"
- fi
-
- if test -f "${PYTHONCFGDIR}/libpython${PYTHON_VERSION}.a"; then
- LDLIBS1="-lpython${PYTHON_VERSION}"
- fi
-
- LDLIBS2=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var("LIBS"))'`
- LDLIBS3=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var("SYSLIBS"))'`
-else
- LDFLAGS1="-Wl,-F${PYTHONFRAMEWORKPREFIX} -framework ${PYTHONFRAMEWORK}"
-
- VERSION="${PYTHON_VERSION}"
- STRING="${PYTHONFRAMEWORKDIR}/Versions/${VERSION}/${PYTHONFRAMEWORK}"
- LDFLAGS2=`${PYTHON} -c "from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var(
- \"LINKFORSHARED\").replace(\"${STRING}\", ''))" | \
- sed -e 's/-Wl,-stack_size,[[0-9]]*//'`
-
- LDLIBS1=`${PYTHON} -c 'from sys import stdout; \
- import sysconfig; \
- stdout.write(sysconfig.get_config_var("LIBS"))'`
-fi
+LDLIBS1=$($PYTHON-config --ldflags --embed)
CFLAGS1=""
for arg in ${CFLAGS}