1 # nghttp2 - HTTP/2 C Library
3 # Copyright (c) 2012 Tatsuhiro Tsujikawa
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:
13 # The above copyright notice and this permission notice shall be
14 # included in all copies or substantial portions of the Software.
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.
27 test.example.com.pem \
34 AM_CFLAGS = $(WARNCFLAGS) -fPIE
35 AM_CXXFLAGS = $(WARNCXXFLAGS) $(CXX1XCXXFLAGS)
37 -DPKGDATADIR='"$(pkgdatadir)"' \
38 -I$(top_srcdir)/lib/includes \
39 -I$(top_builddir)/lib/includes \
41 -I$(top_srcdir)/src/includes \
42 -I$(top_srcdir)/third-party \
43 -I$(top_srcdir)/third-party/llhttp/include \
53 LDADD = $(top_builddir)/lib/libnghttp2.la \
54 $(top_builddir)/third-party/liburl-parser.la \
55 $(top_builddir)/third-party/libllhttp.la \
68 bin_PROGRAMS += nghttp nghttpd nghttpx
70 HELPER_OBJECTS = util.cc \
71 http2.cc timegm.c app_helper.cc nghttp2_gzip.c
72 HELPER_HFILES = util.h \
73 http2.h timegm.h app_helper.h nghttp2_config.h \
74 nghttp2_gzip.h network.h
77 HTML_PARSER_HFILES = HtmlParser.h
80 HTML_PARSER_OBJECTS += HtmlParser.cc
83 nghttp_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttp.cc nghttp.h \
84 ${HTML_PARSER_OBJECTS} ${HTML_PARSER_HFILES} \
87 nghttpd_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttpd.cc \
89 HttpServer.cc HttpServer.h
91 bin_PROGRAMS += h2load
93 h2load_SOURCES = util.cc util.h \
94 http2.cc http2.h h2load.cc h2load.h \
98 h2load_http2_session.cc h2load_http2_session.h \
99 h2load_http1_session.cc h2load_http1_session.h
102 util.cc util.h http2.cc http2.h timegm.c timegm.h base64.h \
103 app_helper.cc app_helper.h \
105 shrpx_config.cc shrpx_config.h \
107 shrpx_accept_handler.cc shrpx_accept_handler.h \
108 shrpx_connection_handler.cc shrpx_connection_handler.h \
109 shrpx_client_handler.cc shrpx_client_handler.h \
111 shrpx_http2_upstream.cc shrpx_http2_upstream.h \
112 shrpx_https_upstream.cc shrpx_https_upstream.h \
113 shrpx_downstream.cc shrpx_downstream.h \
114 shrpx_downstream_connection.cc shrpx_downstream_connection.h \
115 shrpx_http_downstream_connection.cc shrpx_http_downstream_connection.h \
116 shrpx_http2_downstream_connection.cc shrpx_http2_downstream_connection.h \
117 shrpx_http2_session.cc shrpx_http2_session.h \
118 shrpx_downstream_queue.cc shrpx_downstream_queue.h \
119 shrpx_log.cc shrpx_log.h \
120 shrpx_http.cc shrpx_http.h \
121 shrpx_io_control.cc shrpx_io_control.h \
122 shrpx_tls.cc shrpx_tls.h \
123 shrpx_worker.cc shrpx_worker.h \
124 shrpx_log_config.cc shrpx_log_config.h \
125 shrpx_connect_blocker.cc shrpx_connect_blocker.h \
126 shrpx_live_check.cc shrpx_live_check.h \
127 shrpx_downstream_connection_pool.cc shrpx_downstream_connection_pool.h \
128 shrpx_rate_limit.cc shrpx_rate_limit.h \
129 shrpx_connection.cc shrpx_connection.h \
130 shrpx_memcached_dispatcher.cc shrpx_memcached_dispatcher.h \
131 shrpx_memcached_connection.cc shrpx_memcached_connection.h \
132 shrpx_memcached_request.h \
133 shrpx_memcached_result.h \
134 shrpx_worker_process.cc shrpx_worker_process.h \
136 shrpx_signal.cc shrpx_signal.h \
137 shrpx_router.cc shrpx_router.h \
138 shrpx_api_downstream_connection.cc shrpx_api_downstream_connection.h \
139 shrpx_health_monitor_downstream_connection.cc \
140 shrpx_health_monitor_downstream_connection.h \
141 shrpx_exec.cc shrpx_exec.h \
142 shrpx_dns_resolver.cc shrpx_dns_resolver.h \
143 shrpx_dual_dns_resolver.cc shrpx_dual_dns_resolver.h \
144 shrpx_dns_tracker.cc shrpx_dns_tracker.h \
145 buffer.h memchunk.h template.h allocator.h \
146 xsi_strerror.c xsi_strerror.h
150 shrpx_mruby.cc shrpx_mruby.h \
151 shrpx_mruby_module.cc shrpx_mruby_module.h \
152 shrpx_mruby_module_env.cc shrpx_mruby_module_env.h \
153 shrpx_mruby_module_request.cc shrpx_mruby_module_request.h \
154 shrpx_mruby_module_response.cc shrpx_mruby_module_response.h
157 noinst_LIBRARIES = libnghttpx.a
158 libnghttpx_a_SOURCES = ${NGHTTPX_SRCS}
159 libnghttpx_a_CPPFLAGS = ${AM_CPPFLAGS}
161 nghttpx_SOURCES = shrpx.cc shrpx.h
162 nghttpx_CPPFLAGS = ${libnghttpx_a_CPPFLAGS}
163 nghttpx_LDADD = libnghttpx.a ${LDADD}
164 nghttpx_LDFLAGS = -pie
167 libnghttpx_a_CPPFLAGS += \
168 -I${top_srcdir}/third-party/mruby/include @LIBMRUBY_CFLAGS@
169 nghttpx_LDADD += -L${top_builddir}/third-party/mruby/build/lib @LIBMRUBY_LIBS@
173 libnghttpx_a_CPPFLAGS += -I${top_srcdir}/third-party/neverbleed
174 nghttpx_LDADD += ${top_builddir}/third-party/libneverbleed.la
175 endif # HAVE_NEVERBLEED
178 check_PROGRAMS += nghttpx-unittest
179 nghttpx_unittest_SOURCES = shrpx-unittest.cc \
180 shrpx_tls_test.cc shrpx_tls_test.h \
181 shrpx_downstream_test.cc shrpx_downstream_test.h \
182 shrpx_config_test.cc shrpx_config_test.h \
183 shrpx_worker_test.cc shrpx_worker_test.h \
184 shrpx_http_test.cc shrpx_http_test.h \
185 shrpx_router_test.cc shrpx_router_test.h \
186 http2_test.cc http2_test.h \
187 util_test.cc util_test.h \
188 nghttp2_gzip_test.c nghttp2_gzip_test.h \
189 nghttp2_gzip.c nghttp2_gzip.h \
190 buffer_test.cc buffer_test.h \
191 memchunk_test.cc memchunk_test.h \
192 template_test.cc template_test.h \
193 base64_test.cc base64_test.h
194 nghttpx_unittest_CPPFLAGS = ${AM_CPPFLAGS} \
195 -DNGHTTP2_SRC_DIR=\"$(top_srcdir)/src\"
196 nghttpx_unittest_LDADD = libnghttpx.a ${LDADD} @CUNIT_LIBS@ @TESTLDADD@
199 nghttpx_unittest_CPPFLAGS += \
200 -I${top_srcdir}/third-party/mruby/include @LIBMRUBY_CFLAGS@
201 nghttpx_unittest_LDADD += \
202 -L${top_builddir}/third-party/mruby/build/lib @LIBMRUBY_LIBS@
206 nghttpx_unittest_CPPFLAGS += -I${top_srcdir}/third-party/neverbleed
207 nghttpx_unittest_LDADD += ${top_builddir}/third-party/libneverbleed.la
208 endif # HAVE_NEVERBLEED
210 TESTS += nghttpx-unittest
215 if ENABLE_HPACK_TOOLS
217 bin_PROGRAMS += inflatehd deflatehd
219 HPACK_TOOLS_COMMON_SRCS = comp_helper.c comp_helper.h
221 inflatehd_SOURCES = inflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
223 deflatehd_SOURCES = deflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
225 endif # ENABLE_HPACK_TOOLS
229 pkgconfigdir = $(libdir)/pkgconfig
230 pkgconfig_DATA = libnghttp2_asio.pc
231 DISTCLEANFILES = $(pkgconfig_DATA)
233 lib_LTLIBRARIES = libnghttp2_asio.la
235 libnghttp2_asio_la_SOURCES = \
236 util.cc util.h http2.cc http2.h \
240 asio_common.cc asio_common.h \
241 asio_io_service_pool.cc asio_io_service_pool.h \
242 asio_server_http2.cc \
243 asio_server_http2_impl.cc asio_server_http2_impl.h \
244 asio_server.cc asio_server.h \
245 asio_server_http2_handler.cc asio_server_http2_handler.h \
246 asio_server_connection.h \
247 asio_server_request.cc \
248 asio_server_request_impl.cc asio_server_request_impl.h \
249 asio_server_response.cc \
250 asio_server_response_impl.cc asio_server_response_impl.h \
251 asio_server_stream.cc asio_server_stream.h \
252 asio_server_serve_mux.cc asio_server_serve_mux.h \
253 asio_server_request_handler.cc asio_server_request_handler.h \
254 asio_server_tls_context.cc asio_server_tls_context.h \
255 asio_client_session.cc \
256 asio_client_session_impl.cc asio_client_session_impl.h \
257 asio_client_session_tcp_impl.cc asio_client_session_tcp_impl.h \
258 asio_client_session_tls_impl.cc asio_client_session_tls_impl.h \
259 asio_client_response.cc \
260 asio_client_response_impl.cc asio_client_response_impl.h \
261 asio_client_request.cc \
262 asio_client_request_impl.cc asio_client_request_impl.h \
263 asio_client_stream.cc asio_client_stream.h \
264 asio_client_tls_context.cc asio_client_tls_context.h
266 libnghttp2_asio_la_CPPFLAGS = ${AM_CPPFLAGS} ${BOOST_CPPFLAGS} -fPIE
267 libnghttp2_asio_la_LDFLAGS = -no-undefined -version-info 1:0:0 -pie
268 libnghttp2_asio_la_LIBADD = \
269 $(top_builddir)/lib/libnghttp2.la \
270 $(top_builddir)/third-party/liburl-parser.la \
271 $(top_builddir)/third-party/libllhttp.la \
275 ${BOOST_THREAD_LIB} \
278 endif # ENABLE_ASIO_LIB