summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Slee <mcslee@apache.org>2007-03-05 22:18:18 +0000
committerMark Slee <mcslee@apache.org>2007-03-05 22:18:18 +0000
commit5d06feab210f1175bc95d2ea435fd59a82b76024 (patch)
tree1acd7c92789d1871397e76eda2fcdff09460e360
parent3303f360818aa39fc197f1f73ce3f7d578fbc2b1 (diff)
downloadthrift-5d06feab210f1175bc95d2ea435fd59a82b76024.tar.gz
Thrift build cleanup stuff
Summary: Get rid of autoconf stuff for lib/php, it doesn't do anything git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665046 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-xbootstrap.sh2
-rwxr-xr-xcleanup.sh2
-rw-r--r--configure.ac2
-rw-r--r--lib/cpp/Makefile.slee91
-rwxr-xr-xlib/cpp/cleanup.sh2
-rw-r--r--lib/cpp/configure.ac2
-rw-r--r--lib/cpp/src/protocol/TProtocol.h13
-rw-r--r--lib/php/Makefile.am17
-rw-r--r--lib/php/README38
-rwxr-xr-xlib/php/bootstrap.sh7
-rwxr-xr-xlib/php/cleanup.sh30
-rw-r--r--lib/php/configure.ac11
12 files changed, 52 insertions, 165 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
index d88319ac7..f5d5c4e63 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-subdirs="compiler/cpp lib/cpp lib/php lib/py"
+subdirs="compiler/cpp lib/cpp lib/py"
./cleanup.sh
echo "SUBDIRS = ${subdirs}" > Makefile.am
diff --git a/cleanup.sh b/cleanup.sh
index 98e819013..a922b1b65 100755
--- a/cleanup.sh
+++ b/cleanup.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-subdirs="compiler/cpp lib/cpp lib/php lib/py"
+subdirs="compiler/cpp lib/cpp lib/py"
rm -rf \
AUTHORS \
diff --git a/configure.ac b/configure.ac
index 0d1207ddf..eca327d4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,6 +8,6 @@ AM_INIT_AUTOMAKE
AC_CONFIG_FILES([Makefile])
-AC_CONFIG_SUBDIRS([compiler/cpp lib/cpp lib/php lib/py])
+AC_CONFIG_SUBDIRS([compiler/cpp lib/cpp lib/py])
AC_OUTPUT
diff --git a/lib/cpp/Makefile.slee b/lib/cpp/Makefile.slee
deleted file mode 100644
index fde44110d..000000000
--- a/lib/cpp/Makefile.slee
+++ /dev/null
@@ -1,91 +0,0 @@
-# Makefile for Thrift C++ library. Generates a shared object that can be
-# installed to /usr/local/lib
-#
-# TODO(mcslee): Add the ability to compile separate statis modules that can
-# be compiled directly into Thrift applications instead of dynamic runtime
-# loading of the full libs
-#
-# Author:
-# Mark Slee <mcslee@facebook.com>
-
-target: libthrift.so libconcurrency.so
-
-# Tools
-LD = g++
-CPP = g++
-
-CC_COMMON_FLAGS = -g -c -Wall -Isrc -fPIC -fno-common
-
-LD_COMMON_FLAGS=
-
-LD_APP_FLAGS= $(LD_COMMON_FLAGS)
-
-LD_LIB_FLAGS= -dynamiclib $(LD_COMMON_FLAGS)
-
-# Source files
-SRCS = src/protocol/TBinaryProtocol.cc \
- src/transport/TBufferedTransport.cc \
- src/transport/TChunkedTransport.cc \
- src/transport/TSocket.cc \
- src/transport/TServerSocket.cc \
- src/server/TSimpleServer.cc
-
-# Concurreny Utility Source files
-CONCURRENCY_SRCS = src/concurrency/Monitor.cc \
- src/concurrency/Mutex.cc \
- src/concurrency/PosixThreadFactory.cc \
- src/concurrency/ThreadManager.cc \
- src/concurrency/TimerManager.cc
-
-CONCURRENCY_OBJS = $(patsubst %.cc,%.o,$(CONCURRENCY_SRCS))
-
-$(CONCURRENCY_OBJS): %.o : %.cc
- $(CC) $(CC_COMMON_FLAGS) $< -o $@
-
-CONCURRENCY_TEST_SRCS = src/concurrency/test/TimerManagerTests.cc
-
-CONCURRENCY_TEST_OBJS = $(patsubst %.cc,%.o,$(CONCURRENCY_TEST_SRCS))
-
-$(CONCURRENCY_TEST_OBJS): %.o : %.cc
- $(CC) $(CC_COMMON_FLAGS) -I src/concurrency $< -o $@
-
-# Linked libraries
-
-# thrift library
-
-THRIFT_OBJS = $(patsubst %.cc,%.o, $(SRCS))
-
-$(THRIFT_OBJS): %.o : %.cc
- $(CC) $(CC_COMMON_FLAGS) $< -o $@
-
-libthrift.so: $(THRIFT_OBJS)
- $(LD) -o $@ $(LD_LIB_FLAGS) $(THRIFT_OBJS)
-
-# concurrency util library
-
-libconcurrency.so: $(CONCURRENCY_OBJS)
- $(LD) -o $@ $(LD_LIB_FLAGS) $(CONCURRENCY_OBJS)
-
-concurrency_tests: libconcurrency.so $(CONCURRENCY_TEST_OBJS)
- $(LD) -o $@ $(LD_APP_FLAGS) -L. $(CONCURRENCY_TEST_OBJS) libconcurrency.so
-
-tests: concurrency_tests
-
-clean_libthrift:
- rm -f libthrift.so
- rm -f $(THRIFT_OBJS)
-
-clean_libconcurrency:
- rm -f libconcurrency.so
- rm -f $(CONCURRENCY_OBJS)
-
-clean_tests:
- rm -f concurrency_tests
- rm -f $(CONCURRENTY_TEST_OBJS)
-
-# Clean it up
-clean: clean_libthrift clean_libconcurrency clean_tests
-
-# Install
-install: libthrift
- sudo install libthrift.so /usr/local/lib
diff --git a/lib/cpp/cleanup.sh b/lib/cpp/cleanup.sh
index d026a463e..71151e9be 100755
--- a/lib/cpp/cleanup.sh
+++ b/lib/cpp/cleanup.sh
@@ -1,5 +1,6 @@
#!/bin/sh
+make clean 1>/dev/null 2>/dev/null
rm -rf \
AUTHORS \
ChangeLog \
@@ -8,7 +9,6 @@ Makefile \
Makefile.in \
Makefile.orig \
NEWS \
-README \
aclocal.m4 \
autom4te.cache \
autoscan.log \
diff --git a/lib/cpp/configure.ac b/lib/cpp/configure.ac
index 878e55aa9..98020963a 100644
--- a/lib/cpp/configure.ac
+++ b/lib/cpp/configure.ac
@@ -106,4 +106,6 @@ AC_PROG_INSTALL
AC_PROG_LIBTOOL
+AC_PROG_MAKE_SET
+
AC_OUTPUT(Makefile)
diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h
index 846a32160..8b2e6bd7a 100644
--- a/lib/cpp/src/protocol/TProtocol.h
+++ b/lib/cpp/src/protocol/TProtocol.h
@@ -71,11 +71,14 @@ enum TMessageType {
* Abstract class for a thrift protocol driver. These are all the methods that
* a protocol must implement. Essentially, there must be some way of reading
* and writing all the base types, plus a mechanism for writing out structs
- * with indexed fields. Also notice that all methods are strictly const. This
- * is by design. Protcol impelementations may NOT keep state, because the
- * same TProtocol object may be used simultaneously by multiple threads. This
- * theoretically introduces some limititations into the possible protocol
- * formats, but with the benefit of performance, clarity, and simplicity.
+ * with indexed fields.
+ *
+ * TProtocol objects should not be shared across multiple encoding contexts,
+ * as they may need to maintain internal state in some protocols (i.e. XML).
+ * Note that is is acceptable for the TProtocol module to do its own internal
+ * buffered reads/writes to the underlying TTransport where appropriate (i.e.
+ * when parsing an input XML stream, reading should be batched rather than
+ * looking ahead character by character for a close tag).
*
* @author Mark Slee <mcslee@facebook.com>
*/
diff --git a/lib/php/Makefile.am b/lib/php/Makefile.am
deleted file mode 100644
index a33d9274c..000000000
--- a/lib/php/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-thrift_SCRIPTS = src/Thrift.php
-
-protocol_SCRIPTS = src/protocol/TProtocol.php \
- src/protocol/TBinaryProtocol.php
-
-transport_SCRIPTS = src/transport/TTransport.php \
- src/transport/TBufferedTransport.php \
- src/transport/TFramedTransport.php \
- src/transport/TSocket.php \
- src/transport/TSocketPool.php
-
-thriftdir = $(prefix)/php/thrift
-
-protocoldir = $(thriftdir)/protocol
-
-transportdir = $(thriftdir)/transport
-
diff --git a/lib/php/README b/lib/php/README
new file mode 100644
index 000000000..84d60e130
--- /dev/null
+++ b/lib/php/README
@@ -0,0 +1,38 @@
+Thrift PHP Software Library
+
+Mark Slee (mcslee@facebook.com)
+
+Thrift is distributed under the Thrift open source software license.
+Please see the included LICENSE file.
+
+Using Thrift with PHP
+=====================
+
+Thrift requires PHP 5. Thrift makes as few assumptions about your PHP
+environment as possible while trying to make some more advanced PHP
+features (i.e. APC cacheing using asbolute path URLs) as simple as possible.
+
+To use Thrift in your PHP codebase, take the following steps:
+
+#1) Copy all of thrift/lib/php/src into your PHP codebase
+#2) Set $GLOBALS['THRIFT_ROOT'] to the path you installed Thrift
+#3) include_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php';
+
+Note that #3 must be done before including any other Thrift files.
+If you do not do #2, Thrift.php will set this global for you, but it will be
+done using dirname(__FILE__), which is less efficient than providing the static
+string yourself.
+
+Dependencies
+============
+
+PHP_INT_SIZE
+
+ This built-in signals whether your architecture is 32 or 64 bit and is
+ used by the TBinaryProtocol to properly use pack() and unpack() to
+ serialize data.
+
+apc_fetch(), apc_store()
+
+ APC cache is used by the TSocketPool class. If you do not have APC installed,
+ Thrift will fill in null stub function definitions.
diff --git a/lib/php/bootstrap.sh b/lib/php/bootstrap.sh
deleted file mode 100755
index b79e43100..000000000
--- a/lib/php/bootstrap.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-./cleanup.sh
-aclocal
-touch NEWS README AUTHORS ChangeLog
-autoconf
-automake -ac
diff --git a/lib/php/cleanup.sh b/lib/php/cleanup.sh
deleted file mode 100755
index d026a463e..000000000
--- a/lib/php/cleanup.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-rm -rf \
-AUTHORS \
-ChangeLog \
-INSTALL \
-Makefile \
-Makefile.in \
-Makefile.orig \
-NEWS \
-README \
-aclocal.m4 \
-autom4te.cache \
-autoscan.log \
-config.guess \
-config.h \
-config.hin \
-config.log \
-config.status \
-config.sub \
-configure \
-configure.scan \
-depcomp \
-.deps \
-install-sh \
-.libs \
-libtool \
-ltmain.sh \
-Makefile.in \
-missing
diff --git a/lib/php/configure.ac b/lib/php/configure.ac
deleted file mode 100644
index d32321e6c..000000000
--- a/lib/php/configure.ac
+++ /dev/null
@@ -1,11 +0,0 @@
-AC_PREREQ(2.59)
-
-AC_INIT([thriftphp], [1.0])
-
-AC_CONFIG_AUX_DIR([.])
-
-AM_INIT_AUTOMAKE
-
-AC_CONFIG_FILES([Makefile])
-
-AC_OUTPUT