THRIFT-647. php: PHP library is missing install target
This patch adds a 'make install' target to a new PHP makefile.
Patch: Anthony Molinaro
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940325 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc
index f1eb566..c544193 100644
--- a/compiler/cpp/src/generate/t_java_generator.cc
+++ b/compiler/cpp/src/generate/t_java_generator.cc
@@ -1899,7 +1899,11 @@
indent(out) << "public boolean is" << get_cap_name("set") << cap_name << "() {" << endl;
indent_up();
if (type_can_be_null(type)) {
- indent(out) << "return this." << field_name << " != null;" << endl;
+ indent(out) << "return this." << field_name << " != null";
+ if (type->is_struct() && ((t_struct*)type)->is_union()) {
+ out << " && this." << field_name << ".isSet()";
+ }
+ out << ";" << endl;
} else {
indent(out) << "return __isset_bit_vector.get(" << isset_field_id(field) << ");" << endl;
}
diff --git a/configure.ac b/configure.ac
index 4071205..205cd13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,6 +37,12 @@
Default = "/usr/local/lib"])
AS_IF([test "x$JAVA_PREFIX" = x], [JAVA_PREFIX="/usr/local/lib"])
+AC_ARG_VAR([PHP_PREFIX], [Prefix for installing PHP modules.
+ (Normal --prefix is ignored for PHP because
+ PHP has different conventions.)
+ Default = "/usr/lib/php"])
+AS_IF([test "x$PHP_PREFIX" = x], [PHP_PREFIX="/usr/lib/php"])
+
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
@@ -103,6 +109,12 @@
fi
AM_CONDITIONAL(WITH_PERL, [test -n "$PERL"])
+AX_THRIFT_LIB(php, [PHP], yes)
+if test "$with_php" = "yes"; then
+ AC_PATH_PROG([PHP], [php])
+fi
+AM_CONDITIONAL(WITH_PHP, [test -n "$PHP"])
+
AX_THRIFT_LIB(ruby, [Ruby], yes)
if test "$with_ruby" = "yes"; then
AC_PATH_PROG([RUBY], [ruby])
@@ -250,6 +262,7 @@
lib/java/Makefile
lib/perl/Makefile
lib/perl/test/Makefile
+ lib/php/Makefile
lib/py/Makefile
lib/rb/Makefile
test/Makefile
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 3558dd8..a7ae651 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -44,6 +44,10 @@
SUBDIRS += perl
endif
+if WITH_PHP
+SUBDIRS += php
+endif
+
# All of the libs that don't use Automake need to go in here
# so they will end up in our release tarballs.
EXTRA_DIST = \
diff --git a/lib/php/Makefile.am b/lib/php/Makefile.am
new file mode 100644
index 0000000..3dc763c
--- /dev/null
+++ b/lib/php/Makefile.am
@@ -0,0 +1,29 @@
+phpdir = ${PHP_PREFIX}
+php_DATA = \
+ src/autoload.php \
+ src/Thrift.php
+
+phpextdir = ${phpdir}/ext/thrift_protocol
+phpext_DATA = \
+ src/ext/thrift_protocol/config.m4 \
+ src/ext/thrift_protocol/php_thrift_protocol.cpp \
+ src/ext/thrift_protocol/php_thrift_protocol.h
+
+phpprotocoldir = ${phpdir}/protocol
+phpprotocol_DATA = \
+ src/protocol/TBinaryProtocol.php \
+ src/protocol/TProtocol.php
+
+phptransportdir = ${phpdir}/transport
+phptransport_DATA = \
+ src/transport/TBufferedTransport.php \
+ src/transport/TFramedTransport.php \
+ src/transport/THttpClient.php \
+ src/transport/TMemoryBuffer.php \
+ src/transport/TNullTransport.php \
+ src/transport/TPhpStream.php \
+ src/transport/TSocket.php \
+ src/transport/TSocketPool.php \
+ src/transport/TTransport.php
+
+MAINTAINERCLEANFILES = Makefile Makefile.in