Commit de063908 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[trac710] Check if we need -Wno-unused-parameter for Python.h

parent f3813c74
......@@ -184,6 +184,30 @@ CPPFLAGS="$CPPFLAGS ${PYTHON_INCLUDES}"
AC_CHECK_HEADERS([Python.h],, AC_MSG_ERROR([Missing Python.h]))
CPPFLAGS="$CPPFLAGS_SAVED"
# Python 3.2 has an unused parameter in one of its headers. This
# has been reported, but not fixed as of yet, so we check if we need
# to set -Wno-unused-parameter.
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS ${PYTHON_INCLUDES} -Wall -Wextra -Werror"
AC_MSG_CHECKING([whether we need -Wno-unused-parameter for python])
AC_TRY_COMPILE(
[#include <Python.h>],
[],
[AC_MSG_RESULT(no)],
[
CPPFLAGS="$CPPFLAGS -Wno-unused-parameter"
AC_TRY_COMPILE([#include <Python.h>],
[],
[AC_MSG_RESULT(yes)
PYTHON_INCLUDES="${PYTHON_INCLUDES} -Wno-unused-parameter"
AC_SUBST(PYTHON_INCLUDES)
],
[AC_MSG_ERROR([Can't compile against Python.h])]
)
]
)
CPPFLAGS="$CPPFLAGS_SAVED"
# Check for python library. Needed for Python-wrapper libraries.
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment