Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From 855cc20bafa30597ae7a62f7672d42654b25cde0 Mon Sep 17 00:00:00 2001 |
| 2 | From: Herrie <github.com@herrie.org> |
| 3 | Date: Mon, 24 Jul 2017 21:30:16 +0200 |
| 4 | Subject: [PATCH] Use pkg-config instead of ${PYTHON}-config to find python |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 5 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 6 | --- |
| 7 | configure.ac | 21 ++++++++------------- |
| 8 | 1 file changed, 8 insertions(+), 13 deletions(-) |
| 9 | |
| 10 | diff --git a/configure.ac b/configure.ac |
| 11 | index d20a18e..c741829 100644 |
| 12 | --- a/configure.ac |
| 13 | +++ b/configure.ac |
| 14 | @@ -1567,20 +1567,15 @@ AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes") |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 15 | dnl Check for Python headers (currently useful only for libgnt) |
| 16 | dnl (Thanks to XChat) |
| 17 | if test "x$enable_consoleui" = "xyes" -a ! -z "$PYTHON" -a x"$PYTHON" != x"no" ; then |
| 18 | - AC_MSG_CHECKING(for Python compile flags) |
| 19 | - if test -f ${PYTHON}-config; then |
| 20 | - PY_CFLAGS=`${PYTHON}-config --includes` |
| 21 | - PY_LIBS=`${PYTHON}-config --libs` |
| 22 | - AC_DEFINE(USE_PYTHON, [1], [Define if python headers are available.]) |
| 23 | - AC_MSG_RESULT(ok) |
| 24 | - else |
| 25 | - AC_MSG_RESULT([Cannot find ${PYTHON}-config]) |
| 26 | - PY_CFLAGS="" |
| 27 | - PY_LIBS="" |
| 28 | - fi |
| 29 | + AC_MSG_CHECKING(for Python compile flags) |
| 30 | + PKG_CHECK_MODULES(PY, python, [ |
| 31 | + AC_SUBST(PY_CFLAGS) |
| 32 | + AC_SUBST(PY_LIBS) |
| 33 | + ], [ |
| 34 | + AC_MSG_RESULT(no) |
| 35 | + AC_MSG_ERROR([Can't find python]) |
| 36 | + ]) |
| 37 | fi |
| 38 | -AC_SUBST(PY_CFLAGS) |
| 39 | -AC_SUBST(PY_LIBS) |
| 40 | |
| 41 | dnl ####################################################################### |
| 42 | dnl # Check for Mono support |