aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--configure.ac62
1 files changed, 54 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index bac7908d..bcac13f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -176,7 +176,7 @@ have_w32_system=no
have_w64_system=no
build_w32_glib=no
build_w32_qt=no
-available_languages="cl cpp python qt"
+available_languages="cl cpp python python2 python3 qt"
default_languages="cl cpp python qt"
case "${host}" in
x86_64-*mingw32*)
@@ -369,8 +369,13 @@ 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)
-if test "$found" = "1"; then
+found_py=$found
+if test "$found_py" = "1" -o "$found_py2" = "1" -o "$found_py3" = "1"; then
AX_PKG_SWIG
if test -z "$SWIG"; then
if test "$explicit_languages" = "1"; then
@@ -382,11 +387,49 @@ if test "$found" = "1"; then
enabled_languages=$(echo $enabled_languages | sed 's/python//')
fi
else
- AM_PATH_PYTHON([3.4])
- AX_SWIG_PYTHON
- if test -z "$PYTHON_VERSION"; then
- if test "$explicit_languages" = "1"; then
- AC_MSG_ERROR([[
+ # Reset all the stuff, just to be sure.
+ PYTHONS=
+ PYTHON_VERSIONS=
+ unset PYTHON
+ unset PYTHON_VERSION
+ 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])
+ if test "$PYTHON"; 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
+ unset PYTHON_VERSION
+ 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
+ AM_PATH_PYTHON([3.4])
+ if test "$PYTHON"; then
+ PYTHONS="$(echo $PYTHONS $PYTHON)"
+ PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
+ fi
+ fi
+
+ if test "$PYTHON_VERSIONS"; then
+ enabled_languages_v=$(echo $enabled_languages | sed "s/python\([[23]]\)\?/python ($PYTHON_VERSIONS)/")
+ enabled_languages=$(echo $enabled_languages | sed "s/python\([[23]]\)\?/python/")
+ else
+ if test "$explicit_languages" = "1"; then
+ AC_MSG_ERROR([[
***
*** Please install the python development packages.
***]])
@@ -394,6 +437,9 @@ if test "$found" = "1"; then
enabled_languages=$(echo $enabled_languages | sed 's/python//')
fi
fi
+
+ AC_SUBST(PYTHONS, $PYTHONS)
+ AC_SUBST(PYTHON_VERSIONS, $PYTHON_VERSIONS)
fi
fi
@@ -843,7 +889,7 @@ echo "
FD Passing: $use_descriptor_passing
GPGME Pthread: $have_pthread
- Language bindings: $enabled_languages
+ Language bindings: ${enabled_languages_v:-$enabled_languages}
"
if test "x${gpg_config_script_warn}" != x; then
cat <<G10EOF