-case "$build" in
-*mingw*)
- # We currently hardcode the paths to the Python 3.2 default install
- # location as there's no 'python-config' script on Windows, it seems.
- AC_MSG_WARN([using hardcoded Python3 configuration on MinGW])
- CPPFLAGS_PYTHON="-I/c/Python32/include"
- LDFLAGS_PYTHON="-L/c/Python32/libs -lpython32"
- ;;
-*)
- # We know that Linux has 'python3-config'.
- # On Darwin, Macports has python3.x-config, fink has python3-config.
- # Mac OS X (Snow Leopard) ships with 'python-config' per default, but
- # that's Python 2.x, so not useful for us.
- # Everything else is untested, we just hope 'PYTHON3_CONFIG' works.
- if test -n "$PYTHON3_CONFIG"; then
- CPPFLAGS_PYTHON="$($PYTHON3_CONFIG --includes)"
- LDFLAGS_PYTHON="$($PYTHON3_CONFIG --ldflags)"
- else
- AC_MSG_ERROR([python3-config not found])
- fi
- ;;
-esac
+pyver="none"
+PKG_CHECK_MODULES([python3], [python3 >= 3.2],
+ [pyver=`$PKG_CONFIG --modversion python3`;
+ CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python3_CFLAGS";
+ LDFLAGS_PYTHON="$LDFLAGS_PYTHON $python3_LIBS"],
+[PKG_CHECK_MODULES([python33], [python-3.3 >= 3.2],
+ [pyver=`$PKG_CONFIG --modversion python-3.3`;
+ CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python33_CFLAGS";
+ LDFLAGS_PYTHON="$LDFLAGS_PYTHON $python33_LIBS"],
+[PKG_CHECK_MODULES([python32], [python-3.2 >= 3.2],
+ [pyver=`$PKG_CONFIG --modversion python-3.2`;
+ CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python32_CFLAGS";
+ LDFLAGS_PYTHON="$LDFLAGS_PYTHON $python32_LIBS"],
+)])])