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