1 dnl nghttp2 - HTTP/2 C Library
3 dnl Copyright (c) 2012, 2013, 2014, 2015 Tatsuhiro Tsujikawa
5 dnl Permission is hereby granted, free of charge, to any person obtaining
6 dnl a copy of this software and associated documentation files (the
7 dnl "Software"), to deal in the Software without restriction, including
8 dnl without limitation the rights to use, copy, modify, merge, publish,
9 dnl distribute, sublicense, and/or sell copies of the Software, and to
10 dnl permit persons to whom the Software is furnished to do so, subject to
11 dnl the following conditions:
13 dnl The above copyright notice and this permission notice shall be
14 dnl included in all copies or substantial portions of the Software.
16 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 dnl Do not change user variables!
25 dnl http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
28 AC_INIT([nghttp2], [1.34.0], [t-tujikawa@users.sourceforge.net])
29 AC_CONFIG_AUX_DIR([.])
30 AC_CONFIG_MACRO_DIR([m4])
31 AC_CONFIG_HEADERS([config.h])
32 AC_USE_SYSTEM_EXTENSIONS
41 AM_INIT_AUTOMAKE([subdir-objects])
43 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
45 dnl See versioning rule:
46 dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
47 AC_SUBST(LT_CURRENT, 31)
48 AC_SUBST(LT_REVISION, 1)
51 major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"`
52 minor=`echo $PACKAGE_VERSION |cut -d. -f2 | sed -e "s/[^0-9]//g"`
53 patch=`echo $PACKAGE_VERSION |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
55 PACKAGE_VERSION_NUM=`printf "0x%02x%02x%02x" "$major" "$minor" "$patch"`
57 AC_SUBST(PACKAGE_VERSION_NUM)
59 dnl Checks for command-line options
60 AC_ARG_ENABLE([werror],
61 [AS_HELP_STRING([--enable-werror],
62 [Turn on compile time warnings])],
63 [werror=$enableval], [werror=no])
65 AC_ARG_ENABLE([debug],
66 [AS_HELP_STRING([--enable-debug],
67 [Turn on debug output])],
68 [debug=$enableval], [debug=no])
70 AC_ARG_ENABLE([threads],
71 [AS_HELP_STRING([--disable-threads],
72 [Turn off threading in apps])],
73 [threads=$enableval], [threads=yes])
76 [AS_HELP_STRING([--enable-app],
77 [Build applications (nghttp, nghttpd, nghttpx and h2load) [default=check]])],
78 [request_app=$enableval], [request_app=check])
80 AC_ARG_ENABLE([hpack-tools],
81 [AS_HELP_STRING([--enable-hpack-tools],
82 [Build HPACK tools [default=check]])],
83 [request_hpack_tools=$enableval], [request_hpack_tools=check])
85 AC_ARG_ENABLE([asio-lib],
86 [AS_HELP_STRING([--enable-asio-lib],
87 [Build C++ libnghttp2_asio library [default=no]])],
88 [request_asio_lib=$enableval], [request_asio_lib=no])
90 AC_ARG_ENABLE([examples],
91 [AS_HELP_STRING([--enable-examples],
92 [Build examples [default=check]])],
93 [request_examples=$enableval], [request_examples=check])
95 AC_ARG_ENABLE([python-bindings],
96 [AS_HELP_STRING([--enable-python-bindings],
97 [Build Python bindings [default=check]])],
98 [request_python_bindings=$enableval], [request_python_bindings=check])
100 AC_ARG_ENABLE([failmalloc],
101 [AS_HELP_STRING([--disable-failmalloc],
102 [Do not build failmalloc test program])],
103 [request_failmalloc=$enableval], [request_failmalloc=yes])
105 AC_ARG_ENABLE([lib-only],
106 [AS_HELP_STRING([--enable-lib-only],
107 [Build libnghttp2 only. This is a short hand for --disable-app --disable-examples --disable-hpack-tools --disable-python-bindings])],
108 [request_lib_only=$enableval], [request_lib_only=no])
110 AC_ARG_WITH([libxml2],
111 [AS_HELP_STRING([--with-libxml2],
112 [Use libxml2 [default=check]])],
113 [request_libxml2=$withval], [request_libxml2=check])
115 AC_ARG_WITH([jemalloc],
116 [AS_HELP_STRING([--with-jemalloc],
117 [Use jemalloc [default=check]])],
118 [request_jemalloc=$withval], [request_jemalloc=check])
120 AC_ARG_WITH([systemd],
121 [AS_HELP_STRING([--with-systemd],
122 [Enable systemd support in nghttpx [default=check]])],
123 [request_systemd=$withval], [request_systemd=check])
126 [AS_HELP_STRING([--with-mruby],
127 [Use mruby [default=no]])],
128 [request_mruby=$withval], [request_mruby=no])
130 AC_ARG_WITH([neverbleed],
131 [AS_HELP_STRING([--with-neverbleed],
132 [Use neverbleed [default=no]])],
133 [request_neverbleed=$withval], [request_neverbleed=no])
135 AC_ARG_WITH([cython],
136 [AS_HELP_STRING([--with-cython=PATH],
137 [Use cython in given PATH])],
138 [cython_path=$withval], [])
141 AC_ARG_VAR([CYTHON], [the Cython executable])
143 dnl Checks for programs
152 PKG_PROG_PKG_CONFIG([0.20])
154 AM_PATH_PYTHON([2.7],, [:])
156 if [test "x$request_lib_only" = "xyes"]; then
158 request_hpack_tools=no
160 request_python_bindings=no
163 if [test "x$request_python_bindings" != "xno"]; then
164 AX_PYTHON_DEVEL([>= '2.7'])
167 if test "x${cython_path}" = "x"; then
168 AC_CHECK_PROGS([CYTHON], [cython.py cython])
170 CYTHON=${cython_path}
174 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
175 AC_DEFINE([NGHTTP2_NORETURN], [__attribute__((noreturn))], [Hint to the compiler that a function never return])
177 AC_DEFINE([NGHTTP2_NORETURN], , [Hint to the compiler that a function never return])
180 save_CXXFLAGS="$CXXFLAGS"
183 AX_CXX_COMPILE_STDCXX_11([noext], [optional])
185 CXX1XCXXFLAGS="$CXXFLAGS"
186 CXXFLAGS="$save_CXXFLAGS"
187 AC_SUBST([CXX1XCXXFLAGS])
191 save_CXXFLAGS="$CXXFLAGS"
192 CXXFLAGS="$CXXFLAGS $CXX1XCXXFLAGS"
194 # Check that std::future is available.
195 AC_MSG_CHECKING([whether std::future is available])
196 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
202 std::vector<std::future<int>> v;
204 [AC_DEFINE([HAVE_STD_FUTURE], [1],
205 [Define to 1 if you have the `std::future`.])
207 AC_MSG_RESULT([yes])],
209 AC_MSG_RESULT([no])])
211 # Check that std::map::emplace is available for g++-4.7.
212 AC_MSG_CHECKING([whether std::map::emplace is available])
213 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
218 std::map<int, int>().emplace(1, 2);
220 [AC_DEFINE([HAVE_STD_MAP_EMPLACE], [1],
221 [Define to 1 if you have the `std::map::emplace`.])
222 have_std_map_emplace=yes
223 AC_MSG_RESULT([yes])],
224 [have_std_map_emplace=no
225 AC_MSG_RESULT([no])])
227 # Check that std::atomic_* overloads for std::shared_ptr are
229 AC_MSG_CHECKING([whether std::atomic_* overloads for std::shared_ptr are available])
230 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
235 auto a = std::make_shared<int>(1000000007);
236 auto p = std::atomic_load(&a);
238 std::atomic_store(&a, p);
240 [AC_DEFINE([HAVE_ATOMIC_STD_SHARED_PTR], [1],
241 [Define to 1 if you have the std::atomic_* overloads for std::shared_ptr.])
242 have_atomic_std_shared_ptr=yes
243 AC_MSG_RESULT([yes])],
244 [have_atomic_std_shared_ptr=no
245 AC_MSG_RESULT([no])])
247 # Check that thread_local storage specifier is available
248 AC_MSG_CHECKING([whether thread_local storage class specifier is available.])
249 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
252 thread_local int a = 0;
255 [AC_DEFINE([HAVE_THREAD_LOCAL], [1],
256 [Define to 1 if you have thread_local storage specifier.])
257 have_thread_local=yes
258 AC_MSG_RESULT([yes])],
259 [have_Thread_local=no
260 AC_MSG_RESULT([no])])
262 CXXFLAGS=$save_CXXFLAGS
266 # Checks for libraries.
268 # Additional libraries required for tests.
271 # Additional libraries required for programs under src directory.
277 # android does not need -pthread, but needs followng 3 libs for C++
278 APPLDFLAGS="$APPLDFLAGS -lstdc++ -latomic -lsupc++"
281 PTHREAD_LDFLAGS="-pthread"
282 APPLDFLAGS="$APPLDFLAGS $PTHREAD_LDFLAGS"
288 APPLDFLAGS="$APPLDFLAGS -lsocket -lnsl"
293 PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no])
295 if test "x${have_zlib}" = "xno"; then
296 AC_MSG_NOTICE($ZLIB_PKG_ERRORS)
299 # dl: openssl requires libdl when it is statically linked.
302 # dlopen is in libc on *BSD
306 AC_SEARCH_LIBS([dlopen], [dl], [APPLDFLAGS="-ldl $APPLDFLAGS"], [], [])
312 PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no])
313 # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We
314 # do this because Debian (Ubuntu) lacks pkg-config file for cunit.
315 if test "x${have_cunit}" = "xno"; then
316 AC_MSG_WARN([${CUNIT_PKG_ERRORS}])
317 AC_CHECK_LIB([cunit], [CU_initialize_registry],
318 [have_cunit=yes], [have_cunit=no])
319 if test "x${have_cunit}" = "xyes"; then
322 AC_SUBST([CUNIT_LIBS])
323 AC_SUBST([CUNIT_CFLAGS])
326 if test "x${have_cunit}" = "xyes"; then
327 # cunit in Mac OS X requires ncurses. Note that in Mac OS X, test
328 # program can be built without -lncurses, but it emits runtime
332 CUNIT_LIBS="$CUNIT_LIBS -lncurses"
333 AC_SUBST([CUNIT_LIBS])
338 AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
341 # libev does not have pkg-config file. Check it in an old way.
343 # android requires -lm for floor
344 AC_CHECK_LIB([ev], [ev_time], [have_libev=yes], [have_libev=no], [-lm])
345 if test "x${have_libev}" = "xyes"; then
346 AC_CHECK_HEADER([ev.h], [have_libev=yes], [have_libev=no])
347 if test "x${have_libev}" = "xyes"; then
350 AC_SUBST([LIBEV_LIBS])
351 AC_SUBST([LIBEV_CFLAGS])
357 PKG_CHECK_MODULES([OPENSSL], [openssl1.1 >= 1.0.1],
358 [have_openssl=yes], [have_openssl=no])
359 if test "x${have_openssl}" = "xno"; then
360 AC_MSG_NOTICE($OPENSSL_PKG_ERRORS)
364 PKG_CHECK_MODULES([LIBCARES], [libcares >= 1.7.5], [have_libcares=yes],
366 if test "x${have_libcares}" = "xno"; then
367 AC_MSG_NOTICE($LIBCARES_PKG_ERRORS)
370 # libevent_openssl (for examples)
371 # 2.0.8 is required because we use evconnlistener_set_error_cb()
372 PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.0.8],
373 [have_libevent_openssl=yes], [have_libevent_openssl=no])
374 if test "x${have_libevent_openssl}" = "xno"; then
375 AC_MSG_NOTICE($LIBEVENT_OPENSSL_PKG_ERRORS)
378 # jansson (for src/nghttp, src/deflatehd and src/inflatehd)
379 PKG_CHECK_MODULES([JANSSON], [jansson >= 2.5],
380 [have_jansson=yes], [have_jansson=no])
381 if test "x${have_jansson}" = "xyes"; then
382 AC_DEFINE([HAVE_JANSSON], [1],
383 [Define to 1 if you have `libjansson` library.])
385 AC_MSG_NOTICE($JANSSON_PKG_ERRORS)
389 # libsystemd (for src/nghttpx)
391 if test "x${request_systemd}" != "xno"; then
392 PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209], [have_libsystemd=yes],
393 [have_libsystemd=no])
394 if test "x${have_libsystemd}" = "xyes"; then
395 AC_DEFINE([HAVE_LIBSYSTEMD], [1],
396 [Define to 1 if you have `libsystemd` library.])
398 AC_MSG_NOTICE($SYSTEMD_PKG_ERRORS)
402 if test "x${request_systemd}" = "xyes" &&
403 test "x${have_libsystemd}" != "xyes"; then
404 AC_MSG_ERROR([systemd was requested (--with-systemd) but not found])
407 # libxml2 (for src/nghttp)
408 PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.26],
409 [have_libxml2=yes], [have_libxml2=no])
410 if test "x${have_libxml2}" = "xyes"; then
411 AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have `libxml2` library.])
413 AC_MSG_NOTICE($LIBXML2_PKG_ERRORS)
416 if test "x${request_libxml2}" = "xyes" &&
417 test "x${have_libxml2}" != "xyes"; then
418 AC_MSG_ERROR([libxml2 was requested (--with-libxml2) but not found])
421 AM_CONDITIONAL([HAVE_LIBXML2], [ test "x${have_libxml2}" = "xyes" ])
425 if test "x${request_jemalloc}" != "xno"; then
427 AC_SEARCH_LIBS([malloc_stats_print], [jemalloc], [have_jemalloc=yes], [],
430 if test "x${have_jemalloc}" = "xyes"; then
431 jemalloc_libs=${ac_cv_search_malloc_stats_print}
433 # On Darwin, malloc_stats_print is je_malloc_stats_print
434 AC_SEARCH_LIBS([je_malloc_stats_print], [jemalloc], [have_jemalloc=yes], [],
437 if test "x${have_jemalloc}" = "xyes"; then
438 jemalloc_libs=${ac_cv_search_je_malloc_stats_print}
444 if test "x${have_jemalloc}" = "xyes" &&
445 test "x${jemalloc_libs}" != "xnone required"; then
446 JEMALLOC_LIBS=${jemalloc_libs}
447 AC_SUBST([JEMALLOC_LIBS])
451 if test "x${request_jemalloc}" = "xyes" &&
452 test "x${have_jemalloc}" != "xyes"; then
453 AC_MSG_ERROR([jemalloc was requested (--with-jemalloc) but not found])
456 # Check Boost Asio library
459 if test "x${request_asio_lib}" = "xyes"; then
460 AX_BOOST_BASE([1.54.0], [have_boost_base=yes], [have_boost_base=no])
462 if test "x${have_boost_base}" = "xyes"; then
467 if test "x${ax_cv_boost_asio}" = "xyes" &&
468 test "x${ax_cv_boost_system}" = "xyes" &&
469 test "x${ax_cv_boost_thread}" = "xyes"; then
475 # The nghttp, nghttpd and nghttpx under src depend on zlib, OpenSSL,
476 # libev, and libc-ares.
478 if test "x${request_app}" != "xno" &&
479 test "x${have_zlib}" = "xyes" &&
480 test "x${have_openssl}" = "xyes" &&
481 test "x${have_libev}" = "xyes" &&
482 test "x${have_libcares}" = "xyes"; then
486 if test "x${request_app}" = "xyes" &&
487 test "x${enable_app}" != "xyes"; then
488 AC_MSG_ERROR([applications were requested (--enable-app) but dependencies are not met.])
491 AM_CONDITIONAL([ENABLE_APP], [ test "x${enable_app}" = "xyes" ])
493 enable_hpack_tools=no
494 # HPACK tools requires jansson
495 if test "x${request_hpack_tools}" != "xno" &&
496 test "x${have_jansson}" = "xyes"; then
497 enable_hpack_tools=yes
500 if test "x${request_hpack_tools}" = "xyes" &&
501 test "x${enable_hpack_tools}" != "xyes"; then
502 AC_MSG_ERROR([HPACK tools were requested (--enable-hpack-tools) but dependencies are not met.])
505 AM_CONDITIONAL([ENABLE_HPACK_TOOLS], [ test "x${enable_hpack_tools}" = "xyes" ])
507 # C++ library libnghttp2_asio
510 if test "x${request_asio_lib}" != "xno" &&
511 test "x${have_asio_lib}" = "xyes"; then
515 AM_CONDITIONAL([ENABLE_ASIO_LIB], [ test "x${enable_asio_lib}" = "xyes" ])
517 # The example programs depend on OpenSSL and libevent_openssl
519 if test "x${request_examples}" != "xno" &&
520 test "x${have_openssl}" = "xyes" &&
521 test "x${have_libevent_openssl}" = "xyes"; then
525 if test "x${request_examples}" = "xyes" &&
526 test "x${enable_examples}" != "xyes"; then
527 AC_MSG_ERROR([examples were requested (--enable-examples) but dependencies are not met.])
530 AM_CONDITIONAL([ENABLE_EXAMPLES], [ test "x${enable_examples}" = "xyes" ])
532 # third-party only be built when needed
534 enable_third_party=no
537 if test "x${enable_examples}" = "xyes" ||
538 test "x${enable_app}" = "xyes" ||
539 test "x${enable_hpack_tools}" = "xyes" ||
540 test "x${enable_asio_lib}" = "xyes"; then
541 enable_third_party=yes
543 # mruby (for src/nghttpx)
544 if test "x${request_mruby}" = "xyes"; then
545 # We are going to build mruby
547 AC_DEFINE([HAVE_MRUBY], [1], [Define to 1 if you have `mruby` library.])
548 LIBMRUBY_LIBS="-lmruby -lm"
550 AC_SUBST([LIBMRUBY_LIBS])
551 AC_SUBST([LIBMRUBY_CFLAGS])
554 # neverbleed (for src/nghttpx)
555 if test "x${request_neverbleed}" = "xyes"; then
557 AC_DEFINE([HAVE_NEVERBLEED], [1], [Define to 1 if you have `neverbleed` library.])
561 AM_CONDITIONAL([ENABLE_THIRD_PARTY], [ test "x${enable_third_party}" = "xyes" ])
562 AM_CONDITIONAL([HAVE_MRUBY], [test "x${have_mruby}" = "xyes"])
563 AM_CONDITIONAL([HAVE_NEVERBLEED], [test "x${have_neverbleed}" = "xyes"])
566 enable_python_bindings=no
567 if test "x${request_python_bindings}" != "xno" &&
568 test "x${CYTHON}" != "x" &&
569 test "x${PYTHON}" != "x:" &&
570 test "x${have_python_dev}" = "xyes"; then
571 enable_python_bindings=yes
574 if test "x${request_python_bindings}" = "xyes" &&
575 test "x${enable_python_bindings}" != "xyes"; then
576 AC_MSG_ERROR([python bindings were requested (--enable-python-bindings) but dependencies are not met.])
579 AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS],
580 [test "x${enable_python_bindings}" = "xyes"])
582 # Produce cython conditional, so that we can distribute generated C
584 AM_CONDITIONAL([HAVE_CYTHON], [test "x${CYTHON}" != "x"])
588 if test "x${request_failmalloc}" = "xyes"; then
589 enable_failmalloc=yes
592 AM_CONDITIONAL([ENABLE_FAILMALLOC], [ test "x${enable_failmalloc}" = "xyes" ])
594 # Checks for header files.
615 # Checks for typedefs, structures, and compiler characteristics.
629 AC_CHECK_TYPES([ptrdiff_t])
634 AC_CHECK_MEMBER([struct tm.tm_gmtoff], [have_struct_tm_tm_gmtoff=yes],
635 [have_struct_tm_tm_gmtoff=no], [[#include <time.h>]])
637 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
638 [AC_DEFINE([HAVE_SOCKADDR_IN_SIN_LEN],[1],
639 [Define to 1 if struct sockaddr_in has sin_len member.])],
642 #include <sys/types.h>
643 #include <sys/socket.h>
644 #include <netinet/in.h>
647 AC_CHECK_MEMBER([struct sockaddr_in6.sin6_len],
648 [AC_DEFINE([HAVE_SOCKADDR_IN6_SIN6_LEN],[1],
649 [Define to 1 if struct sockaddr_in6 has sin6_len member.])],
652 #include <sys/types.h>
653 #include <sys/socket.h>
654 #include <netinet/in.h>
657 if test "x$have_struct_tm_tm_gmtoff" = "xyes"; then
658 AC_DEFINE([HAVE_STRUCT_TM_TM_GMTOFF], [1],
659 [Define to 1 if you have `struct tm.tm_gmtoff` member.])
662 # Check size of pointer to decide we need 8 bytes alignment
664 AC_CHECK_SIZEOF([int *])
666 AC_CHECK_SIZEOF([time_t])
668 # Checks for library functions.
670 # Don't check malloc, since it does not play nicely with C++ stdlib
674 AC_FUNC_ERROR_AT_LINE
676 # Don't check realloc, since LeakSanitizer detects memory leak during check
704 # timerfd_create was added in linux kernel 2.6.25
706 AC_CHECK_FUNC([timerfd_create],
707 [have_timerfd_create=yes], [have_timerfd_create=no])
709 # For cygwin: we can link initgroups, so AC_CHECK_FUNCS succeeds, but
710 # cygwin disables initgroups due to feature test macro magic with our
711 # configuration. FreeBSD declares initgroups() in unistd.h.
712 AC_CHECK_DECLS([initgroups], [], [], [[
720 save_CXXFLAGS=$CXXFLAGS
725 if test "x$werror" != "xno"; then
727 AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
728 AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"])
729 AX_CHECK_COMPILE_FLAG([-Werror], [CFLAGS="$CFLAGS -Werror"])
730 AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"])
731 AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], [CFLAGS="$CFLAGS -Wstrict-prototypes"])
732 AX_CHECK_COMPILE_FLAG([-Wmissing-declarations], [CFLAGS="$CFLAGS -Wmissing-declarations"])
733 AX_CHECK_COMPILE_FLAG([-Wpointer-arith], [CFLAGS="$CFLAGS -Wpointer-arith"])
734 AX_CHECK_COMPILE_FLAG([-Wdeclaration-after-statement], [CFLAGS="$CFLAGS -Wdeclaration-after-statement"])
735 AX_CHECK_COMPILE_FLAG([-Wformat-security], [CFLAGS="$CFLAGS -Wformat-security"])
736 AX_CHECK_COMPILE_FLAG([-Wwrite-strings], [CFLAGS="$CFLAGS -Wwrite-strings"])
737 AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"])
738 AX_CHECK_COMPILE_FLAG([-Winline], [CFLAGS="$CFLAGS -Winline"])
739 AX_CHECK_COMPILE_FLAG([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"])
740 AX_CHECK_COMPILE_FLAG([-Wfloat-equal], [CFLAGS="$CFLAGS -Wfloat-equal"])
741 AX_CHECK_COMPILE_FLAG([-Wundef], [CFLAGS="$CFLAGS -Wundef"])
742 AX_CHECK_COMPILE_FLAG([-Wendif-labels], [CFLAGS="$CFLAGS -Wendif-labels"])
743 AX_CHECK_COMPILE_FLAG([-Wempty-body], [CFLAGS="$CFLAGS -Wempty-body"])
744 AX_CHECK_COMPILE_FLAG([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"])
745 AX_CHECK_COMPILE_FLAG([-Wclobbered], [CFLAGS="$CFLAGS -Wclobbered"])
746 AX_CHECK_COMPILE_FLAG([-Wvla], [CFLAGS="$CFLAGS -Wvla"])
747 AX_CHECK_COMPILE_FLAG([-Wpragmas], [CFLAGS="$CFLAGS -Wpragmas"])
748 AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [CFLAGS="$CFLAGS -Wunreachable-code"])
749 AX_CHECK_COMPILE_FLAG([-Waddress], [CFLAGS="$CFLAGS -Waddress"])
750 AX_CHECK_COMPILE_FLAG([-Wattributes], [CFLAGS="$CFLAGS -Wattributes"])
751 AX_CHECK_COMPILE_FLAG([-Wdiv-by-zero], [CFLAGS="$CFLAGS -Wdiv-by-zero"])
752 AX_CHECK_COMPILE_FLAG([-Wshorten-64-to-32], [CFLAGS="$CFLAGS -Wshorten-64-to-32"])
754 AX_CHECK_COMPILE_FLAG([-Wconversion], [CFLAGS="$CFLAGS -Wconversion"])
755 AX_CHECK_COMPILE_FLAG([-Wextended-offsetof], [CFLAGS="$CFLAGS -Wextended-offsetof"])
756 AX_CHECK_COMPILE_FLAG([-Wformat-nonliteral], [CFLAGS="$CFLAGS -Wformat-nonliteral"])
757 AX_CHECK_COMPILE_FLAG([-Wlanguage-extension-token], [CFLAGS="$CFLAGS -Wlanguage-extension-token"])
758 AX_CHECK_COMPILE_FLAG([-Wmissing-field-initializers], [CFLAGS="$CFLAGS -Wmissing-field-initializers"])
759 AX_CHECK_COMPILE_FLAG([-Wmissing-noreturn], [CFLAGS="$CFLAGS -Wmissing-noreturn"])
760 AX_CHECK_COMPILE_FLAG([-Wmissing-variable-declarations], [CFLAGS="$CFLAGS -Wmissing-variable-declarations"])
761 # Not used because we cannot change public structs
762 # AX_CHECK_COMPILE_FLAG([-Wpadded], [CFLAGS="$CFLAGS -Wpadded"])
763 AX_CHECK_COMPILE_FLAG([-Wsign-conversion], [CFLAGS="$CFLAGS -Wsign-conversion"])
764 # Not used because this basically disallows default case
765 # AX_CHECK_COMPILE_FLAG([-Wswitch-enum], [CFLAGS="$CFLAGS -Wswitch-enum"])
766 AX_CHECK_COMPILE_FLAG([-Wunreachable-code-break], [CFLAGS="$CFLAGS -Wunreachable-code-break"])
767 AX_CHECK_COMPILE_FLAG([-Wunused-macros], [CFLAGS="$CFLAGS -Wunused-macros"])
768 AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [CFLAGS="$CFLAGS -Wunused-parameter"])
769 AX_CHECK_COMPILE_FLAG([-Wredundant-decls], [CFLAGS="$CFLAGS -Wredundant-decls"])
770 # Only work with Clang for the moment
771 AX_CHECK_COMPILE_FLAG([-Wheader-guard], [CFLAGS="$CFLAGS -Wheader-guard"])
772 AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CFLAGS="$CFLAGS -Wsometimes-uninitialized"])
774 # This is required because we pass format string as "const char*.
775 AX_CHECK_COMPILE_FLAG([-Wno-format-nonliteral], [CFLAGS="$CFLAGS -Wno-format-nonliteral"])
779 AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"])
780 AX_CHECK_COMPILE_FLAG([-Werror], [CXXFLAGS="$CXXFLAGS -Werror"])
781 AX_CHECK_COMPILE_FLAG([-Wformat-security], [CXXFLAGS="$CXXFLAGS -Wformat-security"])
782 AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CXXFLAGS="$CXXFLAGS -Wsometimes-uninitialized"])
783 # Disable noexcept-type warning of g++-7. This is not harmful as
784 # long as all source files are compiled with the same compiler.
785 AX_CHECK_COMPILE_FLAG([-Wno-noexcept-type], [CXXFLAGS="$CXXFLAGS -Wno-noexcept-type"])
790 WARNCXXFLAGS=$CXXFLAGS
793 CXXFLAGS=$save_CXXFLAGS
795 AC_SUBST([WARNCFLAGS])
796 AC_SUBST([WARNCXXFLAGS])
799 AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [EXTRACFLAG="-fvisibility=hidden"])
801 AC_SUBST([EXTRACFLAG])
803 if test "x$debug" != "xno"; then
804 AC_DEFINE([DEBUGBUILD], [1], [Define to 1 to enable debug output.])
808 # Some platform does not have working std::future. We disable
809 # threading for those platforms.
810 if test "x$threads" != "xyes" ||
811 test "x$have_std_future" != "xyes"; then
813 AC_DEFINE([NOTHREADS], [1], [Define to 1 if you want to disable threads.])
816 # propagate $enable_static to tests/Makefile.am
817 AM_CONDITIONAL([ENABLE_STATIC], [test "x$enable_static" = "xyes"])
819 AC_SUBST([TESTLDADD])
820 AC_SUBST([APPLDFLAGS])
826 lib/includes/Makefile
827 lib/includes/nghttp2/nghttp2ver.h
829 tests/testdata/Makefile
832 src/includes/Makefile
833 src/libnghttp2_asio.pc
837 integration-tests/Makefile
838 integration-tests/config.go
839 integration-tests/setenv
843 doc/package_README.rst
844 doc/tutorial-client.rst
845 doc/tutorial-server.rst
846 doc/tutorial-hpack.rst
847 doc/nghttpx-howto.rst
849 doc/libnghttp2_asio.rst
850 doc/python-apiref.rst
851 doc/building-android-binary.rst
855 doc/asio_http2_server.h.rst
856 doc/asio_http2_client.h.rst
863 AC_MSG_NOTICE([summary of build options:
865 Package version: ${VERSION}
866 Library version: $LT_CURRENT:$LT_REVISION:$LT_AGE
867 Install prefix: ${prefix}
877 CXXFLAGS: ${CXXFLAGS}
879 C preprocessor: ${CPP}
880 CPPFLAGS: ${CPPFLAGS}
881 WARNCFLAGS: ${WARNCFLAGS}
882 WARNCXXFLAGS: ${WARNCXXFLAGS}
883 CXX1XCXXFLAGS: ${CXX1XCXXFLAGS}
884 EXTRACFLAG: ${EXTRACFLAG}
887 Shared: ${enable_shared}
888 Static: ${enable_static}
891 PYTHON_VERSION: ${PYTHON_VERSION}
892 pyexecdir: ${pyexecdir}
893 Python-dev: ${have_python_dev}
894 PYTHON_CPPFLAGS:${PYTHON_CPPFLAGS}
895 PYTHON_LDFLAGS: ${PYTHON_LDFLAGS}
898 CUnit: ${have_cunit} (CFLAGS='${CUNIT_CFLAGS}' LIBS='${CUNIT_LIBS}')
899 Failmalloc: ${enable_failmalloc}
901 OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}')
902 Libxml2: ${have_libxml2} (CFLAGS='${LIBXML2_CPPFLAGS}' LIBS='${LIBXML2_LIBS}')
903 Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}')
904 Libc-ares ${have_libcares} (CFLAGS='${LIBCARES_CFLAGS}' LIBS='${LIBCARES_LIBS}')
905 Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}')
906 Jansson: ${have_jansson} (CFLAGS='${JANSSON_CFLAGS}' LIBS='${JANSSON_LIBS}')
907 Jemalloc: ${have_jemalloc} (LIBS='${JEMALLOC_LIBS}')
908 Zlib: ${have_zlib} (CFLAGS='${ZLIB_CFLAGS}' LIBS='${ZLIB_LIBS}')
909 Systemd: ${have_libsystemd} (CFLAGS='${SYSTEMD_CFLAGS}' LIBS='${SYSTEMD_LIBS}')
910 Boost CPPFLAGS: ${BOOST_CPPFLAGS}
911 Boost LDFLAGS: ${BOOST_LDFLAGS}
912 Boost::ASIO: ${BOOST_ASIO_LIB}
913 Boost::System: ${BOOST_SYSTEM_LIB}
914 Boost::Thread: ${BOOST_THREAD_LIB}
916 http-parser: ${enable_third_party}
917 MRuby: ${have_mruby} (CFLAGS='${LIBMRUBY_CFLAGS}' LIBS='${LIBMRUBY_LIBS}')
918 Neverbleed: ${have_neverbleed}
920 Applications: ${enable_app}
921 HPACK tools: ${enable_hpack_tools}
922 Libnghttp2_asio:${enable_asio_lib}
923 Examples: ${enable_examples}
924 Python bindings:${enable_python_bindings}
925 Threading: ${enable_threads}