diff --git a/doc/m4/ax_python.m4 b/doc/m4/ax_python.m4 index f9a513591..ebfb8d67e 100644 --- a/doc/m4/ax_python.m4 +++ b/doc/m4/ax_python.m4 @@ -51,7 +51,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 9 +#serial 14 AC_DEFUN([AX_PYTHON], [AC_MSG_CHECKING(for python build information) @@ -61,11 +61,12 @@ AC_CHECK_PROGS(PYTHON_BIN, [$python]) ax_python_bin=$PYTHON_BIN if test x$ax_python_bin != x; then AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no) - AC_CHECK_HEADER([$ax_python_bin/Python.h], - [[ax_python_header=`locate $ax_python_bin/Python.h | sed -e s,/Python.h,,`]], - ax_python_header=no) + if test x$ax_python_lib == xno; then + AC_CHECK_LIB(${ax_python_bin}m, main, ax_python_lib=${ax_python_bin}m, ax_python_lib=no) + fi if test x$ax_python_lib != xno; then - if test x$ax_python_header != xno; then + ax_python_header=`$ax_python_bin -c "from distutils.sysconfig import *; print(get_config_var('CONFINCLUDEPY'))"` + if test x$ax_python_header != x; then break; fi fi diff --git a/m4/ax_python.m4 b/m4/ax_python.m4 index 1bc9d8a20..ebfb8d67e 100644 --- a/m4/ax_python.m4 +++ b/m4/ax_python.m4 @@ -51,21 +51,22 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 9 +#serial 14 AC_DEFUN([AX_PYTHON], [AC_MSG_CHECKING(for python build information) AC_MSG_RESULT([]) -for python in python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do +for python in python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do AC_CHECK_PROGS(PYTHON_BIN, [$python]) ax_python_bin=$PYTHON_BIN if test x$ax_python_bin != x; then AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no) - AC_CHECK_HEADER([$ax_python_bin/Python.h], - [[ax_python_header=`locate $ax_python_bin/Python.h | sed -e s,/Python.h,,`]], - ax_python_header=no) - if test $ax_python_lib != no; then - if test $ax_python_header != no; then + if test x$ax_python_lib == xno; then + AC_CHECK_LIB(${ax_python_bin}m, main, ax_python_lib=${ax_python_bin}m, ax_python_lib=no) + fi + if test x$ax_python_lib != xno; then + ax_python_header=`$ax_python_bin -c "from distutils.sysconfig import *; print(get_config_var('CONFINCLUDEPY'))"` + if test x$ax_python_header != x; then break; fi fi