From 9d4a3e2a78be150513a88eb8870d9a7696acf0e9 Mon Sep 17 00:00:00 2001 From: Marc Slemko Date: Fri, 21 Jul 2006 19:53:48 +0000 Subject: [PATCH] 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 --- lib/cpp/Makefile.am | 51 ++++++++++++++++++- lib/cpp/{Makefile => Makefile.slee} | 0 lib/cpp/bootstrap.sh | 31 +++++++++++ lib/cpp/configure.ac | 16 +++++- lib/cpp/src/Makefile.am | 1 - lib/cpp/src/concurrency/Makefile.am | 10 ---- lib/cpp/src/concurrency/test/Tests.cc | 4 +- .../src/concurrency/test/ThreadManagerTests.h | 2 +- lib/cpp/src/transport/TSocket.cc | 9 +++- 9 files changed, 107 insertions(+), 17 deletions(-) rename lib/cpp/{Makefile => Makefile.slee} (100%) delete mode 100644 lib/cpp/src/Makefile.am delete mode 100644 lib/cpp/src/concurrency/Makefile.am diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am index af437a64..1d79b5be 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 826bf3b3..df392e7c 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 679e26fd..0499a0e1 100644 --- a/lib/cpp/configure.ac +++ b/lib/cpp/configure.ac @@ -28,6 +28,8 @@ AC_CHECK_HEADERS([stddef.h]) 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_HEADER_TIME 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_INSTALL 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 3d07cb40..00000000 --- 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 c4d08291..00000000 --- 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 2174bf43..19e1f4a6 100644 --- a/lib/cpp/src/concurrency/test/Tests.cc +++ b/lib/cpp/src/concurrency/test/Tests.cc @@ -56,9 +56,9 @@ int main(int argc, char** argv) { 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 72d67771..61325717 100644 --- a/lib/cpp/src/concurrency/test/ThreadManagerTests.h +++ b/lib/cpp/src/concurrency/test/ThreadManagerTests.h @@ -49,7 +49,7 @@ public: 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 34717551..55f512e1 100644 --- a/lib/cpp/src/transport/TSocket.cc +++ b/lib/cpp/src/transport/TSocket.cc @@ -162,9 +162,16 @@ void TSocket::write(const uint8_t* buf, uint32_t len) { 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 -- 2.17.1