1#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10#   http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
19
20AUTOMAKE_OPTIONS = subdir-objects nostdinc
21
22moc__%.cpp: %.h
23	$(QT5_MOC) $(QT5_CFLAGS) $< -o $@
24
25SUBDIRS = .
26
27if WITH_TESTS
28SUBDIRS += test
29endif
30
31pkgconfigdir = $(libdir)/pkgconfig
32
33lib_LTLIBRARIES = libthrift.la
34pkgconfig_DATA = thrift.pc
35libthrift_la_LDFLAGS = -release $(VERSION)
36libthrift_la_LIBADD = $(BOOST_LDFLAGS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS)
37
38## We only build the extra libraries if we have the dependencies,
39## but we install all of the headers unconditionally.
40if AMX_HAVE_LIBEVENT
41lib_LTLIBRARIES += libthriftnb.la
42pkgconfig_DATA += thrift-nb.pc
43endif
44if AMX_HAVE_ZLIB
45lib_LTLIBRARIES += libthriftz.la
46pkgconfig_DATA += thrift-z.pc
47endif
48if AMX_HAVE_QT5
49lib_LTLIBRARIES += libthriftqt5.la
50pkgconfig_DATA += thrift-qt5.pc
51endif
52
53AM_CXXFLAGS = -Wall -Wextra -pedantic
54AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(OPENSSL_INCLUDES) -I$(srcdir)/src -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
55
56# Define the source files for the module
57
58libthrift_la_SOURCES = src/thrift/TApplicationException.cpp \
59                       src/thrift/TOutput.cpp \
60                       src/thrift/VirtualProfiling.cpp \
61                       src/thrift/async/TAsyncChannel.cpp \
62                       src/thrift/async/TAsyncProtocolProcessor.cpp \
63                       src/thrift/async/TConcurrentClientSyncInfo.cpp \
64                       src/thrift/concurrency/ThreadManager.cpp \
65                       src/thrift/concurrency/TimerManager.cpp \
66                       src/thrift/processor/PeekProcessor.cpp \
67                       src/thrift/protocol/TDebugProtocol.cpp \
68                       src/thrift/protocol/TJSONProtocol.cpp \
69                       src/thrift/protocol/TBase64Utils.cpp \
70                       src/thrift/protocol/TMultiplexedProtocol.cpp \
71                       src/thrift/protocol/TProtocol.cpp \
72                       src/thrift/transport/TTransportException.cpp \
73                       src/thrift/transport/TFDTransport.cpp \
74                       src/thrift/transport/TFileTransport.cpp \
75                       src/thrift/transport/TSimpleFileTransport.cpp \
76                       src/thrift/transport/THttpTransport.cpp \
77                       src/thrift/transport/THttpClient.cpp \
78                       src/thrift/transport/THttpServer.cpp \
79                       src/thrift/transport/TSocket.cpp \
80                       src/thrift/transport/TPipe.cpp \
81                       src/thrift/transport/TPipeServer.cpp \
82                       src/thrift/transport/TSSLSocket.cpp \
83                       src/thrift/transport/TSocketPool.cpp \
84                       src/thrift/transport/TServerSocket.cpp \
85                       src/thrift/transport/TSSLServerSocket.cpp \
86                       src/thrift/transport/TNonblockingServerSocket.cpp \
87                       src/thrift/transport/TNonblockingSSLServerSocket.cpp \
88                       src/thrift/transport/TTransportUtils.cpp \
89                       src/thrift/transport/TBufferTransports.cpp \
90                       src/thrift/transport/TWebSocketServer.cpp \
91                       src/thrift/transport/SocketCommon.cpp \
92                       src/thrift/server/TConnectedClient.cpp \
93                       src/thrift/server/TServer.cpp \
94                       src/thrift/server/TServerFramework.cpp \
95                       src/thrift/server/TSimpleServer.cpp \
96                       src/thrift/server/TThreadPoolServer.cpp \
97                       src/thrift/server/TThreadedServer.cpp
98
99libthrift_la_SOURCES += src/thrift/concurrency/Mutex.cpp \
100						src/thrift/concurrency/ThreadFactory.cpp \
101						src/thrift/concurrency/Thread.cpp \
102                        src/thrift/concurrency/Monitor.cpp
103
104libthriftnb_la_SOURCES = src/thrift/server/TNonblockingServer.cpp \
105                         src/thrift/async/TEvhttpServer.cpp \
106                         src/thrift/async/TEvhttpClientChannel.cpp
107
108libthriftz_la_SOURCES = src/thrift/transport/TZlibTransport.cpp \
109                        src/thrift/transport/THeaderTransport.cpp \
110                        src/thrift/protocol/THeaderProtocol.cpp
111
112
113libthriftqt5_la_MOC = src/thrift/qt/moc__TQTcpServer.cpp
114nodist_libthriftqt5_la_SOURCES = $(libthriftqt5_la_MOC)
115libthriftqt5_la_SOURCES = src/thrift/qt/TQIODeviceTransport.cpp \
116                          src/thrift/qt/TQTcpServer.cpp
117CLEANFILES = $(libthriftqt5_la_MOC)
118
119# Flags for the various libraries
120libthriftnb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBEVENT_CPPFLAGS)
121libthriftz_la_CPPFLAGS  = $(AM_CPPFLAGS) $(ZLIB_CPPFLAGS)
122libthriftqt5_la_CPPFLAGS = $(AM_CPPFLAGS) $(QT5_CFLAGS)
123if QT5_REDUCE_RELOCATIONS
124libthriftqt5_la_CPPFLAGS += -fPIC
125endif
126libthriftnb_la_CXXFLAGS = $(AM_CXXFLAGS)
127libthriftz_la_CXXFLAGS  = $(AM_CXXFLAGS)
128libthriftqt5_la_CXXFLAGS  = $(AM_CXXFLAGS)
129libthriftnb_la_LDFLAGS  = -release $(VERSION) $(BOOST_LDFLAGS)
130libthriftz_la_LDFLAGS   = -release $(VERSION) $(BOOST_LDFLAGS) $(ZLIB_LDFLAGS) $(ZLIB_LIBS)
131libthriftqt5_la_LDFLAGS   = -release $(VERSION) $(BOOST_LDFLAGS) $(QT5_LIBS)
132
133include_thriftdir = $(includedir)/thrift
134include_thrift_HEADERS = \
135                         $(top_builddir)/config.h \
136                         src/thrift/numeric_cast.h \
137                         src/thrift/thrift-config.h \
138                         src/thrift/thrift_export.h \
139                         src/thrift/TDispatchProcessor.h \
140                         src/thrift/Thrift.h \
141                         src/thrift/TOutput.h \
142                         src/thrift/TProcessor.h \
143                         src/thrift/TApplicationException.h \
144                         src/thrift/TLogging.h \
145                         src/thrift/TToString.h \
146                         src/thrift/TBase.h \
147                         src/thrift/TConfiguration.h \
148                         src/thrift/TNonCopyable.h
149
150include_concurrencydir = $(include_thriftdir)/concurrency
151include_concurrency_HEADERS = \
152                         src/thrift/concurrency/Exception.h \
153                         src/thrift/concurrency/Mutex.h \
154                         src/thrift/concurrency/Monitor.h \
155                         src/thrift/concurrency/ThreadFactory.h \
156                         src/thrift/concurrency/Thread.h \
157                         src/thrift/concurrency/ThreadManager.h \
158                         src/thrift/concurrency/TimerManager.h \
159                         src/thrift/concurrency/FunctionRunner.h
160
161include_protocoldir = $(include_thriftdir)/protocol
162include_protocol_HEADERS = \
163                         src/thrift/protocol/TEnum.h \
164                         src/thrift/protocol/TList.h \
165                         src/thrift/protocol/TSet.h \
166                         src/thrift/protocol/TMap.h \
167                         src/thrift/protocol/TBinaryProtocol.h \
168                         src/thrift/protocol/TBinaryProtocol.tcc \
169                         src/thrift/protocol/TCompactProtocol.h \
170                         src/thrift/protocol/TCompactProtocol.tcc \
171                         src/thrift/protocol/TDebugProtocol.h \
172                         src/thrift/protocol/THeaderProtocol.h \
173                         src/thrift/protocol/TBase64Utils.h \
174                         src/thrift/protocol/TJSONProtocol.h \
175                         src/thrift/protocol/TMultiplexedProtocol.h \
176                         src/thrift/protocol/TProtocolDecorator.h \
177                         src/thrift/protocol/TProtocolTap.h \
178                         src/thrift/protocol/TProtocolTypes.h \
179                         src/thrift/protocol/TProtocolException.h \
180                         src/thrift/protocol/TVirtualProtocol.h \
181                         src/thrift/protocol/TProtocol.h
182
183include_transportdir = $(include_thriftdir)/transport
184include_transport_HEADERS = \
185                         src/thrift/transport/PlatformSocket.h \
186                         src/thrift/transport/TFDTransport.h \
187                         src/thrift/transport/TFileTransport.h \
188                         src/thrift/transport/THeaderTransport.h \
189                         src/thrift/transport/TSimpleFileTransport.h \
190                         src/thrift/transport/TServerSocket.h \
191                         src/thrift/transport/TSSLServerSocket.h \
192                         src/thrift/transport/TServerTransport.h \
193                         src/thrift/transport/TNonblockingServerTransport.h \
194                         src/thrift/transport/TNonblockingServerSocket.h \
195                         src/thrift/transport/TNonblockingSSLServerSocket.h \
196                         src/thrift/transport/THttpTransport.h \
197                         src/thrift/transport/THttpClient.h \
198                         src/thrift/transport/THttpServer.h \
199                         src/thrift/transport/TSocket.h \
200                         src/thrift/transport/TSocketUtils.h \
201                         src/thrift/transport/TPipe.h \
202                         src/thrift/transport/TPipeServer.h \
203                         src/thrift/transport/TSSLSocket.h \
204                         src/thrift/transport/TSocketPool.h \
205                         src/thrift/transport/TVirtualTransport.h \
206                         src/thrift/transport/TTransport.h \
207                         src/thrift/transport/TTransportException.h \
208                         src/thrift/transport/TTransportUtils.h \
209                         src/thrift/transport/TBufferTransports.h \
210                         src/thrift/transport/TShortReadTransport.h \
211                         src/thrift/transport/TZlibTransport.h \
212                         src/thrift/transport/TWebSocketServer.h \
213                         src/thrift/transport/SocketCommon.h
214
215include_serverdir = $(include_thriftdir)/server
216include_server_HEADERS = \
217                         src/thrift/server/TConnectedClient.h \
218                         src/thrift/server/TServer.h \
219                         src/thrift/server/TServerFramework.h \
220                         src/thrift/server/TSimpleServer.h \
221                         src/thrift/server/TThreadPoolServer.h \
222                         src/thrift/server/TThreadedServer.h \
223                         src/thrift/server/TNonblockingServer.h
224
225include_processordir = $(include_thriftdir)/processor
226include_processor_HEADERS = \
227                         src/thrift/processor/PeekProcessor.h \
228                         src/thrift/processor/StatsProcessor.h \
229                         src/thrift/processor/TMultiplexedProcessor.h
230
231include_asyncdir = $(include_thriftdir)/async
232include_async_HEADERS = \
233                     src/thrift/async/TAsyncChannel.h \
234                     src/thrift/async/TAsyncDispatchProcessor.h \
235                     src/thrift/async/TAsyncProcessor.h \
236                     src/thrift/async/TAsyncBufferProcessor.h \
237                     src/thrift/async/TAsyncProtocolProcessor.h \
238                     src/thrift/async/TConcurrentClientSyncInfo.h \
239                     src/thrift/async/TEvhttpClientChannel.h \
240                     src/thrift/async/TEvhttpServer.h
241
242include_qtdir = $(include_thriftdir)/qt
243include_qt_HEADERS = \
244                  src/thrift/qt/TQIODeviceTransport.h \
245                  src/thrift/qt/TQTcpServer.h
246
247WINDOWS_DIST = \
248             src/thrift/windows \
249             thrift.sln \
250             libthrift.vcxproj \
251             libthrift.vcxproj.filters \
252             libthriftnb.vcxproj \
253             libthriftnb.vcxproj.filters \
254             3rdparty.props
255
256EXTRA_DIST = \
257             CMakeLists.txt \
258             coding_standards.md \
259             README.md \
260             thrift-nb.pc.in \
261             thrift.pc.in \
262             thrift-z.pc.in \
263             thrift-qt5.pc.in \
264             src/thrift/qt/CMakeLists.txt \
265             $(WINDOWS_DIST)
266
267style-local:
268	$(CPPSTYLE_CMD)
269