• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# nghttp2 - HTTP/2 C Library
2
3# Copyright (c) 2012 Tatsuhiro Tsujikawa
4
5# Permission is hereby granted, free of charge, to any person obtaining
6# a copy of this software and associated documentation files (the
7# "Software"), to deal in the Software without restriction, including
8# without limitation the rights to use, copy, modify, merge, publish,
9# distribute, sublicense, and/or sell copies of the Software, and to
10# permit persons to whom the Software is furnished to do so, subject to
11# the following conditions:
12
13# The above copyright notice and this permission notice shall be
14# included in all copies or substantial portions of the Software.
15
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23SUBDIRS = includes
24
25EXTRA_DIST = \
26	CMakeLists.txt \
27	test.example.com.pem \
28	test.nghttp2.org.pem
29
30bin_PROGRAMS =
31check_PROGRAMS =
32TESTS =
33
34AM_CFLAGS = $(WARNCFLAGS)
35AM_CXXFLAGS = $(WARNCXXFLAGS) $(CXX1XCXXFLAGS)
36AM_CPPFLAGS = \
37	-DPKGDATADIR='"$(pkgdatadir)"' \
38	-I$(top_srcdir)/lib/includes \
39	-I$(top_builddir)/lib/includes \
40	-I$(top_srcdir)/lib \
41	-I$(top_srcdir)/src/includes \
42	-I$(top_srcdir)/third-party \
43	-I$(top_srcdir)/third-party/llhttp/include \
44	@LIBXML2_CFLAGS@ \
45	@LIBEV_CFLAGS@ \
46	@OPENSSL_CFLAGS@ \
47	@LIBCARES_CFLAGS@ \
48	@JANSSON_CFLAGS@ \
49	@ZLIB_CFLAGS@ \
50	@DEFS@
51
52LDADD = $(top_builddir)/lib/libnghttp2.la \
53	$(top_builddir)/third-party/liburl-parser.la \
54	$(top_builddir)/third-party/libllhttp.la \
55	@JEMALLOC_LIBS@ \
56	@LIBXML2_LIBS@ \
57	@LIBEV_LIBS@ \
58	@OPENSSL_LIBS@ \
59	@LIBCARES_LIBS@ \
60	@SYSTEMD_LIBS@ \
61	@JANSSON_LIBS@ \
62	@ZLIB_LIBS@ \
63	@APPLDFLAGS@
64
65if ENABLE_APP
66
67bin_PROGRAMS += nghttp nghttpd nghttpx
68
69HELPER_OBJECTS = util.cc \
70	http2.cc timegm.c app_helper.cc nghttp2_gzip.c
71HELPER_HFILES = util.h \
72	http2.h timegm.h app_helper.h nghttp2_config.h \
73	nghttp2_gzip.h network.h
74
75HTML_PARSER_OBJECTS =
76HTML_PARSER_HFILES = HtmlParser.h
77
78if HAVE_LIBXML2
79HTML_PARSER_OBJECTS += HtmlParser.cc
80endif # HAVE_LIBXML2
81
82nghttp_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttp.cc nghttp.h \
83	${HTML_PARSER_OBJECTS} ${HTML_PARSER_HFILES} \
84	tls.cc tls.h
85
86nghttpd_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttpd.cc \
87	tls.cc tls.h \
88	HttpServer.cc HttpServer.h
89
90bin_PROGRAMS += h2load
91
92h2load_SOURCES = util.cc util.h \
93	http2.cc http2.h h2load.cc h2load.h \
94	timegm.c timegm.h \
95	tls.cc tls.h \
96	h2load_session.h \
97	h2load_http2_session.cc h2load_http2_session.h \
98	h2load_http1_session.cc h2load_http1_session.h
99
100NGHTTPX_SRCS = \
101	util.cc util.h http2.cc http2.h timegm.c timegm.h base64.h \
102	app_helper.cc app_helper.h \
103	tls.cc tls.h \
104	shrpx_config.cc shrpx_config.h \
105	shrpx_error.h \
106	shrpx_accept_handler.cc shrpx_accept_handler.h \
107	shrpx_connection_handler.cc shrpx_connection_handler.h \
108	shrpx_client_handler.cc shrpx_client_handler.h \
109	shrpx_upstream.h \
110	shrpx_http2_upstream.cc shrpx_http2_upstream.h \
111	shrpx_https_upstream.cc shrpx_https_upstream.h \
112	shrpx_downstream.cc shrpx_downstream.h \
113	shrpx_downstream_connection.cc shrpx_downstream_connection.h \
114	shrpx_http_downstream_connection.cc shrpx_http_downstream_connection.h \
115	shrpx_http2_downstream_connection.cc shrpx_http2_downstream_connection.h \
116	shrpx_http2_session.cc shrpx_http2_session.h \
117	shrpx_downstream_queue.cc shrpx_downstream_queue.h \
118	shrpx_log.cc shrpx_log.h \
119	shrpx_http.cc shrpx_http.h \
120	shrpx_io_control.cc shrpx_io_control.h \
121	shrpx_tls.cc shrpx_tls.h \
122	shrpx_worker.cc shrpx_worker.h \
123	shrpx_log_config.cc shrpx_log_config.h \
124	shrpx_connect_blocker.cc shrpx_connect_blocker.h \
125	shrpx_live_check.cc shrpx_live_check.h \
126	shrpx_downstream_connection_pool.cc shrpx_downstream_connection_pool.h \
127	shrpx_rate_limit.cc shrpx_rate_limit.h \
128	shrpx_connection.cc shrpx_connection.h \
129	shrpx_memcached_dispatcher.cc shrpx_memcached_dispatcher.h \
130	shrpx_memcached_connection.cc shrpx_memcached_connection.h \
131	shrpx_memcached_request.h \
132	shrpx_memcached_result.h \
133	shrpx_worker_process.cc shrpx_worker_process.h \
134	shrpx_process.h \
135	shrpx_signal.cc shrpx_signal.h \
136	shrpx_router.cc shrpx_router.h \
137	shrpx_api_downstream_connection.cc shrpx_api_downstream_connection.h \
138	shrpx_health_monitor_downstream_connection.cc \
139	shrpx_health_monitor_downstream_connection.h \
140	shrpx_exec.cc shrpx_exec.h \
141	shrpx_dns_resolver.cc shrpx_dns_resolver.h \
142	shrpx_dual_dns_resolver.cc shrpx_dual_dns_resolver.h \
143	shrpx_dns_tracker.cc shrpx_dns_tracker.h \
144	buffer.h memchunk.h template.h allocator.h \
145	xsi_strerror.c xsi_strerror.h
146
147if HAVE_MRUBY
148NGHTTPX_SRCS += \
149	shrpx_mruby.cc shrpx_mruby.h \
150	shrpx_mruby_module.cc shrpx_mruby_module.h \
151	shrpx_mruby_module_env.cc shrpx_mruby_module_env.h \
152	shrpx_mruby_module_request.cc shrpx_mruby_module_request.h \
153	shrpx_mruby_module_response.cc shrpx_mruby_module_response.h
154endif # HAVE_MRUBY
155
156noinst_LIBRARIES = libnghttpx.a
157libnghttpx_a_SOURCES = ${NGHTTPX_SRCS}
158libnghttpx_a_CPPFLAGS = ${AM_CPPFLAGS}
159
160nghttpx_SOURCES = shrpx.cc shrpx.h
161nghttpx_CPPFLAGS = ${libnghttpx_a_CPPFLAGS}
162nghttpx_LDADD = libnghttpx.a ${LDADD}
163
164if HAVE_MRUBY
165libnghttpx_a_CPPFLAGS += \
166	-I${top_srcdir}/third-party/mruby/include @LIBMRUBY_CFLAGS@
167nghttpx_LDADD += -L${top_builddir}/third-party/mruby/build/lib @LIBMRUBY_LIBS@
168endif # HAVE_MRUBY
169
170if HAVE_NEVERBLEED
171libnghttpx_a_CPPFLAGS += -I${top_srcdir}/third-party/neverbleed
172nghttpx_LDADD += ${top_builddir}/third-party/libneverbleed.la
173endif # HAVE_NEVERBLEED
174
175if HAVE_CUNIT
176check_PROGRAMS += nghttpx-unittest
177nghttpx_unittest_SOURCES = shrpx-unittest.cc \
178	shrpx_tls_test.cc shrpx_tls_test.h \
179	shrpx_downstream_test.cc shrpx_downstream_test.h \
180	shrpx_config_test.cc shrpx_config_test.h \
181	shrpx_worker_test.cc shrpx_worker_test.h \
182	shrpx_http_test.cc shrpx_http_test.h \
183	shrpx_router_test.cc shrpx_router_test.h \
184	http2_test.cc http2_test.h \
185	util_test.cc util_test.h \
186	nghttp2_gzip_test.c nghttp2_gzip_test.h \
187	nghttp2_gzip.c nghttp2_gzip.h \
188	buffer_test.cc buffer_test.h \
189	memchunk_test.cc memchunk_test.h \
190	template_test.cc template_test.h \
191	base64_test.cc base64_test.h
192nghttpx_unittest_CPPFLAGS = ${AM_CPPFLAGS} \
193	-DNGHTTP2_SRC_DIR=\"$(top_srcdir)/src\"
194nghttpx_unittest_LDADD = libnghttpx.a ${LDADD} @CUNIT_LIBS@ @TESTLDADD@
195
196if HAVE_MRUBY
197nghttpx_unittest_CPPFLAGS += \
198	-I${top_srcdir}/third-party/mruby/include @LIBMRUBY_CFLAGS@
199nghttpx_unittest_LDADD += \
200	-L${top_builddir}/third-party/mruby/build/lib @LIBMRUBY_LIBS@
201endif # HAVE_MRUBY
202
203if HAVE_NEVERBLEED
204nghttpx_unittest_CPPFLAGS += -I${top_srcdir}/third-party/neverbleed
205nghttpx_unittest_LDADD += ${top_builddir}/third-party/libneverbleed.la
206endif # HAVE_NEVERBLEED
207
208TESTS += nghttpx-unittest
209endif # HAVE_CUNIT
210
211endif # ENABLE_APP
212
213if ENABLE_HPACK_TOOLS
214
215bin_PROGRAMS += inflatehd deflatehd
216
217HPACK_TOOLS_COMMON_SRCS = comp_helper.c comp_helper.h
218
219inflatehd_SOURCES = inflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
220
221deflatehd_SOURCES = deflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
222
223endif # ENABLE_HPACK_TOOLS
224
225if ENABLE_ASIO_LIB
226
227pkgconfigdir = $(libdir)/pkgconfig
228pkgconfig_DATA = libnghttp2_asio.pc
229DISTCLEANFILES = $(pkgconfig_DATA)
230
231lib_LTLIBRARIES = libnghttp2_asio.la
232
233libnghttp2_asio_la_SOURCES = \
234	util.cc util.h http2.cc http2.h \
235	tls.cc tls.h \
236	ssl_compat.h \
237	timegm.c timegm.h \
238	asio_common.cc asio_common.h \
239	asio_io_service_pool.cc asio_io_service_pool.h \
240	asio_server_http2.cc \
241	asio_server_http2_impl.cc asio_server_http2_impl.h \
242	asio_server.cc asio_server.h \
243	asio_server_http2_handler.cc asio_server_http2_handler.h \
244	asio_server_connection.h \
245	asio_server_request.cc \
246	asio_server_request_impl.cc asio_server_request_impl.h \
247	asio_server_response.cc \
248	asio_server_response_impl.cc asio_server_response_impl.h \
249	asio_server_stream.cc asio_server_stream.h \
250	asio_server_serve_mux.cc asio_server_serve_mux.h \
251	asio_server_request_handler.cc asio_server_request_handler.h \
252	asio_server_tls_context.cc asio_server_tls_context.h \
253	asio_client_session.cc \
254	asio_client_session_impl.cc asio_client_session_impl.h \
255	asio_client_session_tcp_impl.cc asio_client_session_tcp_impl.h \
256	asio_client_session_tls_impl.cc asio_client_session_tls_impl.h \
257	asio_client_response.cc \
258	asio_client_response_impl.cc asio_client_response_impl.h \
259	asio_client_request.cc \
260	asio_client_request_impl.cc asio_client_request_impl.h \
261	asio_client_stream.cc asio_client_stream.h \
262	asio_client_tls_context.cc asio_client_tls_context.h
263
264libnghttp2_asio_la_CPPFLAGS = ${AM_CPPFLAGS} ${BOOST_CPPFLAGS}
265libnghttp2_asio_la_LDFLAGS = -no-undefined -version-info 1:0:0
266libnghttp2_asio_la_LIBADD = \
267	$(top_builddir)/lib/libnghttp2.la \
268	$(top_builddir)/third-party/liburl-parser.la \
269	$(top_builddir)/third-party/libllhttp.la \
270	@OPENSSL_LIBS@ \
271	${BOOST_LDFLAGS} \
272	${BOOST_ASIO_LIB} \
273	${BOOST_THREAD_LIB} \
274	${BOOST_SYSTEM_LIB}
275
276endif # ENABLE_ASIO_LIB
277