From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH] build-sys: simplify python detection
Date: Sun, 29 Sep 2013 10:51:13 +0100 [thread overview]
Message-ID: <1380448273-13445-1-git-send-email-kerolasa@iki.fi> (raw)
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>
---
configure.ac | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index 553228a..1f02bd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1386,20 +1386,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])
@@ -1541,7 +1535,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}
--
1.8.4
next reply other threads:[~2013-09-29 9:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-29 9:51 Sami Kerola [this message]
2013-09-30 12:05 ` [PATCH] build-sys: simplify python detection Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380448273-13445-1-git-send-email-kerolasa@iki.fi \
--to=kerolasa@iki.fi \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox