summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlan Antonuk <aega@med.umich.edu>2012-10-04 15:13:30 -0400
committerAlan Antonuk <alan.antonuk@gmail.com>2012-10-05 00:10:02 -0400
commitbda6f61ff7e5aabb8a1e907e19b856e8bf85a7d1 (patch)
tree5e5d1284e2bb471653052ebc7b78c384ab900dd8 /configure.ac
parent20289c2ecc871c7016db8b3d7301f5ea94485e48 (diff)
downloadrabbitmq-c-github-ask-bda6f61ff7e5aabb8a1e907e19b856e8bf85a7d1.tar.gz
Adding autotools support for Python3 codegen
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac36
1 files changed, 16 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac
index cb6bc1e..07e0349 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,26 +90,22 @@ AC_ARG_ENABLE([64-bit],
AX_TRY_LDFLAGS([-m64], [AX_LDFLAGS([-m64])])],
[enable_64_bit=no])
-# Configure python
-pythons="python python2.6 python2.5"
-AC_CACHE_CHECK([for Python with 'json'], [ac_cv_path_PYTHON],
- [AC_PATH_PROGS_FEATURE_CHECK([PYTHON], [$pythons],
- [$ac_path_PYTHON -c 'import json' 2>/dev/null
- AS_IF([test "x$?" = "x0"],
- [ac_cv_path_PYTHON=$ac_path_PYTHON
- ac_path_PYTHON_found=:])],
- [AC_MSG_RESULT([not found])])])
-AC_CACHE_CHECK([for Python with 'simplejson'], [ac_cv_path_PYTHON],
- [AC_PATH_PROGS_FEATURE_CHECK([PYTHON], [$pythons],
- [$ac_path_PYTHON -c 'import simplejson' 2>/dev/null
- AS_IF([test "x$?" = "x0"],
- [ac_cv_path_PYTHON=$ac_path_PYTHON
- ac_path_PYTHON_found=:])],
- [AC_MSG_RESULT([not found])])])
-AS_IF([test "x$ac_cv_path_PYTHON" = "x"],
- [ac_cv_path_PYTHON=:
- AC_MSG_WARN([unable to rebuild AMQP framing])])
-AC_SUBST([PYTHON], [$ac_cv_path_PYTHON])
+AM_PATH_PYTHON([2.5])
+
+AX_PYTHON_MODULE([json], [Need JSON])
+AS_IF([test "x$HAVE_PYMOD_JSON" = "xno"],
+ [AX_PYTHON_MODULE([simplejson])])
+AS_IF([test "x$HAVE_PYMOD_JSON" = "xno" && test "x$HAVE_PYMOD_SIMPLEJSON" = "xno"],
+ [AC_MSG_ERROR([Unable to find json or simplejson python modules])])
+
+AS_VERSION_COMPARE([$PYTHON_VERSION],[3.0],[eval HAVE_PYTHON3=no],[eval HAVE_PYTHON3=yes],[eval HAVE_PYTHON3=yes])
+
+AS_IF([test "x$HAVE_PYTHON3" = "xyes"],
+ [AC_PATH_PROG(PYTHON2TO3,[2to3])
+ AS_IF([test "x$PYTHON2TO3" = "x"],
+ AC_MSG_ERROR([Unable to find 2to3 python utility]))])
+
+AM_CONDITIONAL([PYTHON3], [test "x$HAVE_PYTHON3" = "xyes"])
# Configure AMQP command-line tools
AC_ARG_ENABLE([tools],