diff options
author | Karel Zak | 2014-06-04 13:43:15 +0200 |
---|---|---|
committer | Karel Zak | 2014-06-04 13:43:15 +0200 |
commit | 4c54effbf709701fca7d88b2d36bfc8f4cd7f497 (patch) | |
tree | 47bc00aa671ba4ca1fdecc20cf042b78f32caa27 /configure.ac | |
parent | build-sys: add --enable-pylibmount (diff) | |
download | kernel-qcow2-util-linux-4c54effbf709701fca7d88b2d36bfc8f4cd7f497.tar.gz kernel-qcow2-util-linux-4c54effbf709701fca7d88b2d36bfc8f4cd7f497.tar.xz kernel-qcow2-util-linux-4c54effbf709701fca7d88b2d36bfc8f4cd7f497.zip |
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 <kzak@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 8 insertions, 5 deletions
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]) ]) |