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