Now that part of the build uses just Python, break apart the Python

and Pyrex (only required for bindings) checks.

svn path=/trunk/yasm/; revision=1948
multiarch^2
Peter Johnson 18 years ago
parent e19fd3ce2b
commit 121de99320
  1. 48
      configure.ac
  2. 2
      tools/python-yasm/Makefile.inc

@ -54,13 +54,21 @@ AC_HELP_STRING([--enable-gcov],[Enable gcov code coverage (requires GCC)]),
esac])
AC_ARG_ENABLE(python,
AC_HELP_STRING([--enable-python],[Build Python bindings]),
AC_HELP_STRING([--enable-python],[Enable Python-requiring portions of build]),
[case "${enableval}" in
yes) enable_python="yes" ;;
no) enable_python="no" ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-python]) ;;
esac], enable_python="auto")
AC_ARG_ENABLE(python-bindings,
AC_HELP_STRING([--enable-python-bindings],[Build Python bindings]),
[case "${enableval}" in
yes) enable_python_bindings="yes" ;;
no) enable_python_bindings="no" ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-python-bindings]) ;;
esac], enable_python_bindings="auto")
#
# Checks for programs.
#
@ -245,18 +253,37 @@ AC_SUBST(CCLD_FOR_BUILD)
HOST_CC="$CC_FOR_BUILD"
AC_SUBST(HOST_CC)
# Detect if we can build Python bindings
# (needs Python, Python headers, and Pyrex)
# Detect if we have Python
if test x$enable_python = xno; then
have_python=no
else
AC_MSG_NOTICE([Checking to see if we can build Python bindings])
AC_MSG_NOTICE([Checking for Python])
have_python=no
AM_PATH_PYTHON(2.4,[],[AC_MSG_WARN([Python not found])])
if test -z "$PYTHON" || test "$PYTHON" = : ; then
have_python=no
else
have_python=yes
fi
if test x$have_python = xno ; then
if test x$enable_python = xyes ; then
AC_MSG_ERROR([Python explicitly requested, but a suitable Python version was not found])
else
AC_MSG_WARN([Could not find a suitable version of Python])
fi
fi
fi
# Detect if we can build Python bindings
# (needs Python, Python headers, and Pyrex)
if test x$enable_python_bindings = xno; then
have_python_bindings=no
else
AC_MSG_NOTICE([Checking to see if we can build Python bindings])
have_python_bindings=no
if test x$have_python = xyes; then
AC_MSG_CHECKING([for Pyrex >= 0.9.5.1])
PYREX_CHECK_VERSION(0.9.5.1, [AC_MSG_RESULT(yes)
have_pyrex=yes],
@ -265,21 +292,22 @@ else
AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
have_python=yes
if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
have_python_bindings=yes
fi
fi
if test x$have_python = xno ; then
if test x$enable_python = xyes ; then
AC_MSG_ERROR([Building Python explicitly requested, but can't build Python bindings because either Pyrex, Python headers or a suitable Python version was not found])
if test x$have_python_bindings = xno ; then
if test x$enable_python_bindings = xyes ; then
AC_MSG_ERROR([Building Python bindings explicitly requested, but can't build Python bindings because either Pyrex, Python headers or a suitable Python version was not found])
else
AC_MSG_WARN([Couldn't find either Pyrex, the Python headers or a suitable version of Python, not building Python bindings])
fi
fi
fi
fi
AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
AM_CONDITIONAL(HAVE_PYTHON_BINDINGS, test x$have_python_bindings = xyes)
AC_CONFIG_FILES([Makefile
po/Makefile.in

@ -20,7 +20,7 @@ EXTRA_DIST += tools/python-yasm/setup.py
EXTRA_DIST += tools/python-yasm/yasm.pyx
EXTRA_DIST += $(PYBINDING_DEPS)
if HAVE_PYTHON
if HAVE_PYTHON_BINDINGS
# Use Pyxelator to generate Pyrex function headers.
_yasm.pxi: ${HEADERS}

Loading…
Cancel
Save