summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2015-12-04 17:31:44 +0000
committerSimon McVittie <smcv@debian.org>2015-12-05 14:50:18 +0000
commit8d794193c8ac611f27d32333d50873d4d97aace0 (patch)
treec13db4d19d776a9b8acaae9cbde5edf846446f2c /m4
parent6ebbb5bc7abaf3caaa88cc11f6d3969e3f665544 (diff)
Try ${PYTHON}-config before searching PATH
This is helpful for Debian's special debug-build interpreters such as python3.4-dbg, each with an accompanying python3.4-dbg-config.
Diffstat (limited to 'm4')
-rw-r--r--m4/am-check-python-headers.m419
1 files changed, 15 insertions, 4 deletions
diff --git a/m4/am-check-python-headers.m4 b/m4/am-check-python-headers.m4
index 509a9c2..c903920 100644
--- a/m4/am-check-python-headers.m4
+++ b/m4/am-check-python-headers.m4
@@ -4,10 +4,21 @@ dnl function also defines PYTHON_INCLUDES
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
-AC_PATH_PROGS([PYTHON_CONFIG], [python${PYTHON_VERSION}-config python-config], [no])
-if test "${PYTHON_CONFIG}" = "no"; then
- AC_MSG_ERROR([cannot find python${PYTHON_VERSION}-config or python-config in PATH])
-fi
+AC_ARG_VAR([PYTHON_CONFIG], [python-config executable])
+AS_IF(
+ [test "${PYTHON_CONFIG+set}" = set],
+ [AC_MSG_NOTICE([PYTHON_CONFIG overridden to: $PYTHON_CONFIG])],
+ [test -x "${PYTHON}-config"],
+ [
+ PYTHON_CONFIG="${PYTHON}-config"
+ AC_MSG_NOTICE([Using \$PYTHON-config: $PYTHON_CONFIG])
+ ],
+ dnl else
+ [
+ AC_PATH_PROGS([PYTHON_CONFIG], [python${PYTHON_VERSION}-config python-config], [no])
+ AS_IF([test "${PYTHON_CONFIG}" = "no"],
+ [AC_MSG_ERROR([cannot find python${PYTHON_VERSION}-config or python-config in PATH])])
+ ])
AC_ARG_VAR([PYTHON_INCLUDES], [CPPFLAGS for Python, overriding output of python2.x-config --includes, e.g. "-I/opt/misc/include/python2.7"])