diff options
author | Peter Johnson <peter@tortall.net> | 2007-09-13 02:53:30 +0000 |
---|---|---|
committer | Peter Johnson <peter@tortall.net> | 2007-09-13 02:53:30 +0000 |
commit | 121de993202757ac3a5c2517f2aa80ec9816fd4d (patch) | |
tree | 4b002a0b6aa5a577a0f79b7cb16103444720bfd0 /configure.ac | |
parent | e19fd3ce2bdeb9ed0c7abf459f066af47e331dad (diff) | |
download | yasm-121de993202757ac3a5c2517f2aa80ec9816fd4d.tar.gz |
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
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 5aef29b8..8fa4b4d2 100644 --- a/configure.ac +++ b/configure.ac @@ -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 |