summary refs log tree commit diff stats
path: root/configure.ac
diff options
context:
space:
mode:
authorhasufell <hasufell@hasufell.de>2014-06-02 20:48:28 +0200
committerTingPing <tingping@tingping.se>2014-06-27 19:23:11 -0400
commitaa7291fc9c12b4da9e233b52c6f2bac767d831b0 (patch)
treea709eecb5f7d113ef0af46cfb0a6b076e80c5593 /configure.ac
parent3de79bca1078a4fce4cf8ad3a416ededbd890934 (diff)
configure: Improve python logic
- add checks for python3.4
- only warn once for failure to find a version
- only run pkg-config call if the .pc file was actually found
- make unsupported python version non-fatal

Closes #1006
Closes #989
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 18 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index a44bfb9d..8de5d1fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -295,19 +295,30 @@ if test "x$python" != xno ; then
 		case $python in
 			dnl set python2 default here
 			python2)
-				PKG_CHECK_MODULES([PY], [python-2.7], [], [AC_MSG_WARN(Cannot find python-2.7!)])
-				PY_VER="`$PKG_CONFIG --modversion python-2.7`";;
+				PKG_CHECK_MODULES([PY], [python-2.7],
+								  [PY_VER="`$PKG_CONFIG --modversion python-2.7`"],
+								  [true])
+				;;
 			dnl set python3 default here
 			python3)
-				PKG_CHECK_MODULES([PY], [python-3.3], [], [AC_MSG_WARN(Cannot find python-3.3!)])
-				PY_VER="`$PKG_CONFIG --modversion python-3.3`";;
+				PKG_CHECK_MODULES([PY], [python-3.4],
+								  [PY_VER="`$PKG_CONFIG --modversion python-3.4`"],
+								  [true])
+				if test "$PY_VER" = "" ; then
+					PKG_CHECK_MODULES([PY], [python-3.3],
+									  [PY_VER="`$PKG_CONFIG --modversion python-3.3`"],
+									  [true])
+				fi
+				;;
 			dnl add broken versions here
 			python2.5|python2.6|python3.1|python3.2)
-				AC_MSG_ERROR(Unsupported Python version ${python}!);;
+				AC_MSG_WARN(Unsupported Python version ${python}!);;
 			python*)
 				python="python-${python#python}" # stay posix compliant
-				PKG_CHECK_MODULES([PY], [${python}], [], [AC_MSG_WARN(Cannot find "${python}.pc"!)])
-				PY_VER="`$PKG_CONFIG --modversion ${python}`";;
+				PKG_CHECK_MODULES([PY], [${python}],
+								  [PY_VER="`$PKG_CONFIG --modversion ${python}`"],
+								  [AC_MSG_WARN(Cannot find "${python}.pc"!)])
+				;;
 			*)
 				AC_MSG_WARN(Unsupported Python ${python}!)
 		esac