You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2010/05/03 00:39:31 UTC

svn commit: r940325 - in /incubator/thrift/trunk: compiler/cpp/src/generate/t_java_generator.cc configure.ac lib/Makefile.am lib/php/Makefile.am

Author: bryanduxbury
Date: Sun May  2 22:39:31 2010
New Revision: 940325

URL: http://svn.apache.org/viewvc?rev=940325&view=rev
Log:
THRIFT-647. php: PHP library is missing install target

This patch adds a 'make install' target to a new PHP makefile. 

Patch: Anthony Molinaro

Added:
    incubator/thrift/trunk/lib/php/Makefile.am
Modified:
    incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
    incubator/thrift/trunk/configure.ac
    incubator/thrift/trunk/lib/Makefile.am

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc?rev=940325&r1=940324&r2=940325&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc Sun May  2 22:39:31 2010
@@ -1899,7 +1899,11 @@ void t_java_generator::generate_java_bea
     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;
     }

Modified: incubator/thrift/trunk/configure.ac
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/configure.ac?rev=940325&r1=940324&r2=940325&view=diff
==============================================================================
--- incubator/thrift/trunk/configure.ac (original)
+++ incubator/thrift/trunk/configure.ac Sun May  2 22:39:31 2010
@@ -37,6 +37,12 @@ AC_ARG_VAR([JAVA_PREFIX], [Prefix for in
                            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

Modified: incubator/thrift/trunk/lib/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/Makefile.am?rev=940325&r1=940324&r2=940325&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/Makefile.am (original)
+++ incubator/thrift/trunk/lib/Makefile.am Sun May  2 22:39:31 2010
@@ -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 = \

Added: incubator/thrift/trunk/lib/php/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/php/Makefile.am?rev=940325&view=auto
==============================================================================
--- incubator/thrift/trunk/lib/php/Makefile.am (added)
+++ incubator/thrift/trunk/lib/php/Makefile.am Sun May  2 22:39:31 2010
@@ -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