1
Description: Drop custom Python detection and use pkg-config instead.
2
Drop custom Python detection and use pkg-config instead. This fixes
3
FTBFS due to multiarch include paths. Not sure if this should be
5
(see https://lists.ubuntu.com/archives/ubuntu-devel/2013-January/036291.html)
6
Author: Robie Basak <robie.basak@canonical.com>
7
Bug-Ubuntu: https://launchpad.net/bugs/1098597
12
@@ -223,39 +223,9 @@ AC_MSG_RESULT($PY_STD_LIB)
13
# set python std library variable
17
-PyLIBPL=${PyLIBP}/config
18
-PyPYTHONLIBS=${PyLIBPL}/libpython${PyVERSION}.a
19
-PyLIBS=`grep "^LIB[[SMC]]=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
20
-PyMODLIBS=`grep "^LOCALMODLIBS=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
21
-PyFRAMEWORK=`grep "^PYTHONFRAMEWORK=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
22
-PyFRAMEWORKDIR=`grep "^PYTHONFRAMEWORKDIR=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' ' | awk '{print $1}'`
24
-save_LDFLAGS="$LDFLAGS"
26
-if test "$PyFRAMEWORKDIR" != "no-framework"; then
27
- if test -n "$PyFRAMEWORK"; then
28
- PyPYTHONLIBS="-framework $PyFRAMEWORK"
29
- LDFLAGS="${LDFLAGS} -Wl,-framework,Python"
32
- LDFLAGS="${LDFLAGS} -L${PyLIBPL}"
33
- AC_CHECK_LIB(python${PyVERSION}, Py_NewInterpreter,
34
- [ PyPYTHONLIBS="-lpython${PyVERSION}" ],
35
- [ LDFLAGS="$save_LDFLAGS"
36
- if test -f ${PyLIBPL}/libpython${PyVERSION}.a; then
37
- PyPYTHONLIBS=${PyLIBPL}/libpython${PyVERSION}.a
39
- AC_ERROR(Can not link to python)
42
- [ ${PyLIBS} ${PyMODLIBS} ] )
46
# (actually this check already just happened above)
47
AC_MSG_CHECKING(what libraries Python was linked with)
48
-PY_LIBS="${PyPYTHONLIBS} ${PyLIBS} ${PyMODLIBS}"
49
+PY_LIBS=`${PYTHON_BIN}-config --libs`
51
## XXX this is a small work around for a weird RedHat problem
52
## erase -lieee from library list
53
@@ -268,15 +238,13 @@ AC_MSG_RESULT($PY_LIBS)
55
AC_MSG_CHECKING(linker flags used to link Python)
57
-PyLFS=`grep "^LINKFORSHARED=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
58
-PyLDFLAGS=`grep "^LDFLAGS=" ${PyLIBPL}/Makefile | cut -f2 -d= | tr '\011\012\015' ' '`
59
-LDFLAGS="${LDFLAGS} ${PyLFS} ${PyLDFLAGS}"
60
+PY_LDFLAGS=`${PYTHON_BIN}-config --ldflags`
61
LDFLAGS="${LDFLAGS} ${PY_LDFLAGS}"
62
AC_MSG_RESULT($PY_LDFLAGS)
64
AC_MSG_CHECKING(where Python include files are)
66
-PY_INCLUDES="-I${PyEXEC_INSTALLDIR}/include/python${PyVERSION}"
67
+PY_INCLUDES=`${PYTHON_BIN}-config --includes`
68
INCLUDES="${INCLUDES} ${AP_INCLUDES} ${PY_INCLUDES}"
69
AC_MSG_RESULT($PY_INCLUDES)