diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-05-24 17:48:36 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-05-24 17:48:36 +0100 |
commit | e9feba0f7b3a2b67fd56154185e92eab4b932468 (patch) | |
tree | 5d84b7188ef8077d5583593c724c490757de83b8 | |
parent | d6962024d7686e40cc012905581cb31c6999b856 (diff) | |
download | dbus-python-e9feba0f7b3a2b67fd56154185e92eab4b932468.tar.gz |
Let the user set PYTHON_INCLUDES on the configure command line
This might be useful for cross-compilation or other strange setups.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21017
-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) |