diff options
author | Tony Garnock-Jones <tonygarnockjones@gmail.com> | 2010-02-16 10:10:29 +1300 |
---|---|---|
committer | Tony Garnock-Jones <tonygarnockjones@gmail.com> | 2010-02-16 10:10:29 +1300 |
commit | 70a8af23ff8a5b2219d6655ae223248f1e0c0826 (patch) | |
tree | 6476368452137c9b46105e48c6d5375b67306eb0 | |
parent | 7131891390c1944bb387511ae7c192ae647712c0 (diff) | |
download | rabbitmq-c-github-ask-70a8af23ff8a5b2219d6655ae223248f1e0c0826.tar.gz |
Work harder for a sane PYTHON default.
-rw-r--r-- | configure.ac | 23 | ||||
-rw-r--r-- | librabbitmq/Makefile.am | 2 |
2 files changed, 23 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 2a3d0c0..cb835e8 100644 --- a/configure.ac +++ b/configure.ac @@ -37,8 +37,31 @@ else AC_MSG_ERROR(could not find AMQP spec file at "'$AMQP_SPEC_JSON_PATH'") fi +AC_MSG_CHECKING(finding a python with simplejson installed) +found_python=no +checkPython() { + if test "$found_python" = "yes" + then + return + fi + PYTHON=$1 + if $PYTHON -c 'import simplejson' 2>/dev/null + then + found_python=yes + AC_MSG_RESULT($PYTHON) + fi +} +checkPython python +checkPython python2.6 +checkPython python2.5 +if test "$found_python" = "no" +then + AC_MSG_ERROR(could not find a python that can 'import simplejson') +fi + AC_SUBST(AMQP_CODEGEN_DIR) AC_SUBST(AMQP_SPEC_JSON_PATH) +AC_SUBST(PYTHON) AC_OUTPUT( Makefile diff --git a/librabbitmq/Makefile.am b/librabbitmq/Makefile.am index 12dbd25..b4c8843 100644 --- a/librabbitmq/Makefile.am +++ b/librabbitmq/Makefile.am @@ -8,8 +8,6 @@ BUILT_SOURCES = amqp_framing.h amqp_framing.c CLEANFILES = amqp_framing.h amqp_framing.c EXTRA_DIST = codegen.py -PYTHON = python2.5 - CODEGEN_PY=$(srcdir)/codegen.py amqp_framing.h: $(AMQP_SPEC_JSON_PATH) $(CODEGEN_PY) |