From: Bryan Duxbury Date: Sun, 2 May 2010 22:39:31 +0000 (+0000) Subject: THRIFT-647. php: PHP library is missing install target X-Git-Tag: 0.3.0~20 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=6a681873383b931c82f5a4ddafb0c58547516eca;p=common%2Fthrift.git 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 f1eb5661..c5441937 100644 --- a/compiler/cpp/src/generate/t_java_generator.cc +++ b/compiler/cpp/src/generate/t_java_generator.cc @@ -1899,7 +1899,11 @@ void t_java_generator::generate_java_bean_boilerplate(ofstream& out, 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 40712051..205cd131 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,12 @@ AC_ARG_VAR([JAVA_PREFIX], [Prefix for installing the Java lib jar. 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 @@ if test "$with_perl" = "yes"; then 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 @@ AC_CONFIG_FILES([ 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 3558dd80..a7ae651e 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -44,6 +44,10 @@ if WITH_PERL 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 00000000..3dc763c4 --- /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