diff options
author | Simon McVittie <smcv@debian.org> | 2011-05-25 12:50:52 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2011-05-25 12:50:52 +0100 |
commit | 3603487b16fb81552a6139f0a430fbaaec89cf22 (patch) | |
tree | 0f96c77d20fad73fd77c2590734b1269bc17f4a6 /m4/am-check-python-headers.m4 | |
parent | d10d46a9bdc8ed6daf63b8018f5365dbb741d324 (diff) |
Imported Upstream version 0.84.0
Diffstat (limited to 'm4/am-check-python-headers.m4')
-rw-r--r-- | m4/am-check-python-headers.m4 | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/m4/am-check-python-headers.m4 b/m4/am-check-python-headers.m4 index 92ea204..513abae 100644 --- a/m4/am-check-python-headers.m4 +++ b/m4/am-check-python-headers.m4 @@ -3,22 +3,28 @@ dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) dnl function also defines PYTHON_INCLUDES AC_DEFUN([AM_CHECK_PYTHON_HEADERS], [AC_REQUIRE([AM_PATH_PYTHON]) -dnl deduce PYTHON_INCLUDES -AC_MSG_CHECKING(for Python headers using $PYTHON-config --includes) -PYTHON_INCLUDES=`$PYTHON-config --includes` -if test $? = 0; then - AC_MSG_RESULT($PYTHON_INCLUDES) +AC_ARG_VAR([PYTHON_INCLUDES], [CPPFLAGS for Python, overriding output of python2.x-config --includes, e.g. "-I/opt/misc/include/python2.7"]) + +if test "${PYTHON_INCLUDES+set}" = set; then + AC_MSG_NOTICE([PYTHON_INCLUDES overridden to: $PYTHON_INCLUDES]) else - AC_MSG_RESULT([failed, will try another way]) - py_prefix=`$PYTHON -c "import sys; print sys.prefix"` - py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` - AC_MSG_CHECKING(for Python headers in $py_prefix and $py_exec_prefix) - PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" - if test "$py_prefix" != "$py_exec_prefix"; then - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + dnl deduce PYTHON_INCLUDES + AC_MSG_CHECKING(for Python headers using $PYTHON-config --includes) + PYTHON_INCLUDES=`$PYTHON-config --includes` + if test $? = 0; then + AC_MSG_RESULT($PYTHON_INCLUDES) + else + AC_MSG_RESULT([failed, will try another way]) + py_prefix=`$PYTHON -c "import sys; print sys.prefix"` + py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` + AC_MSG_CHECKING(for Python headers in $py_prefix and $py_exec_prefix) + PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" + if test "$py_prefix" != "$py_exec_prefix"; then + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" + fi + AC_MSG_RESULT($PYTHON_INCLUDES) fi - AC_MSG_RESULT($PYTHON_INCLUDES) fi AC_MSG_CHECKING(whether those headers are sufficient) |