File build_service_linking.patch of Package libtaobao
Index: libtaobao-0.1/tbsys-0.1/test/Makefile.am
===================================================================
--- libtaobao-0.1.orig/tbsys-0.1/test/Makefile.am
+++ libtaobao-0.1/tbsys-0.1/test/Makefile.am
@@ -1,23 +1,58 @@
-AM_CPPFLAGS=-I$(top_srcdir)/src
-LDADD=$(top_srcdir)/src/.libs/libtbsys.a
-AM_LDFLAGS="-lrt -lm -lpthread"
-
-noinst_HEADERS=testBase.h testCommon.h
-
-noinst_PROGRAMS=testfilequeue testqueuethread testconfig \
- teststringutil testnetutil testlog \
- testfileutil testtimeutil testthread\
- testtimer testthreadpool testService
-
-testfilequeue_SOURCES=testfilequeue.cpp
-testqueuethread_SOURCES=testqueuethread.cpp
-testconfig_SOURCES=testconfig.cpp
-teststringutil_SOURCES=teststringutil.cpp
-testnetutil_SOURCES=testnetutil.cpp
-testlog_SOURCES=testlog.cpp
-testfileutil_SOURCES=testfileutil.cpp
-testtimeutil_SOURCES=testtimeutil.cpp
-testthread_SOURCES=testBase.cpp testthread.cpp
-testtimer_SOURCES=testBase.cpp testTimer.cpp
-testthreadpool_SOURCES=testBase.cpp testThreadPool.cpp
-testService_SOURCES=testBase.cpp testService.cpp
+AM_LDFLAGS = -pthread
+INCLUDES = -I$(top_srcdir)/src
+LDADD = $(top_srcdir)/src/.libs/libtbsys.a \
+ -lrt
+
+noinst_HEADERS = \
+ testBase.h \
+ testCommon.h
+
+noinst_PROGRAMS = \
+ testconfig \
+ testfilequeue \
+ testfileutil \
+ testlog \
+ testnetutil \
+ testqueuethread \
+ teststringutil \
+ testthread \
+ testthreadpool \
+ testtimeutil \
+ testtimer \
+ testService
+
+testconfig_SOURCES = testconfig.cpp
+testconfig_LDFLAGS =
+
+testfilequeue_SOURCES = testfilequeue.cpp
+testfilequeue_LDFLAGS = $(AM_LDFLAGS)
+
+testfileutil_SOURCES = testfileutil.cpp
+testfileutil_LDFLAGS =
+
+testlog_SOURCES = testlog.cpp
+testlog_LDFLAGS =
+
+testnetutil_SOURCES = testnetutil.cpp
+testnetutil_LDFLAGS =
+
+testqueuethread_SOURCES = testqueuethread.cpp
+testqueuethread_LDFLAGS = $(AM_LDFLAGS)
+
+teststringutil_SOURCES = teststringutil.cpp
+teststringutil_LDFLAGS =
+
+testthread_SOURCES = testBase.cpp testthread.cpp
+testthread_LDFLAGS = $(AM_LDFLAGS)
+
+testthreadpool_SOURCES = testBase.cpp testThreadPool.cpp
+testthreadpool_LDFLAGS = $(AM_LDFLAGS)
+
+testtimeutil_SOURCES = testtimeutil.cpp
+testtimeutil_LDFLAGS =
+
+testtimer_SOURCES = testBase.cpp testTimer.cpp
+testtimer_LDFLAGS = $(AM_LDFLAGS)
+
+testService_SOURCES = testBase.cpp testService.cpp
+testService_LDFLAGS = $(AM_LDFLAGS)
Index: libtaobao-0.1/tbsys-0.1/configure.ac
===================================================================
--- libtaobao-0.1.orig/tbsys-0.1/configure.ac
+++ libtaobao-0.1/tbsys-0.1/configure.ac
@@ -4,6 +4,11 @@
AC_INIT(src/tbsys.h)
AM_INIT_AUTOMAKE(tbsys, 0.1)
+
+# Save this value here, since automake will set cppflags later
+cppflags_set=${CXXFLAGS+set}
+#CXXFLAGS="-O2 -Wall -Wno-deprecated -fPIC"
+
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
@@ -13,7 +18,6 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_LANG_CPLUSPLUS
-CXXFLAGS="-O3 -Wall -fPIC"
if test -n "${TBLIB_ROOT}"; then
ac_default_prefix=${TBLIB_ROOT}
Index: libtaobao-0.1/tbnet-0.1/configure.ac
===================================================================
--- libtaobao-0.1.orig/tbnet-0.1/configure.ac
+++ libtaobao-0.1/tbnet-0.1/configure.ac
@@ -4,6 +4,10 @@
AC_INIT(src/transport.h)
AM_INIT_AUTOMAKE(tbnet, 0.1)
+# Save this value here, since automake will set cppflags later
+cppflags_set=${CXXFLAGS+set}
+#CXXFLAGS="-O2 -Wall -Wno-deprecated -fPIC"
+
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
@@ -13,7 +17,6 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_LANG_CPLUSPLUS
-CXXFLAGS="-O3 -Wall -fPIC"
if test -n "${TBLIB_ROOT}"; then
ac_default_prefix=${TBLIB_ROOT}
Index: libtaobao-0.1/tbnet-0.1/src/Makefile.am
===================================================================
--- libtaobao-0.1.orig/tbnet-0.1/src/Makefile.am
+++ libtaobao-0.1/tbnet-0.1/src/Makefile.am
@@ -1,14 +1,69 @@
-AM_CPPFLAGS=-I$(TBLIB_ROOT)/include/tbsys
-source_list=channel.cpp channelpool.cpp connection.cpp controlpacket.cpp defaultpacketstreamer.cpp epollsocketevent.cpp httppacketstreamer.cpp httprequestpacket.cpp httpresponsepacket.cpp iocomponent.cpp packet.cpp packetqueue.cpp packetqueuethread.cpp serversocket.cpp socket.cpp socketevent.cpp stats.cpp tcpacceptor.cpp tcpcomponent.cpp tcpconnection.cpp transport.cpp udpcomponent.cpp udpconnection.cpp connectionmanager.cpp
+AM_LDFLAGS = -pthread
-AM_LDFLAGS="-lpthread"
-test_sources=
-lib_LTLIBRARIES=libtbnet.la
-libtbnet_la_SOURCES=$(source_list)
-libtbnet_la_LDFLAGS=$(AM_LDFLAGS) -static-libgcc
-include_HEADERS=channel.h channelpool.h connection.h controlpacket.h databuffer.h defaultpacketstreamer.h epollsocketevent.h httppacketstreamer.h httprequestpacket.h httpresponsepacket.h iocomponent.h ipacketfactory.h ipackethandler.h ipacketstreamer.h iserveradapter.h packet.h packetqueue.h packetqueuethread.h serversocket.h socketevent.h socket.h stats.h tbnet.h tcpacceptor.h tcpcomponent.h tcpconnection.h transport.h udpacceptor.h udpcomponent.h udpconnection.h connectionmanager.h
+INCLUDES = -I$(TBLIB_ROOT)/include/tbsys \
+ -I$(top_srcdir)/../tbsys-0.1/src/
-noinst_PROGRAMS=
+source_list = channel.cpp \
+ channelpool.cpp \
+ connection.cpp \
+ connectionmanager.cpp \
+ controlpacket.cpp \
+ defaultpacketstreamer.cpp \
+ epollsocketevent.cpp \
+ httppacketstreamer.cpp \
+ httprequestpacket.cpp \
+ httpresponsepacket.cpp \
+ iocomponent.cpp \
+ packet.cpp \
+ packetqueue.cpp \
+ packetqueuethread.cpp \
+ serversocket.cpp \
+ socket.cpp \
+ socketevent.cpp \
+ stats.cpp \
+ tcpacceptor.cpp \
+ tcpcomponent.cpp \
+ tcpconnection.cpp \
+ transport.cpp \
+ udpcomponent.cpp \
+ udpconnection.cpp
+test_sources=
+lib_LTLIBRARIES = libtbnet.la
+libtbnet_la_SOURCES = $(source_list)
+libtbnet_la_LDFLAGS= -lpthread
+include_HEADERS = channel.h \
+ channelpool.h \
+ connection.h \
+ connectionmanager.h \
+ controlpacket.h \
+ databuffer.h \
+ defaultpacketstreamer.h \
+ epollsocketevent.h \
+ httppacketstreamer.h \
+ httprequestpacket.h \
+ httpresponsepacket.h \
+ iocomponent.h \
+ ipacketfactory.h \
+ ipackethandler.h \
+ ipacketstreamer.h \
+ iserveradapter.h \
+ packet.h \
+ packetqueue.h \
+ packetqueuethread.h \
+ serversocket.h \
+ socketevent.h \
+ socket.h \
+ stats.h \
+ tbnet.h \
+ tcpacceptor.h \
+ tcpcomponent.h \
+ tcpconnection.h \
+ transport.h \
+ udpacceptor.h \
+ udpcomponent.h \
+ udpconnection.h
+
+noinst_PROGRAMS=
Index: libtaobao-0.1/tbnet-0.1/test/Makefile.am
===================================================================
--- libtaobao-0.1.orig/tbnet-0.1/test/Makefile.am
+++ libtaobao-0.1/tbnet-0.1/test/Makefile.am
@@ -1,8 +1,23 @@
-AM_CPPFLAGS=-I$(top_srcdir)/src -I$(top_srcdir)/../tbsys/src
-LDADD=$(top_srcdir)/src/.libs/libtbnet.a $(top_srcdir)/../tbsys/src/.libs/libtbsys.a
-AM_LDFLAGS=-lpthread
-
-noinst_PROGRAMS=echoserver echoclient httpserver
-echoserver_SOURCES=echoserver.cpp
-echoclient_SOURCES=echoclient.cpp
-httpserver_SOURCES=httpserver.cpp
+AM_LDFLAGS = -pthread
+
+INCLUDES=\
+ -I$(top_srcdir)/../tbsys-0.1/src/ \
+ -I$(top_srcdir)/src
+
+LDADD=\
+ $(top_srcdir)/src/.libs/libtbnet.a \
+ $(top_srcdir)/../tbsys-0.1/src/.libs/libtbsys.a
+
+
+noinst_PROGRAMS = echoserver \
+ echoclient \
+ httpserver
+
+echoserver_SOURCES = echoserver.cpp
+echoserver_LDFLAGS = $(AM_LDFLAGS)
+
+echoclient_SOURCES = echoclient.cpp
+echoclient_LDFLAGS = $(AM_LDFLAGS)
+
+httpserver_SOURCES = httpserver.cpp
+httpserver_LDFLAGS = $(AM_LDFLAGS)
Index: libtaobao-0.1/tbsys-0.1/src/Makefile.am
===================================================================
--- libtaobao-0.1.orig/tbsys-0.1/src/Makefile.am
+++ libtaobao-0.1/tbsys-0.1/src/Makefile.am
@@ -1,30 +1,85 @@
-source_list=config.cpp defaultrunnable.cpp filequeue.cpp \
- filequeuethread.cpp fileutil.cpp process.cpp \
- queuethread.cpp stringutil.cpp tblog.cpp \
- tbnetutil.cpp tbtimeutil.cpp tbrwlock.cpp\
- Utility.cpp Time.cpp Cond.cpp RecMutex.cpp \
- Shared.cpp TbThread.cpp StaticMutex.cpp Mutex.cpp\
- Exception.cpp ThreadException.cpp CtrlCHandler.cpp\
- Timer.cpp ThreadPool.cpp Service.cpp\
- Network.cpp profiler.cpp bytebuffer.cpp
+AM_LDFLAGS = -pthread
-AM_LDFLAGS="-lpthread -lm -lrt"
-lib_LTLIBRARIES=libtbsys.la
-libtbsys_la_SOURCES=$(source_list)
-libtbsys_la_LDFLAGS=$(AM_LDFLAGS) -static-libgcc
-include_HEADERS=atomic.h config.h defaultrunnable.h filequeue.h \
- filequeuethread.h fileutil.h iqueuehandler.h \
- process.h queuethread.h runnable.h stringutil.h \
- tblog.h tbnetutil.h tbsys.h tbtimeutil.h \
- threadcond.h thread.h threadmutex.h linklist.h \
- tbrwlock.h tblockguard.h PublicDefine.h Memory.hpp\
- Cond.h Functional.h Lock.h Network.h EventHandler.h\
- Service.h ThreadException.h Time.h Handle.h Monitor.h\
- RecMutex.h Shared.h TbThread.h Timer.h CtrlCHandler.h\
- Exception.h Mutex.h StaticMutex.h ThreadPool.h Utility.h \
- profiler.h bytebuffer.h
+source_list = config.cpp \
+ bytebuffer.cpp \
+ defaultrunnable.cpp \
+ filequeue.cpp \
+ filequeuethread.cpp \
+ fileutil.cpp \
+ process.cpp \
+ profiler.cpp \
+ queuethread.cpp \
+ stringutil.cpp \
+ tblog.cpp \
+ tbnetutil.cpp \
+ tbrwlock.cpp \
+ tbtimeutil.cpp \
+ Cond.cpp \
+ CtrlCHandler.cpp \
+ Exception.cpp \
+ Mutex.cpp \
+ Network.cpp \
+ RecMutex.cpp \
+ Service.cpp \
+ Shared.cpp \
+ StaticMutex.cpp \
+ TbThread.cpp \
+ ThreadException.cpp \
+ ThreadPool.cpp \
+ Time.cpp \
+ Timer.cpp \
+ Utility.cpp
-noinst_PROGRAMS=
+lib_LTLIBRARIES = libtbsys.la
+libtbsys_la_SOURCES = $(source_list)
+libtbsys_la_LDFLAGS = $(AM_LDFLAGS)
+libtbsys_la_LIBADD = -lm -lrt -lpthread
+include_HEADERS = atomic.h \
+ bytebuffer.h \
+ config.h \
+ defaultrunnable.h \
+ filequeue.h \
+ filequeuethread.h \
+ fileutil.h \
+ iqueuehandler.h \
+ linklist.h \
+ process.h \
+ profiler.h \
+ queuethread.h \
+ runnable.h \
+ stringutil.h \
+ tblockguard.h \
+ tblog.h \
+ tbrwlock.h \
+ tbsys.h \
+ tbtimeutil.h \
+ tbnetutil.h \
+ thread.h \
+ threadcond.h \
+ threadmutex.h \
+ Cond.h \
+ CtrlCHandler.h \
+ Exception.h \
+ EventHandler.h \
+ Functional.h \
+ Handle.h \
+ Lock.h \
+ Memory.hpp \
+ Monitor.h \
+ Mutex.h \
+ Network.h \
+ PublicDefine.h \
+ RecMutex.h \
+ Service.h \
+ Shared.h \
+ StaticMutex.h \
+ TbThread.h \
+ ThreadException.h \
+ ThreadPool.h \
+ Time.h \
+ Timer.h \
+ Utility.h
+noinst_PROGRAMS =