Separate thrift into libthrift and libthriftnb
authorMark Slee <mcslee@apache.org>
Thu, 25 Jan 2007 08:14:50 +0000 (08:14 +0000)
committerMark Slee <mcslee@apache.org>
Thu, 25 Jan 2007 08:14:50 +0000 (08:14 +0000)
Summary: libthriftnb is the one that requires libevent. It was really annoying that you always had to put -levent in your link step to build thrift programs when youa re not using any of the c++ nonblocking stuff. This way, if you're using nonblocking you can do that, but the normal case is easier to link.

Reviewed By: makefile

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664951 13f79535-47bb-0310-9956-ffa450edef68

lib/cpp/Makefile.am
test/cpp/Makefile.thrift

index 932e802..20abe52 100644 (file)
@@ -1,4 +1,4 @@
-lib_LTLIBRARIES = libthrift.la
+lib_LTLIBRARIES = libthrift.la libthriftnb.la
 
 common_cxxflags = -Wall -Isrc $(BOOST_CPPFLAGS) $(EVENT_CPPFLAGS)
 common_ldflags = -Wall $(BOOST_LDFLAGS) $(EVENT_LDFLAGS)
@@ -17,15 +17,18 @@ libthrift_sources = src/concurrency/Mutex.cpp \
                     src/transport/TServerSocket.cpp \
                     src/transport/TTransportUtils.cpp \
                     src/server/TSimpleServer.cpp \
-                    src/server/TThreadPoolServer.cpp \
-                    src/server/TNonblockingServer.cpp
+                    src/server/TThreadPoolServer.cpp
+
+libthriftnb_sources = src/server/TNonblockingServer.cpp
 
 libthrift_la_SOURCES = $(libthrift_sources)
+libthriftnb_la_SOURCES = $(libthriftnb_sources)
 
 libthrift_cxxflags =  $(common_cxxflags)
 libthrift_ldflags =  $(common_ldflags)
 
 libthrift_la_CXXFLAGS =  $(libthrift_cxxflags)
+libthriftnb_la_CXXFLAGS =  $(libthrift_cxxflags)
 
 include_thriftdir = $(includedir)/thrift
 include_thrift_HEADERS = \
index b8bcd44..9eb1dce 100644 (file)
@@ -31,8 +31,8 @@ CC     = g++
 LD     = g++
 
 # Compiler flags
-DCFL  = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -levent
-LFL   =  -L$(thrift_home)/lib/cpp/.libs -lthrift -levent
+DCFL  = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
+LFL   =  -L$(thrift_home)/lib/cpp/.libs -lthrift -lthriftnb -levent
 CCFL  = -Wall -O3 -I./gen-cpp $(include_flags)
 CFL   = $(CCFL) $(LFL)
 
@@ -60,4 +60,4 @@ small:
        g++ -c $(CCFL) ./gen-cpp/SmallService.cpp ./gen-cpp/SmallTest_types.cpp
 
 clean:
-       rm -fr TestServer TestClient gen-cpp
+       rm -fr *.o TestServer TestClient gen-cpp