From: David Reiss Date: Wed, 11 Jun 2008 01:16:37 +0000 (+0000) Subject: Allow Thrift to be built without the Python library. X-Git-Tag: 0.2.0~676 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=1a14091adc3380df570d01849b9b6002f7dc24c6;p=common%2Fthrift.git Allow Thrift to be built without the Python library. - Modify configure.ac to check for Python conditionally, like we do for Java, Mono, and Erlang. - Modify Makefile.am to add "py" to SUBDIRS only if Python was detected. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666488 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/configure.ac b/configure.ac index 9e9a0b47..44e3168e 100644 --- a/configure.ac +++ b/configure.ac @@ -12,8 +12,6 @@ AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules. Default = "/usr"]) AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"]) -AM_PATH_PYTHON(2.4,, :) - AC_PROG_CC AC_PROG_CPP @@ -57,6 +55,12 @@ if test "$with_erlang" = "yes"; then fi AM_CONDITIONAL(ENABLE_ERLANG, [test -n "$ERLC"]) +AX_THRIFT_LIB(py, [Python], yes) +if test "$with_py" = "yes"; then + AM_PATH_PYTHON(2.4,, :) +fi +AM_CONDITIONAL(ENABLE_PYTHON, [test -n "$PYTHON" -a "$PYTHON" != ":"]) + AC_C_CONST AC_C_INLINE AC_C_VOLATILE diff --git a/lib/Makefile.am b/lib/Makefile.am index 58ef555b..1045237b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,5 @@ SUBDIRS = \ - cpp \ - py + cpp if ENABLE_MONO SUBDIRS += csharp @@ -10,6 +9,10 @@ if ENABLE_JAVA SUBDIRS += java endif +if ENABLE_PYTHON +SUBDIRS += py +endif + if ENABLE_ERLANG SUBDIRS += erl endif diff --git a/test/Makefile.am b/test/Makefile.am index bf5a0d7d..e34e033d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,9 +1,13 @@ -SUBDIRS = py +SUBDIRS = if ENABLE_JAVA SUBDIRS += java endif +if ENABLE_PYTHON +SUBDIRS += py +endif + noinst_LTLIBRARIES = libtestgencpp.la libtestgencpp_la_SOURCES = \ gen-cpp/DebugProtoTest_types.cpp \