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.
29 AM_CFLAGS = $(WARNCFLAGS)
31 -DPKGDATADIR='"$(pkgdatadir)"' \
33 -I$(top_srcdir)/lib/includes \
34 -I$(top_builddir)/lib/includes \
36 -I$(top_srcdir)/src/includes \
37 -I$(top_srcdir)/third-party \
46 LDADD = $(top_builddir)/lib/libnghttp2.la \
47 $(top_builddir)/third-party/libhttp-parser.la \
59 bin_PROGRAMS += nghttp nghttpd nghttpx
61 HELPER_OBJECTS = util.cc \
62 http2.cc timegm.c app_helper.cc nghttp2_gzip.c
63 HELPER_HFILES = util.h \
64 http2.h timegm.h app_helper.h nghttp2_config.h \
68 HTML_PARSER_HFILES = HtmlParser.h
71 HTML_PARSER_OBJECTS += HtmlParser.cc
74 nghttp_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttp.cc nghttp.h \
75 ${HTML_PARSER_OBJECTS} ${HTML_PARSER_HFILES} \
78 nghttpd_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttpd.cc \
80 HttpServer.cc HttpServer.h
82 bin_PROGRAMS += h2load
84 h2load_SOURCES = util.cc util.h \
85 http2.cc http2.h h2load.cc h2load.h \
89 h2load_http2_session.cc h2load_http2_session.h
92 h2load_SOURCES += h2load_spdy_session.cc h2load_spdy_session.h
96 util.cc util.h http2.cc http2.h timegm.c timegm.h base64.h \
97 app_helper.cc app_helper.h \
99 shrpx_config.cc shrpx_config.h \
101 shrpx_accept_handler.cc shrpx_accept_handler.h \
102 shrpx_connection_handler.cc shrpx_connection_handler.h \
103 shrpx_client_handler.cc shrpx_client_handler.h \
105 shrpx_http2_upstream.cc shrpx_http2_upstream.h \
106 shrpx_https_upstream.cc shrpx_https_upstream.h \
107 shrpx_downstream.cc shrpx_downstream.h \
108 shrpx_downstream_connection.cc shrpx_downstream_connection.h \
109 shrpx_http_downstream_connection.cc shrpx_http_downstream_connection.h \
110 shrpx_http2_downstream_connection.cc shrpx_http2_downstream_connection.h \
111 shrpx_http2_session.cc shrpx_http2_session.h \
112 shrpx_downstream_queue.cc shrpx_downstream_queue.h \
113 shrpx_log.cc shrpx_log.h \
114 shrpx_http.cc shrpx_http.h \
115 shrpx_io_control.cc shrpx_io_control.h \
116 shrpx_ssl.cc shrpx_ssl.h \
117 shrpx_worker.cc shrpx_worker.h \
118 shrpx_log_config.cc shrpx_log_config.h \
119 shrpx_connect_blocker.cc shrpx_connect_blocker.h \
120 shrpx_downstream_connection_pool.cc shrpx_downstream_connection_pool.h \
121 shrpx_rate_limit.cc shrpx_rate_limit.h \
122 shrpx_connection.cc shrpx_connection.h \
123 buffer.h memchunk.h template.h
126 NGHTTPX_SRCS += shrpx_spdy_upstream.cc shrpx_spdy_upstream.h
129 noinst_LIBRARIES = libnghttpx.a
130 libnghttpx_a_SOURCES = ${NGHTTPX_SRCS}
132 nghttpx_SOURCES = shrpx.cc shrpx.h
133 nghttpx_LDADD = libnghttpx.a ${LDADD}
136 check_PROGRAMS += nghttpx-unittest
137 nghttpx_unittest_SOURCES = shrpx-unittest.cc \
138 shrpx_ssl_test.cc shrpx_ssl_test.h \
139 shrpx_downstream_test.cc shrpx_downstream_test.h \
140 shrpx_config_test.cc shrpx_config_test.h \
141 http2_test.cc http2_test.h \
142 util_test.cc util_test.h \
143 nghttp2_gzip_test.c nghttp2_gzip_test.h \
144 nghttp2_gzip.c nghttp2_gzip.h \
145 buffer_test.cc buffer_test.h \
146 memchunk_test.cc memchunk_test.h
147 nghttpx_unittest_CPPFLAGS = ${AM_CPPFLAGS}\
148 -DNGHTTP2_TESTS_DIR=\"$(top_srcdir)/tests\"
149 nghttpx_unittest_LDADD = libnghttpx.a ${LDADD} @CUNIT_LIBS@ @TESTLDADD@
151 TESTS += nghttpx-unittest
156 if ENABLE_HPACK_TOOLS
158 bin_PROGRAMS += inflatehd deflatehd
160 HPACK_TOOLS_COMMON_SRCS = comp_helper.c comp_helper.h
162 inflatehd_SOURCES = inflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
164 deflatehd_SOURCES = deflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
166 endif # ENABLE_HPACK_TOOLS
170 pkgconfigdir = $(libdir)/pkgconfig
171 pkgconfig_DATA = libnghttp2_asio.pc
172 DISTCLEANFILES = $(pkgconfig_DATA)
174 lib_LTLIBRARIES = libnghttp2_asio.la
176 libnghttp2_asio_la_SOURCES = \
177 util.cc util.h http2.cc http2.h \
179 asio_common.cc asio_common.h \
180 asio_io_service_pool.cc asio_io_service_pool.h \
181 asio_server_http2.cc \
182 asio_server_http2_impl.cc asio_server_http2_impl.h \
183 asio_server.cc asio_server.h \
184 asio_server_http2_handler.cc asio_server_http2_handler.h \
185 asio_server_connection.h \
186 asio_server_request.cc \
187 asio_server_request_impl.cc asio_server_request_impl.h \
188 asio_server_response.cc \
189 asio_server_response_impl.cc asio_server_response_impl.h \
190 asio_server_stream.cc asio_server_stream.h \
191 asio_server_serve_mux.cc asio_server_serve_mux.h \
192 asio_server_request_handler.cc asio_server_request_handler.h \
193 asio_server_tls_context.cc asio_server_tls_context.h \
194 asio_client_session.cc \
195 asio_client_session_impl.cc asio_client_session_impl.h \
196 asio_client_session_tcp_impl.cc asio_client_session_tcp_impl.h \
197 asio_client_session_tls_impl.cc asio_client_session_tls_impl.h \
198 asio_client_response.cc \
199 asio_client_response_impl.cc asio_client_response_impl.h \
200 asio_client_request.cc \
201 asio_client_request_impl.cc asio_client_request_impl.h \
202 asio_client_stream.cc asio_client_stream.h \
203 asio_client_tls_context.cc asio_client_tls_context.h
205 libnghttp2_asio_la_CPPFLAGS = ${AM_CPPFLAGS} ${BOOST_CPPFLAGS}
206 libnghttp2_asio_la_LDFLAGS = -no-undefined -version-info 1:0:0
207 libnghttp2_asio_la_LIBADD = \
208 $(top_builddir)/lib/libnghttp2.la \
209 $(top_builddir)/third-party/libhttp-parser.la \
212 ${BOOST_THREAD_LIB} \
213 ${BOOST_SYSTEM_LIB} \
216 endif # ENABLE_ASIO_LIB