fi
])
- if test "$cross_compiling" = "no" -a -z "$PYTHON_CFLAGS"; then
+ AC_CHECK_PROGS(PYTHON_CONFIG, python-config, no)
+
+ if test -z "$PYTHON_CFLAGS" -a "$PYTHON_CONFIG" != "no"; then
+ # Clean out junk: http://bugs.python.org/issue3290
+ # Python headers may need some -f* flags, leave them in.
+ PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags | sed -e 's/ -\(W\|D\|O\)\(\w\|-\)\+//g'`
+ PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags`
+ fi
+
+ if test -z "$PYTHON_CFLAGS" -a "$cross_compiling" = "no"; then
changequote(<<, >>)#dnl
# alternatively, for python >= 2.0
# 'import sys, distutils.sysconfig; sys.stdout.write (distutils.sysconfig.get_python_inc ())'
changequote([, ])#dnl
fi
- if test "$cross_compiling" = "yes" -a -z "$PYTHON_CFLAGS"; then
- PYTHON_CFLAGS=`python-config --cflags`
- PYTHON_LDFLAGS=`python-config --ldflags`
- fi
-
if test -z "$PYTHON_HEADER"; then
CPPFLAGS="$PYTHON_CFLAGS $CPPFLAGS"
AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])