Imported Upstream version 1.0.0
[platform/upstream/nghttp2.git] / src / Makefile.am
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.
23 SUBDIRS = includes
24
25 bin_PROGRAMS =
26 check_PROGRAMS =
27 TESTS =
28
29 AM_CFLAGS = $(WARNCFLAGS)
30 AM_CPPFLAGS = \
31         -DPKGDATADIR='"$(pkgdatadir)"' \
32         -Wall \
33         -I$(top_srcdir)/lib/includes \
34         -I$(top_builddir)/lib/includes \
35         -I$(top_srcdir)/lib \
36         -I$(top_srcdir)/src/includes \
37         -I$(top_srcdir)/third-party \
38         @LIBSPDYLAY_CFLAGS@ \
39         @XML_CPPFLAGS@  \
40         @LIBEV_CFLAGS@ \
41         @OPENSSL_CFLAGS@ \
42         @JANSSON_CFLAGS@ \
43         @ZLIB_CFLAGS@ \
44         @DEFS@
45
46 LDADD = $(top_builddir)/lib/libnghttp2.la \
47         $(top_builddir)/third-party/libhttp-parser.la \
48         @JEMALLOC_LIBS@ \
49         @LIBSPDYLAY_LIBS@ \
50         @XML_LIBS@ \
51         @LIBEV_LIBS@ \
52         @OPENSSL_LIBS@ \
53         @JANSSON_LIBS@ \
54         @ZLIB_LIBS@ \
55         @APPLDFLAGS@
56
57 if ENABLE_APP
58
59 bin_PROGRAMS += nghttp nghttpd nghttpx
60
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 \
65         nghttp2_gzip.h
66
67 HTML_PARSER_OBJECTS =
68 HTML_PARSER_HFILES = HtmlParser.h
69
70 if HAVE_LIBXML2
71 HTML_PARSER_OBJECTS += HtmlParser.cc
72 endif # HAVE_LIBXML2
73
74 nghttp_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttp.cc nghttp.h \
75         ${HTML_PARSER_OBJECTS} ${HTML_PARSER_HFILES} \
76         ssl.cc ssl.h
77
78 nghttpd_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} nghttpd.cc \
79         ssl.cc ssl.h \
80         HttpServer.cc HttpServer.h
81
82 bin_PROGRAMS += h2load
83
84 h2load_SOURCES = util.cc util.h \
85         http2.cc http2.h h2load.cc h2load.h \
86         timegm.c timegm.h \
87         ssl.cc ssl.h \
88         h2load_session.h \
89         h2load_http2_session.cc h2load_http2_session.h
90
91 if HAVE_SPDYLAY
92 h2load_SOURCES += h2load_spdy_session.cc h2load_spdy_session.h
93 endif # HAVE_SPDYLAY
94
95 NGHTTPX_SRCS = \
96         util.cc util.h http2.cc http2.h timegm.c timegm.h base64.h \
97         app_helper.cc app_helper.h \
98         ssl.cc ssl.h \
99         shrpx_config.cc shrpx_config.h \
100         shrpx_error.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 \
104         shrpx_upstream.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
124
125 if HAVE_SPDYLAY
126 NGHTTPX_SRCS += shrpx_spdy_upstream.cc shrpx_spdy_upstream.h
127 endif # HAVE_SPDYLAY
128
129 noinst_LIBRARIES = libnghttpx.a
130 libnghttpx_a_SOURCES = ${NGHTTPX_SRCS}
131
132 nghttpx_SOURCES = shrpx.cc shrpx.h
133 nghttpx_LDADD = libnghttpx.a ${LDADD}
134
135 if HAVE_CUNIT
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@
150
151 TESTS += nghttpx-unittest
152 endif # HAVE_CUNIT
153
154 endif # ENABLE_APP
155
156 if ENABLE_HPACK_TOOLS
157
158 bin_PROGRAMS += inflatehd deflatehd
159
160 HPACK_TOOLS_COMMON_SRCS = comp_helper.c comp_helper.h
161
162 inflatehd_SOURCES = inflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
163
164 deflatehd_SOURCES = deflatehd.cc $(HPACK_TOOLS_COMMON_SRCS)
165
166 endif # ENABLE_HPACK_TOOLS
167
168 if ENABLE_ASIO_LIB
169
170 pkgconfigdir = $(libdir)/pkgconfig
171 pkgconfig_DATA = libnghttp2_asio.pc
172 DISTCLEANFILES = $(pkgconfig_DATA)
173
174 lib_LTLIBRARIES = libnghttp2_asio.la
175
176 libnghttp2_asio_la_SOURCES = \
177         util.cc util.h http2.cc http2.h \
178         ssl.cc ssl.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
204
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 \
210         ${BOOST_LDFLAGS} \
211         ${BOOST_ASIO_LIB} \
212         ${BOOST_THREAD_LIB} \
213         ${BOOST_SYSTEM_LIB} \
214         @OPENSSL_LIBS@
215
216 endif # ENABLE_ASIO_LIB