blob: 312fc8593fa97c09b04d965ef100942c649bf38e [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From 855cc20bafa30597ae7a62f7672d42654b25cde0 Mon Sep 17 00:00:00 2001
2From: Herrie <github.com@herrie.org>
3Date: Mon, 24 Jul 2017 21:30:16 +0200
4Subject: [PATCH] Use pkg-config instead of ${PYTHON}-config to find python
Patrick Williamsb48b7b42016-08-17 15:04:38 -05005
Brad Bishop316dfdd2018-06-25 12:45:53 -04006---
7 configure.ac | 21 ++++++++-------------
8 1 file changed, 8 insertions(+), 13 deletions(-)
9
10diff --git a/configure.ac b/configure.ac
11index 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 Williamsb48b7b42016-08-17 15:04:38 -050015 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