summaryrefslogtreecommitdiffstats
path: root/patches/gpsd-2.39/generic/configure_ac-fix-python.diff
diff options
context:
space:
mode:
Diffstat (limited to 'patches/gpsd-2.39/generic/configure_ac-fix-python.diff')
-rw-r--r--patches/gpsd-2.39/generic/configure_ac-fix-python.diff104
1 files changed, 104 insertions, 0 deletions
diff --git a/patches/gpsd-2.39/generic/configure_ac-fix-python.diff b/patches/gpsd-2.39/generic/configure_ac-fix-python.diff
new file mode 100644
index 000000000..121093e60
--- /dev/null
+++ b/patches/gpsd-2.39/generic/configure_ac-fix-python.diff
@@ -0,0 +1,104 @@
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Subject: just rely on AM_PATH_PYTHON to work propperly
+
+remove hand crafted python detection and detection of
+PYTHON_LIBS and PYTHON_CFLAGS, they are not used anyway.
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+
+---
+ configure.ac | 77 +++--------------------------------------------------------
+ 1 file changed, 5 insertions(+), 72 deletions(-)
+
+Index: gpsd-2.39/configure.ac
+===================================================================
+--- gpsd-2.39.orig/configure.ac
++++ gpsd-2.39/configure.ac
+@@ -27,82 +27,15 @@ ACREQUIRE_BUGFIX
+ # ACREQUIRE_BUGFIX done
+
+ AC_ARG_ENABLE(python,
+- AC_HELP_STRING([--disable-python],
++ AS_HELP_STRING([--disable-python],
+ [disable python scripts and library bindings]),
+ [try_python="$enableval"], [try_python="yes"])
+-if test "x$try_python" = "xyes"; then
+- AM_PATH_PYTHON
+- ac_python=yes
+- if test "x$PYTHON" = "x"; then
+- AC_PATH_PROG(PYTHON, python, none)
+- fi
+-
+- if test "x$PYTHON" = "xnone"; then
+- AC_MSG_WARN([*** Python interpreter not found, Python support disabled.])
+- ac_python=no
+- fi
+-
+- if test "x$ac_python" = "xyes"; then
+- AC_MSG_CHECKING(Python version and location)
+- PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
+- PYTHON_VERSION_MAJOR=[`$PYTHON -c "import sys; print '%d' % (sys.version_info[0]);"`]
+- PYTHON_VERSION_MINOR=[`$PYTHON -c "import sys; print '%d' % (sys.version_info[1]);"`]
+- PYTHON_VERSION="${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
+- AC_MSG_RESULT([$PYTHON, $PYTHON_VERSION, $PYTHON_PREFIX])
+-
+- AC_MSG_CHECKING(whether Python is at least 2.4)
+- if test $PYTHON_VERSION_MAJOR -lt 2 -o $PYTHON_VERSION_MAJOR -eq 2 -a $PYTHON_VERSION_MINOR -lt 3; then
+- AC_MSG_RESULT(no)
+- AC_MSG_WARN([*** GPSD requires at least Python 2.3, Python support disabled.])
+- ac_python=no
+- fi
+- if test "x$ac_python" = "xyes"; then
+- AC_MSG_RESULT(yes)
+
+- PYTHON_CFLAGS="-DHAVE_PYTHON -I$PYTHON_PREFIX/include/python$PYTHON_VERSION"
+-
+- OLD_CPPFLAGS="$CPPFLAGS"
+- OLD_CXXFLAGS="$CXXFLAGS"
+- CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
+- CXXFLAGS="$CXXFLAGS $PYTHON_CFLAGS"
+-
+- AC_CHECK_HEADERS([Python.h],
+- [],
+- [AC_MSG_WARN([*** Python include files not found! You should install the Python development package. Python support disabled]); ac_python=no])
+- CPPFLAGS="$OLD_CPPFLAGS"
+- CXXFLAGS="$OLD_CXXFLAGS"
+-
+- if test "x$ac_python" = "xyes"; then
+- AC_SUBST([PYTHON_CFLAGS])
+-
+- ac_python=no
+- for pylibpath in '/usr/lib' $PYTHON_PREFIX/lib $PYTHON_PREFIX/lib/python$PYTHON_VERSION/config; do
+- eval `echo unset ac_cv_lib_python$PYTHON_VERSION'___'Py_Finalize | tr '.' '_'`
+-
+- save_LIBS=$LIBS
+- LIBS="$LIBS -L$pylibpath $PYTHON_LIBS"
+- AC_CHECK_LIB(python$PYTHON_VERSION, Py_Finalize, PYTHON_LIBS="-L$pylibpath -lpython$PYTHON_VERSION $PYTHON_DEPS"; ac_python=yes,,$PYTHON_DEPS)
+- LIBS=$save_LIBS
+- if test "x$ac_python" = "xyes"; then
+- break
+- fi
+- done
+-
+- if test "x$ac_python" != "xyes"; then
+- AC_MSG_WARN(*** Python development libraries required, Python support disabled)
+- fi
+- AC_SUBST([PYTHON_LIBS])
+-
+- AC_SUBST(pkgpythondir)
+- if test "x$python_install" = "xyes"; then
+- pkgpythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION"/site-packages/gpsd"
+- fi
+-
+- fi
+- fi
+- fi
++if test "x$try_python" = "xyes"; then
++ AM_PATH_PYTHON([2.4], [have_python=yes], [have_python=no])
+ fi
+-AM_CONDITIONAL([HAVE_PYTHON], [test x"$ac_python" = xyes])
++
++AM_CONDITIONAL([HAVE_PYTHON], [test "${have_python}" = "yes"])
+
+ AC_PROG_LN_S
+ AC_PROG_MAKE_SET