aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-10-17 08:05:04 +0000
committerWerner Koch <[email protected]>2018-10-17 08:05:35 +0000
commitff6ff616aea6f59b7f2ce1176492850ecdf3851e (patch)
tree3faf53a722322607371d9ce372cc1ca090f42e54 /configure.ac
parentcore: Really remove CR from version output. (diff)
downloadgpgme-ff6ff616aea6f59b7f2ce1176492850ecdf3851e.tar.gz
gpgme-ff6ff616aea6f59b7f2ce1176492850ecdf3851e.zip
python: Auto-check for all installed python versions.
* m4/python.m4 (AM_PATH_PYTHON): Add a 4th arg. * configure.ac (available_languages): Remove separate python2 and python3 and keep just python. Simplify test for pythons. Use an explicit list of python versions to test. -- This seems to be a starightforward chnage to support more than two python versions. I am not sure why we had that complicated thing before. On my box I get builds and run tests for 2.7, 3.4 and 3.5. If 3.6, 3.7 or 3.8 are installed they should also work. GnuPG-bug-id: 3354 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac44
1 files changed, 10 insertions, 34 deletions
diff --git a/configure.ac b/configure.ac
index e0823f5f..728445df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,7 +180,7 @@ have_w64_system=no
have_macos_system=no
build_w32_glib=no
build_w32_qt=no
-available_languages="cl cpp python python2 python3 qt"
+available_languages="cl cpp python qt"
default_languages="cl cpp python qt"
case "${host}" in
x86_64-*mingw32*)
@@ -375,13 +375,9 @@ fi
AC_SUBST(HAVE_DOT)
# Python bindings.
-LIST_MEMBER("python2", $enabled_languages)
-found_py2=$found
-LIST_MEMBER("python3", $enabled_languages)
-found_py3=$found
LIST_MEMBER("python", $enabled_languages)
found_py=$found
-if test "$found_py" = "1" -o "$found_py2" = "1" -o "$found_py3" = "1"; then
+if test "$found_py" = "1"; then
AX_PKG_SWIG
if test -z "$SWIG"; then
if test "$explicit_languages" = "1"; then
@@ -393,36 +389,15 @@ if test "$found_py" = "1" -o "$found_py2" = "1" -o "$found_py3" = "1"; then
enabled_languages=$(echo $enabled_languages | sed 's/python//')
fi
else
- # Reset all the stuff, just to be sure.
+ # Reset the version collecting vars.
PYTHONS=
PYTHON_VERSIONS=
- unset PYTHON
- unset PYTHON_VERSION
- unset PYTHON_CPPFLAGS
- unset PYTHON_LDFLAGS
- unset PYTHON_SITE_PKG
- unset PYTHON_EXTRA_LIBS
- unset PYTHON_EXTRA_LDFLAGS
- unset ac_cv_path_PYTHON
- unset am_cv_pathless_PYTHON
- unset am_cv_python_version
- unset am_cv_python_platform
- unset am_cv_python_pythondir
- unset am_cv_python_pyexecdir
-
- if test "$found_py" = "1" -o "$found_py2" = "1"; then
- AM_PATH_PYTHON([2.7], [
- AX_PYTHON_DEVEL
- if test "$PYTHON_VERSION"; then
- PYTHONS="$(echo $PYTHONS $PYTHON)"
- PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
- fi
- ], :)
- fi
if test "$found_py" = "1" -o "$found_py3" = "1"; then
- # Reset everything, so that we can look for another Python.
- unset PYTHON
+ # Reset everything, so that we can look for another Python.
+ m4_foreach([mym4pythonver],
+ [[2.7],[3.4],[3.5],[3.6],[3.7],[3.8],[all]],
+ [unset PYTHON
unset PYTHON_VERSION
unset PYTHON_CPPFLAGS
unset PYTHON_LDFLAGS
@@ -435,13 +410,14 @@ if test "$found_py" = "1" -o "$found_py2" = "1" -o "$found_py3" = "1"; then
unset am_cv_python_platform
unset am_cv_python_pythondir
unset am_cv_python_pyexecdir
- AM_PATH_PYTHON([3.4], [
+ AM_PATH_PYTHON(mym4pythonver, [
AX_PYTHON_DEVEL
if test "$PYTHON_VERSION"; then
PYTHONS="$(echo $PYTHONS $PYTHON)"
PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
fi
- ], :)
+ ], :, m4_if([mym4pythonver],[all],[],[python]mym4pythonver))
+ ])
fi
# Recover some values lost in the second attempt to find Python.