File: 04_autoconf_python_multiarch.patch

package info (click to toggle)
libapache2-mod-python 3.3.1-11
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 3,212 kB
  • ctags: 2,284
  • sloc: python: 7,278; ansic: 6,556; lex: 246; makefile: 234; sh: 153
file content (70 lines) | stat: -rw-r--r-- 2,818 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Description: Drop custom Python detection and use pkg-config instead.
 Drop custom Python detection and use pkg-config instead. This fixes
 FTBFS due to multiarch include paths. Not sure if this should be
 fowrarded or not 
 (see https://lists.ubuntu.com/archives/ubuntu-devel/2013-January/036291.html)
Author: Robie Basak <robie.basak@canonical.com>
Bug-Ubuntu: https://launchpad.net/bugs/1098597
Forwarded: no

--- a/configure.in
+++ b/configure.in
@@ -223,39 +223,9 @@ AC_MSG_RESULT($PY_STD_LIB)
 # set python std library variable
 AC_SUBST(LIBS)
 
-PyLIBP=${PY_STD_LIB}
-PyLIBPL=${PyLIBP}/config
-PyPYTHONLIBS=${PyLIBPL}/libpython${PyVERSION}.a
-PyLIBS=`grep "^LIB[[SMC]]=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' '   '`
-PyMODLIBS=`grep "^LOCALMODLIBS=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' '   '`
-PyFRAMEWORK=`grep "^PYTHONFRAMEWORK=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' '   '`
-PyFRAMEWORKDIR=`grep "^PYTHONFRAMEWORKDIR=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' '   ' | awk '{print $1}'`
-
-save_LDFLAGS="$LDFLAGS"
-save_LIBS="$LIBS"
-if test "$PyFRAMEWORKDIR" != "no-framework"; then
-  if test -n "$PyFRAMEWORK"; then
-    PyPYTHONLIBS="-framework $PyFRAMEWORK"
-    LDFLAGS="${LDFLAGS} -Wl,-framework,Python"
-  fi
-else
-  LDFLAGS="${LDFLAGS} -L${PyLIBPL}"
-  AC_CHECK_LIB(python${PyVERSION}, Py_NewInterpreter,
-             [ PyPYTHONLIBS="-lpython${PyVERSION}" ],
-             [ LDFLAGS="$save_LDFLAGS"
-               if test -f ${PyLIBPL}/libpython${PyVERSION}.a; then
-                  PyPYTHONLIBS=${PyLIBPL}/libpython${PyVERSION}.a
-               else
-                  AC_ERROR(Can not link to python)
-               fi
-              ], 
-              [ ${PyLIBS} ${PyMODLIBS} ] )
-fi
-LIBS="$save_LIBS"
-
 # (actually this check already just happened above)
 AC_MSG_CHECKING(what libraries Python was linked with) 
-PY_LIBS="${PyPYTHONLIBS} ${PyLIBS} ${PyMODLIBS}"
+PY_LIBS=`${PYTHON_BIN}-config --libs`
  
 ## XXX this is a small work around for a weird RedHat problem
 ## erase -lieee from library list
@@ -268,15 +238,13 @@ AC_MSG_RESULT($PY_LIBS)
 
 AC_MSG_CHECKING(linker flags used to link Python)
 AC_SUBST(LDFLAGS)
-PyLFS=`grep "^LINKFORSHARED=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' '   '`
-PyLDFLAGS=`grep "^LDFLAGS=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' '   '`
-LDFLAGS="${LDFLAGS} ${PyLFS} ${PyLDFLAGS}"
+PY_LDFLAGS=`${PYTHON_BIN}-config --ldflags`
 LDFLAGS="${LDFLAGS} ${PY_LDFLAGS}"
 AC_MSG_RESULT($PY_LDFLAGS)
 
 AC_MSG_CHECKING(where Python include files are)
 AC_SUBST(INCLUDES)
-PY_INCLUDES="-I${PyEXEC_INSTALLDIR}/include/python${PyVERSION}"
+PY_INCLUDES=`${PYTHON_BIN}-config --includes`
 INCLUDES="${INCLUDES} ${AP_INCLUDES} ${PY_INCLUDES}"
 AC_MSG_RESULT($PY_INCLUDES)