summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorSami Kerola2013-09-29 11:51:13 +0200
committerKarel Zak2013-09-30 13:41:09 +0200
commit0b567ae5507f8e990452024ffe561457203b627b (patch)
tree514bba65916d798633d064e887dde16ee021f93a /configure.ac
parentclean up term lib handling (diff)
downloadkernel-qcow2-util-linux-0b567ae5507f8e990452024ffe561457203b627b.tar.gz
kernel-qcow2-util-linux-0b567ae5507f8e990452024ffe561457203b627b.tar.xz
kernel-qcow2-util-linux-0b567ae5507f8e990452024ffe561457203b627b.zip
build-sys: simplify python detection
This allows './configure --enable-most-builds' and 'make distcheck' to work when both python2 and python3 are installed, and user has set python version preference using symlink and PATH order. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 7 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index c7c66bcd8..cbcda46c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1421,20 +1421,14 @@ 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".
- pymajor="2"
- modname="python"
- AS_IF([test "x$withval" != xno -a "x$withval" != xyes], [
- pymajor="$withval"
- modname="python${pymajor}"
- ])
- PKG_CHECK_MODULES(PYTHON,[${modname} >= $pymajor],
- [have_python=yes
- AM_PATH_PYTHON([$pymajor])],
- [have_python=no])
+ AS_IF([test "x$withval" != xno -a "x$withval" != xyes],
+ [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])]
)
+ PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION])
UL_BUILD_INIT([pylibmount], [check])
UL_REQUIRES_HAVE([pylibmount], [python], [libpython])
@@ -1576,7 +1570,8 @@ AC_MSG_RESULT([
ldflags: ${LDFLAGS}
suid ldflags: ${SUID_LDFLAGS}
- Python: ${PYTHON_VERSION}
+ Python: ${PYTHON}
+ Python version: ${PYTHON_VERSION}
Python libs: ${pyexecdir}
Bash completions: ${with_bashcompletiondir}