autoconf/automake/libtool-ized thrift cpp bits:
Moved the original Makefile => Makefile.slee
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664731 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am
index af437a6..1d79b5b 100644
--- a/lib/cpp/Makefile.am
+++ b/lib/cpp/Makefile.am
@@ -1 +1,50 @@
-SUBDIRS = src
+lib_LTLIBRARIES = libconcurrency.la \
+ libthrift.la
+
+# Define the source file for the module
+
+libconcurrency_la_SOURCES = src/concurrency/Monitor.cc \
+ src/concurrency/PosixThreadFactory.cc \
+ src/concurrency/ThreadManager.cc \
+ src/concurrency/TimerManager.cc
+
+libconcurrency_inst_headers = src/concurrency/Exception.h \
+ src/concurrency/Monitor.h \
+ src/concurrency/Thread.h \
+ src/concurrency/ThreadManager.h \
+ src/concurrency/TimerManager.h
+
+libthrift_la_SOURCES = src/protocol/TBinaryProtocol.cc \
+ src/transport/TBufferedTransport.cc \
+ src/transport/TChunkedTransport.cc \
+ src/transport/TSocket.cc \
+ src/transport/TServerSocket.cc \
+ src/server/TSimpleServer.cc
+
+libthrift_la_CXXFLAGS = -Isrc
+
+libthrift_inst_headers = src/protocol/TBinaryProtocol.h \
+ src/protocol/TProtocol.h \
+ src/transport/TBufferedTransport.h \
+ src/transport/TChunkedTransport.h \
+ src/transport/TNullTransport.h \
+ src/transport/TServerSocket.h \
+ src/transport/TServerTransport.h \
+ src/transport/TSocket.h \
+ src/transport/TTransport.h \
+ src/transport/TTransport.h \
+ src/transport/TTransportException.h
+
+bin_PROGRAMS = concurrency_test
+
+include_HEADERS = $(libconcurrency_inst_headers) \
+ $(libthrift_inst_headers)
+
+concurrency_test_SOURCES = src/concurrency/test/Tests.cc \
+ src/concurrency/test/ThreadFactoryTests.h \
+ src/concurrency/test/ThreadManagerTests.h \
+ src/concurrency/test/TimerManagerTests.h
+
+concurrency_test_LDADD = libconcurrency.la
+
+concurrency_test_CXXFLAGS = -Isrc/concurrency
diff --git a/lib/cpp/Makefile b/lib/cpp/Makefile.slee
similarity index 100%
rename from lib/cpp/Makefile
rename to lib/cpp/Makefile.slee
diff --git a/lib/cpp/bootstrap.sh b/lib/cpp/bootstrap.sh
index 826bf3b..df392e7 100755
--- a/lib/cpp/bootstrap.sh
+++ b/lib/cpp/bootstrap.sh
@@ -1,4 +1,35 @@
#!/bin/sh
+
+rm -rf \
+AUTHORS \
+COPYING \
+ChangeLog \
+INSTALL \
+Makefile \
+Makefile.in \
+Makefile.orig \
+NEWS \
+README \
+aclocal.m4 \
+autom4te.cache \
+autoscan.log \
+config.guess \
+config.h \
+config.hin \
+config.hin \
+config.log \
+config.status \
+config.sub \
+configure \
+configure.scan \
+depcomp \
+install-sh \
+libtool \
+ltmain.sh \
+missing \
+stamp-h1
+
+
autoscan
autoheader
aclocal
diff --git a/lib/cpp/configure.ac b/lib/cpp/configure.ac
index 679e26f..0499a0e 100644
--- a/lib/cpp/configure.ac
+++ b/lib/cpp/configure.ac
@@ -28,6 +28,8 @@
AC_CHECK_HEADERS([sys/socket.h])
+AC_CHECK_HEADERS([bits/socket.h])
+
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([unistd.h])
@@ -44,6 +46,18 @@
AC_TYPE_SIZE_T
+AC_TYPE_INT32_T
+x
+AC_TYPE_INT64_T
+
+AC_TYPE_UINT16_T
+
+AC_TYPE_UINT32_T
+
+AC_TYPE_UINT64_T
+
+AC_TYPE_UINT8_T
+
AC_CONFIG_HEADERS(config.h:config.hin)
AC_PROG_CC
@@ -54,4 +68,4 @@
AC_PROG_LIBTOOL
-AC_OUTPUT([Makefile src/Makefile src/concurrency/Makefile])
+AC_OUTPUT(Makefile)
diff --git a/lib/cpp/src/Makefile.am b/lib/cpp/src/Makefile.am
deleted file mode 100644
index 3d07cb4..0000000
--- a/lib/cpp/src/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = concurrency
diff --git a/lib/cpp/src/concurrency/Makefile.am b/lib/cpp/src/concurrency/Makefile.am
deleted file mode 100644
index c4d0829..0000000
--- a/lib/cpp/src/concurrency/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-lib_LTLIBRARIES = libconcurrency.la
-
-# Define the source file for the module
-
-libconcurrency_la_SOURCES = Monitor.cc \
- PosixThreadFactory.cc \
- ThreadManager.cc \
- TimerManager.cc
-
-
diff --git a/lib/cpp/src/concurrency/test/Tests.cc b/lib/cpp/src/concurrency/test/Tests.cc
index 2174bf4..19e1f4a 100644
--- a/lib/cpp/src/concurrency/test/Tests.cc
+++ b/lib/cpp/src/concurrency/test/Tests.cc
@@ -56,9 +56,9 @@
std::cout << "ThreadManager tests..." << std::endl;
- size_t workerCount = 10;
+ size_t workerCount = 100;
- size_t taskCount = 10000;
+ size_t taskCount = 100000;
long long delay = 10LL;
diff --git a/lib/cpp/src/concurrency/test/ThreadManagerTests.h b/lib/cpp/src/concurrency/test/ThreadManagerTests.h
index 72d6777..6132571 100644
--- a/lib/cpp/src/concurrency/test/ThreadManagerTests.h
+++ b/lib/cpp/src/concurrency/test/ThreadManagerTests.h
@@ -49,7 +49,7 @@
error*= -1.0;
}
- if(error > .10) {
+ if(error > .20) {
assert(false);
}
diff --git a/lib/cpp/src/transport/TSocket.cc b/lib/cpp/src/transport/TSocket.cc
index 3471755..55f512e 100644
--- a/lib/cpp/src/transport/TSocket.cc
+++ b/lib/cpp/src/transport/TSocket.cc
@@ -162,9 +162,16 @@
uint32_t sent = 0;
while (sent < len) {
+
+ int flags = 0;
+
+ #if HAVE_BITS_SOCKET_H
// Note the use of MSG_NOSIGNAL to suppress SIGPIPE errors, instead we
// check for the EPIPE return condition and close the socket in that case
- int b = send(socket_, buf + sent, len - sent, MSG_NOSIGNAL);
+ flags |= MSG_NOSIGNAL;
+ #endif // HAVE_BITS_SOCKET_H
+
+ int b = send(socket_, buf + sent, len - sent, flags);
++g_socket_syscalls;
// Fail on a send error