Allow Thrift to be built without the Python library.
authorDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 01:16:37 +0000 (01:16 +0000)
committerDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 01:16:37 +0000 (01:16 +0000)
- 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

configure.ac
lib/Makefile.am
test/Makefile.am

index 9e9a0b4..44e3168 100644 (file)
@@ -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
index 58ef555..1045237 100644 (file)
@@ -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
index bf5a0d7..e34e033 100644 (file)
@@ -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 \