• 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 = testdata
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	-DPKGLIBDIR='"$(pkglibdir)"' \
39	-I$(top_srcdir)/lib/includes \
40	-I$(top_builddir)/lib/includes \
41	-I$(top_srcdir)/lib \
42	-I$(top_srcdir)/third-party \
43	-I$(top_srcdir)/third-party/llhttp/include \
44	@JEMALLOC_CFLAGS@ \
45	@LIBXML2_CFLAGS@ \
46	@LIBEV_CFLAGS@ \
47	@LIBNGHTTP3_CFLAGS@ \
48	@LIBNGTCP2_CRYPTO_WOLFSSL_CFLAGS@ \
49	@LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS@ \
50	@LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS@ \
51	@LIBNGTCP2_CFLAGS@ \
52	@WOLFSSL_CFLAGS@ \
53	@OPENSSL_CFLAGS@ \
54	@LIBCARES_CFLAGS@ \
55	@JANSSON_CFLAGS@ \
56	@LIBBPF_CFLAGS@ \
57	@ZLIB_CFLAGS@ \
58	@LIBBROTLIENC_CFLAGS@ \
59	@LIBBROTLIDEC_CFLAGS@ \
60	@EXTRA_DEFS@ \
61	@DEFS@
62AM_LDFLAGS = @LIBTOOL_LDFLAGS@
63
64LDADD = $(top_builddir)/lib/libnghttp2.la \
65	$(top_builddir)/third-party/liburl-parser.la \
66	$(top_builddir)/third-party/libllhttp.la \
67	@JEMALLOC_LIBS@ \
68	@LIBXML2_LIBS@ \
69	@LIBEV_LIBS@ \
70	@LIBNGHTTP3_LIBS@ \
71	@LIBNGTCP2_CRYPTO_WOLFSSL_LIBS@ \
72	@LIBNGTCP2_CRYPTO_QUICTLS_LIBS@ \
73	@LIBNGTCP2_CRYPTO_BORINGSSL_LIBS@ \
74	@LIBNGTCP2_LIBS@ \
75	@WOLFSSL_LIBS@ \
76	@OPENSSL_LIBS@ \
77	@LIBCARES_LIBS@ \
78	@SYSTEMD_LIBS@ \
79	@JANSSON_LIBS@ \
80	@LIBBPF_LIBS@ \
81	@ZLIB_LIBS@ \
82	@LIBBROTLIENC_LIBS@ \
83	@LIBBROTLIDEC_LIBS@ \
84	@APPLDFLAGS@
85
86if ENABLE_APP
87
88bin_PROGRAMS += nghttp nghttpd nghttpx
89
90HELPER_OBJECTS = util.cc \
91	http2.cc timegm.c app_helper.cc nghttp2_gzip.c
92HELPER_HFILES = util.h \
93	http2.h timegm.h app_helper.h nghttp2_config.h \
94	nghttp2_gzip.h network.h
95
96HTML_PARSER_OBJECTS =
97HTML_PARSER_HFILES = HtmlParser.h
98
99if HAVE_LIBXML2
100HTML_PARSER_OBJECTS += HtmlParser.cc
101endif # HAVE_LIBXML2
102
103nghttp_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttp.cc nghttp.h \
104	${HTML_PARSER_OBJECTS} ${HTML_PARSER_HFILES} \
105	tls.cc tls.h ssl_compat.h
106
107nghttpd_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttpd.cc \
108	tls.cc tls.h ssl_compat.h \
109	HttpServer.cc HttpServer.h
110
111bin_PROGRAMS += h2load
112
113h2load_SOURCES = util.cc util.h \
114	http2.cc http2.h h2load.cc h2load.h \
115	timegm.c timegm.h \
116	tls.cc tls.h ssl_compat.h \
117	h2load_session.h \
118	h2load_http2_session.cc h2load_http2_session.h \
119	h2load_http1_session.cc h2load_http1_session.h
120
121if ENABLE_HTTP3
122h2load_SOURCES += \
123	h2load_http3_session.cc h2load_http3_session.h \
124	h2load_quic.cc h2load_quic.h \
125	quic.cc quic.h
126endif # ENABLE_HTTP3
127
128NGHTTPX_SRCS = \
129	util.cc util.h http2.cc http2.h timegm.c timegm.h base64.h \
130	app_helper.cc app_helper.h \
131	tls.cc tls.h ssl_compat.h \
132	shrpx_config.cc shrpx_config.h \
133	shrpx_error.h \
134	shrpx_accept_handler.cc shrpx_accept_handler.h \
135	shrpx_connection_handler.cc shrpx_connection_handler.h \
136	shrpx_client_handler.cc shrpx_client_handler.h \
137	shrpx_upstream.h \
138	shrpx_http2_upstream.cc shrpx_http2_upstream.h \
139	shrpx_https_upstream.cc shrpx_https_upstream.h \
140	shrpx_downstream.cc shrpx_downstream.h \
141	shrpx_downstream_connection.cc shrpx_downstream_connection.h \
142	shrpx_http_downstream_connection.cc shrpx_http_downstream_connection.h \
143	shrpx_http2_downstream_connection.cc shrpx_http2_downstream_connection.h \
144	shrpx_http2_session.cc shrpx_http2_session.h \
145	shrpx_downstream_queue.cc shrpx_downstream_queue.h \
146	shrpx_log.cc shrpx_log.h \
147	shrpx_http.cc shrpx_http.h \
148	shrpx_io_control.cc shrpx_io_control.h \
149	shrpx_tls.cc shrpx_tls.h \
150	shrpx_worker.cc shrpx_worker.h \
151	shrpx_log_config.cc shrpx_log_config.h \
152	shrpx_connect_blocker.cc shrpx_connect_blocker.h \
153	shrpx_live_check.cc shrpx_live_check.h \
154	shrpx_downstream_connection_pool.cc shrpx_downstream_connection_pool.h \
155	shrpx_rate_limit.cc shrpx_rate_limit.h \
156	shrpx_connection.cc shrpx_connection.h \
157	shrpx_memcached_dispatcher.cc shrpx_memcached_dispatcher.h \
158	shrpx_memcached_connection.cc shrpx_memcached_connection.h \
159	shrpx_memcached_request.h \
160	shrpx_memcached_result.h \
161	shrpx_worker_process.cc shrpx_worker_process.h \
162	shrpx_process.h \
163	shrpx_signal.cc shrpx_signal.h \
164	shrpx_router.cc shrpx_router.h \
165	shrpx_api_downstream_connection.cc shrpx_api_downstream_connection.h \
166	shrpx_health_monitor_downstream_connection.cc \
167	shrpx_health_monitor_downstream_connection.h \
168	shrpx_null_downstream_connection.cc shrpx_null_downstream_connection.h \
169	shrpx_exec.cc shrpx_exec.h \
170	shrpx_dns_resolver.cc shrpx_dns_resolver.h \
171	shrpx_dual_dns_resolver.cc shrpx_dual_dns_resolver.h \
172	shrpx_dns_tracker.cc shrpx_dns_tracker.h \
173	buffer.h memchunk.h template.h allocator.h \
174	xsi_strerror.c xsi_strerror.h
175
176if HAVE_MRUBY
177NGHTTPX_SRCS += \
178	shrpx_mruby.cc shrpx_mruby.h \
179	shrpx_mruby_module.cc shrpx_mruby_module.h \
180	shrpx_mruby_module_env.cc shrpx_mruby_module_env.h \
181	shrpx_mruby_module_request.cc shrpx_mruby_module_request.h \
182	shrpx_mruby_module_response.cc shrpx_mruby_module_response.h
183endif # HAVE_MRUBY
184
185if ENABLE_HTTP3
186NGHTTPX_SRCS += \
187	shrpx_quic.cc shrpx_quic.h \
188	shrpx_quic_listener.cc shrpx_quic_listener.h \
189	shrpx_quic_connection_handler.cc shrpx_quic_connection_handler.h \
190	shrpx_http3_upstream.cc shrpx_http3_upstream.h \
191	http3.cc http3.h \
192	quic.cc quic.h
193endif # ENABLE_HTTP3
194
195noinst_LIBRARIES = libnghttpx.a
196libnghttpx_a_SOURCES = ${NGHTTPX_SRCS}
197libnghttpx_a_CPPFLAGS = ${AM_CPPFLAGS}
198
199nghttpx_SOURCES = shrpx.cc shrpx.h
200nghttpx_CPPFLAGS = ${libnghttpx_a_CPPFLAGS}
201nghttpx_LDADD = libnghttpx.a ${LDADD}
202
203if HAVE_MRUBY
204libnghttpx_a_CPPFLAGS += \
205	-I${top_srcdir}/third-party/mruby/include @LIBMRUBY_CFLAGS@
206nghttpx_LDADD += -L${top_builddir}/third-party/mruby/build/lib @LIBMRUBY_LIBS@
207endif # HAVE_MRUBY
208
209if HAVE_NEVERBLEED
210libnghttpx_a_CPPFLAGS += -I${top_srcdir}/third-party/neverbleed
211nghttpx_LDADD += ${top_builddir}/third-party/libneverbleed.la
212endif # HAVE_NEVERBLEED
213
214check_PROGRAMS += nghttpx-unittest
215nghttpx_unittest_SOURCES = shrpx-unittest.cc \
216	shrpx_tls_test.cc shrpx_tls_test.h \
217	shrpx_downstream_test.cc shrpx_downstream_test.h \
218	shrpx_config_test.cc shrpx_config_test.h \
219	shrpx_worker_test.cc shrpx_worker_test.h \
220	shrpx_http_test.cc shrpx_http_test.h \
221	shrpx_router_test.cc shrpx_router_test.h \
222	http2_test.cc http2_test.h \
223	util_test.cc util_test.h \
224	nghttp2_gzip_test.c nghttp2_gzip_test.h \
225	nghttp2_gzip.c nghttp2_gzip.h \
226	buffer_test.cc buffer_test.h \
227	memchunk_test.cc memchunk_test.h \
228	template_test.cc template_test.h \
229	base64_test.cc base64_test.h \
230	$(top_srcdir)/tests/munit/munit.c $(top_srcdir)/tests/munit/munit.h \
231	$(top_srcdir)/tests/munit/munitxx.h
232nghttpx_unittest_CPPFLAGS = ${AM_CPPFLAGS} \
233	-I$(top_srcdir)/tests/munit \
234	-DNGHTTP2_SRC_DIR=\"$(top_srcdir)/src\"
235nghttpx_unittest_LDADD = libnghttpx.a ${LDADD} @TESTLDADD@
236
237if HAVE_MRUBY
238nghttpx_unittest_CPPFLAGS += \
239	-I${top_srcdir}/third-party/mruby/include @LIBMRUBY_CFLAGS@
240nghttpx_unittest_LDADD += \
241	-L${top_builddir}/third-party/mruby/build/lib @LIBMRUBY_LIBS@
242endif # HAVE_MRUBY
243
244if HAVE_NEVERBLEED
245nghttpx_unittest_CPPFLAGS += -I${top_srcdir}/third-party/neverbleed
246nghttpx_unittest_LDADD += ${top_builddir}/third-party/libneverbleed.la
247endif # HAVE_NEVERBLEED
248
249TESTS += nghttpx-unittest
250
251endif # ENABLE_APP
252
253if ENABLE_HPACK_TOOLS
254
255bin_PROGRAMS += inflatehd deflatehd
256
257HPACK_TOOLS_COMMON_SRCS = \
258	comp_helper.c comp_helper.h \
259	util.cc util.h \
260	timegm.c timegm.h
261
262inflatehd_SOURCES = inflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
263
264deflatehd_SOURCES = deflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
265
266endif # ENABLE_HPACK_TOOLS
267