From 4c54effbf709701fca7d88b2d36bfc8f4cd7f497 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 4 Jun 2014 13:43:15 +0200 Subject: build-sys: fix with_python usage, improve logic We have to set the default withval= on the default with_python=check otherwise uninitialized value is used. Signed-off-by: Karel Zak --- configure.ac | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 71a7568a3..e7c6a144d 100644 --- a/configure.ac +++ b/configure.ac @@ -1648,8 +1648,8 @@ AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes] AC_ARG_WITH([python], - AS_HELP_STRING([--without-python], [do not build python bindings, use --with-python={2,3} to force version]), - [], [with_python=check] + AS_HELP_STRING([--without-python], [do not build python bindings, use --with-python={2,3} to force version]), + [], [with_python=check withval=check] ) have_python=no @@ -1658,14 +1658,17 @@ AS_IF([test "x$with_python" != xno], [ # (minimal version is 2) but if major version is explicitly specified by # --with-python=2 or --with-python=3 then we look for PKG module "python2" or # "python3". - AS_IF([test "x$withval" != xno -a "x$withval" != xyes], + AS_IF([test "x$withval" != xno -a "x$withval" != xyes -a "x$withval" != xcheck], [pymajor="$withval"; PYTHON=python${pymajor}], [pymajor="2"]) AM_PATH_PYTHON([$pymajor], [have_python=yes], [have_python=no]) AS_CASE([$with_python:$have_python], [yes:no], - [AC_MSG_ERROR([python selected but libpython not found])] + [AC_MSG_ERROR([python selected but libpython not found])], + [check:no], + [AC_MSG_WARN([libpython not found, do not build python bindings])], + [*:yes], + [PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION])] ) - PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION]) ]) -- cgit v1.2.3-55-g7522