1dnl nghttp2 - HTTP/2 C Library 2 3dnl Copyright (c) 2012, 2013, 2014, 2015 Tatsuhiro Tsujikawa 4 5dnl Permission is hereby granted, free of charge, to any person obtaining 6dnl a copy of this software and associated documentation files (the 7dnl "Software"), to deal in the Software without restriction, including 8dnl without limitation the rights to use, copy, modify, merge, publish, 9dnl distribute, sublicense, and/or sell copies of the Software, and to 10dnl permit persons to whom the Software is furnished to do so, subject to 11dnl the following conditions: 12 13dnl The above copyright notice and this permission notice shall be 14dnl included in all copies or substantial portions of the Software. 15 16dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 24dnl Do not change user variables! 25dnl https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html 26 27AC_PREREQ(2.61) 28AC_INIT([nghttp2], [1.55.0], [t-tujikawa@users.sourceforge.net]) 29AC_CONFIG_AUX_DIR([.]) 30AC_CONFIG_MACRO_DIR([m4]) 31AC_CONFIG_HEADERS([config.h]) 32AC_USE_SYSTEM_EXTENSIONS 33 34LT_PREREQ([2.2.6]) 35LT_INIT() 36 37AC_CANONICAL_BUILD 38AC_CANONICAL_HOST 39AC_CANONICAL_TARGET 40 41AM_INIT_AUTOMAKE([subdir-objects]) 42 43m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 44 45dnl See versioning rule: 46dnl https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html 47AC_SUBST(LT_CURRENT, 38) 48AC_SUBST(LT_REVISION, 2) 49AC_SUBST(LT_AGE, 24) 50 51major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"` 52minor=`echo $PACKAGE_VERSION |cut -d. -f2 | sed -e "s/[^0-9]//g"` 53patch=`echo $PACKAGE_VERSION |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"` 54 55PACKAGE_VERSION_NUM=`printf "0x%02x%02x%02x" "$major" "$minor" "$patch"` 56 57AC_SUBST(PACKAGE_VERSION_NUM) 58 59dnl Checks for command-line options 60AC_ARG_ENABLE([werror], 61 [AS_HELP_STRING([--enable-werror], 62 [Turn on compile time warnings])], 63 [werror=$enableval], [werror=no]) 64 65AC_ARG_ENABLE([debug], 66 [AS_HELP_STRING([--enable-debug], 67 [Turn on debug output])], 68 [debug=$enableval], [debug=no]) 69 70AC_ARG_ENABLE([threads], 71 [AS_HELP_STRING([--disable-threads], 72 [Turn off threading in apps])], 73 [threads=$enableval], [threads=yes]) 74 75AC_ARG_ENABLE([app], 76 [AS_HELP_STRING([--enable-app], 77 [Build applications (nghttp, nghttpd, nghttpx and h2load) [default=check]])], 78 [request_app=$enableval], [request_app=check]) 79 80AC_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]) 84 85AC_ARG_ENABLE([examples], 86 [AS_HELP_STRING([--enable-examples], 87 [Build examples [default=check]])], 88 [request_examples=$enableval], [request_examples=check]) 89 90AC_ARG_ENABLE([failmalloc], 91 [AS_HELP_STRING([--disable-failmalloc], 92 [Do not build failmalloc test program])], 93 [request_failmalloc=$enableval], [request_failmalloc=yes]) 94 95AC_ARG_ENABLE([lib-only], 96 [AS_HELP_STRING([--enable-lib-only], 97 [Build libnghttp2 only. This is a short hand for --disable-app --disable-examples --disable-hpack-tools])], 98 [request_lib_only=$enableval], [request_lib_only=no]) 99 100AC_ARG_ENABLE([http3], 101 [AS_HELP_STRING([--enable-http3], 102 [(EXPERIMENTAL) Enable HTTP/3. This requires ngtcp2, nghttp3, and a custom OpenSSL.])], 103 [request_http3=$enableval], [request_http3=no]) 104 105AC_ARG_WITH([libxml2], 106 [AS_HELP_STRING([--with-libxml2], 107 [Use libxml2 [default=check]])], 108 [request_libxml2=$withval], [request_libxml2=check]) 109 110AC_ARG_WITH([jansson], 111 [AS_HELP_STRING([--with-jansson], 112 [Use jansson [default=check]])], 113 [request_jansson=$withval], [request_jansson=check]) 114 115AC_ARG_WITH([zlib], 116 [AS_HELP_STRING([--with-zlib], 117 [Use zlib [default=check]])], 118 [request_zlib=$withval], [request_zlib=check]) 119 120AC_ARG_WITH([libevent-openssl], 121 [AS_HELP_STRING([--with-libevent-openssl], 122 [Use libevent_openssl [default=check]])], 123 [request_libevent_openssl=$withval], [request_libevent_openssl=check]) 124 125AC_ARG_WITH([libcares], 126 [AS_HELP_STRING([--with-libcares], 127 [Use libc-ares [default=check]])], 128 [request_libcares=$withval], [request_libcares=check]) 129 130AC_ARG_WITH([openssl], 131 [AS_HELP_STRING([--with-openssl], 132 [Use openssl [default=check]])], 133 [request_openssl=$withval], [request_openssl=check]) 134 135AC_ARG_WITH([libev], 136 [AS_HELP_STRING([--with-libev], 137 [Use libev [default=check]])], 138 [request_libev=$withval], [request_libev=check]) 139 140AC_ARG_WITH([cunit], 141 [AS_HELP_STRING([--with-cunit], 142 [Use cunit [default=check]])], 143 [request_cunit=$withval], [request_cunit=check]) 144 145AC_ARG_WITH([jemalloc], 146 [AS_HELP_STRING([--with-jemalloc], 147 [Use jemalloc [default=check]])], 148 [request_jemalloc=$withval], [request_jemalloc=check]) 149 150AC_ARG_WITH([systemd], 151 [AS_HELP_STRING([--with-systemd], 152 [Enable systemd support in nghttpx [default=check]])], 153 [request_systemd=$withval], [request_systemd=check]) 154 155AC_ARG_WITH([mruby], 156 [AS_HELP_STRING([--with-mruby], 157 [Use mruby [default=no]])], 158 [request_mruby=$withval], [request_mruby=no]) 159 160AC_ARG_WITH([neverbleed], 161 [AS_HELP_STRING([--with-neverbleed], 162 [Use neverbleed [default=no]])], 163 [request_neverbleed=$withval], [request_neverbleed=no]) 164 165AC_ARG_WITH([libngtcp2], 166 [AS_HELP_STRING([--with-libngtcp2], 167 [Use libngtcp2 [default=check]])], 168 [request_libngtcp2=$withval], [request_libngtcp2=check]) 169 170AC_ARG_WITH([libnghttp3], 171 [AS_HELP_STRING([--with-libnghttp3], 172 [Use libnghttp3 [default=check]])], 173 [request_libnghttp3=$withval], [request_libnghttp3=check]) 174 175AC_ARG_WITH([libbpf], 176 [AS_HELP_STRING([--with-libbpf], 177 [Use libbpf [default=no]])], 178 [request_libbpf=$withval], [request_libbpf=no]) 179 180dnl Define variables 181AC_ARG_VAR([LIBEV_CFLAGS], [C compiler flags for libev, skipping any checks]) 182AC_ARG_VAR([LIBEV_LIBS], [linker flags for libev, skipping any checks]) 183 184AC_ARG_VAR([JEMALLOC_CFLAGS], 185 [C compiler flags for jemalloc, skipping any checks]) 186AC_ARG_VAR([JEMALLOC_LIBS], [linker flags for jemalloc, skipping any checks]) 187 188AC_ARG_VAR([LIBTOOL_LDFLAGS], 189 [libtool specific flags (e.g., -static-libtool-libs)]) 190 191AC_ARG_VAR([BPFCFLAGS], [C compiler flags for bpf program]) 192 193dnl Checks for programs 194AC_PROG_CC 195AC_PROG_CXX 196AC_PROG_CPP 197AC_PROG_INSTALL 198AC_PROG_LN_S 199AC_PROG_MAKE_SET 200AC_PROG_MKDIR_P 201 202PKG_PROG_PKG_CONFIG([0.20]) 203 204AM_PATH_PYTHON([3.8],, [:]) 205 206if [test "x$request_lib_only" = "xyes"]; then 207 request_app=no 208 request_hpack_tools=no 209 request_examples=no 210 request_http3=no 211 request_libxml2=no 212 request_jansson=no 213 request_zlib=no 214 request_libevent_openssl=no 215 request_libcares=no 216 request_openssl=no 217 request_libev=no 218 request_jemalloc=no 219 request_systemd=no 220 request_mruby=no 221 request_neverbleed=no 222 request_libngtcp2=no 223 request_libnghttp3=no 224 request_libbpf=no 225fi 226 227if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then 228 AC_DEFINE([NGHTTP2_NORETURN], [__attribute__((noreturn))], [Hint to the compiler that a function never return]) 229else 230 AC_DEFINE([NGHTTP2_NORETURN], , [Hint to the compiler that a function never return]) 231fi 232 233save_CXXFLAGS="$CXXFLAGS" 234CXXFLAGS= 235 236AX_CXX_COMPILE_STDCXX([14], [noext], [optional]) 237 238CXX1XCXXFLAGS="$CXXFLAGS" 239CXXFLAGS="$save_CXXFLAGS" 240AC_SUBST([CXX1XCXXFLAGS]) 241 242AC_LANG_PUSH(C++) 243 244save_CXXFLAGS="$CXXFLAGS" 245CXXFLAGS="$CXXFLAGS $CXX1XCXXFLAGS" 246 247# Check that std::future is available. 248AC_MSG_CHECKING([whether std::future is available]) 249AC_COMPILE_IFELSE([AC_LANG_PROGRAM( 250[[ 251#include <vector> 252#include <future> 253]], 254[[ 255std::vector<std::future<int>> v; 256(void)v; 257]])], 258 [AC_DEFINE([HAVE_STD_FUTURE], [1], 259 [Define to 1 if you have the `std::future`.]) 260 have_std_future=yes 261 AC_MSG_RESULT([yes])], 262 [have_std_future=no 263 AC_MSG_RESULT([no])]) 264 265# Check that std::map::emplace is available for g++-4.7. 266AC_MSG_CHECKING([whether std::map::emplace is available]) 267AC_COMPILE_IFELSE([AC_LANG_PROGRAM( 268[[ 269#include <map> 270]], 271[[ 272std::map<int, int>().emplace(1, 2); 273]])], 274 [AC_DEFINE([HAVE_STD_MAP_EMPLACE], [1], 275 [Define to 1 if you have the `std::map::emplace`.]) 276 have_std_map_emplace=yes 277 AC_MSG_RESULT([yes])], 278 [have_std_map_emplace=no 279 AC_MSG_RESULT([no])]) 280 281# Check that std::atomic_* overloads for std::shared_ptr are 282# available. 283AC_MSG_CHECKING([whether std::atomic_* overloads for std::shared_ptr are available]) 284AC_COMPILE_IFELSE([AC_LANG_PROGRAM( 285[[ 286#include <memory> 287]], 288[[ 289auto a = std::make_shared<int>(1000000007); 290auto p = std::atomic_load(&a); 291++*p; 292std::atomic_store(&a, p); 293]])], 294 [AC_DEFINE([HAVE_ATOMIC_STD_SHARED_PTR], [1], 295 [Define to 1 if you have the std::atomic_* overloads for std::shared_ptr.]) 296 have_atomic_std_shared_ptr=yes 297 AC_MSG_RESULT([yes])], 298 [have_atomic_std_shared_ptr=no 299 AC_MSG_RESULT([no])]) 300 301# Check that thread_local storage specifier is available 302AC_MSG_CHECKING([whether thread_local storage class specifier is available.]) 303AC_COMPILE_IFELSE([AC_LANG_PROGRAM( 304, 305[[ 306thread_local int a = 0; 307(void)a; 308]])], 309 [AC_DEFINE([HAVE_THREAD_LOCAL], [1], 310 [Define to 1 if you have thread_local storage specifier.]) 311 have_thread_local=yes 312 AC_MSG_RESULT([yes])], 313 [have_Thread_local=no 314 AC_MSG_RESULT([no])]) 315 316CXXFLAGS=$save_CXXFLAGS 317 318AC_LANG_POP() 319 320# Checks for libraries. 321 322# Additional libraries required for tests. 323TESTLDADD= 324 325# Additional libraries required for programs under src directory. 326APPLDFLAGS= 327 328case "$host_os" in 329 *android*) 330 android_build=yes 331 # android does not need -pthread, but needs following 2 libs for C++ 332 APPLDFLAGS="$APPLDFLAGS -lstdc++ -latomic" 333 ;; 334 *) 335 PTHREAD_LDFLAGS="-pthread" 336 APPLDFLAGS="$APPLDFLAGS $PTHREAD_LDFLAGS" 337 ;; 338esac 339 340case "$host_os" in 341 *solaris*) 342 APPLDFLAGS="$APPLDFLAGS -lsocket -lnsl" 343 ;; 344esac 345 346case "${build}" in 347 *-apple-darwin*) 348 EXTRA_DEFS="-D__APPLE_USE_RFC_3542" 349 AC_SUBST([EXTRA_DEFS]) 350 ;; 351esac 352 353# zlib 354have_zlib=no 355if test "x${request_zlib}" != "xno"; then 356 PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no]) 357 358 if test "x${have_zlib}" = "xno"; then 359 AC_MSG_NOTICE($ZLIB_PKG_ERRORS) 360 fi 361fi 362 363if test "x${request_zlib}" = "xyes" && 364 test "x${have_zlib}" != "xyes"; then 365 AC_MSG_ERROR([zlib was requested (--with-zlib) but not found]) 366fi 367 368# dl: openssl requires libdl when it is statically linked. 369case "${host_os}" in 370 *bsd*) 371 # dlopen is in libc on *BSD 372 ;; 373 *) 374 save_LIBS=$LIBS 375 AC_SEARCH_LIBS([dlopen], [dl], [APPLDFLAGS="-ldl $APPLDFLAGS"], [], []) 376 LIBS=$save_LIBS 377 ;; 378esac 379 380# cunit 381have_cunit=no 382if test "x${request_cunit}" != "xno"; then 383 PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no]) 384 # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We 385 # do this because Debian (Ubuntu) lacks pkg-config file for cunit. 386 if test "x${have_cunit}" = "xno"; then 387 AC_MSG_WARN([${CUNIT_PKG_ERRORS}]) 388 AC_CHECK_LIB([cunit], [CU_initialize_registry], 389 [have_cunit=yes], [have_cunit=no]) 390 if test "x${have_cunit}" = "xyes"; then 391 CUNIT_LIBS="-lcunit" 392 CUNIT_CFLAGS="" 393 AC_SUBST([CUNIT_LIBS]) 394 AC_SUBST([CUNIT_CFLAGS]) 395 fi 396 fi 397 if test "x${have_cunit}" = "xyes"; then 398 # cunit in Mac OS X requires ncurses. Note that in Mac OS X, test 399 # program can be built without -lncurses, but it emits runtime 400 # error. 401 case "${build}" in 402 *-apple-darwin*) 403 CUNIT_LIBS="$CUNIT_LIBS -lncurses" 404 AC_SUBST([CUNIT_LIBS]) 405 ;; 406 esac 407 fi 408fi 409 410if test "x${request_cunit}" = "xyes" && 411 test "x${have_cunit}" != "xyes"; then 412 AC_MSG_ERROR([cunit was requested (--with-cunit) but not found]) 413fi 414 415AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ]) 416 417# libev (for src) 418have_libev=no 419if test "x${request_libev}" != "xno"; then 420 if test "x${LIBEV_LIBS}" = "x" && test "x${LIBEV_CFLAGS}" = "x"; then 421 # libev does not have pkg-config file. Check it in an old way. 422 save_LIBS=$LIBS 423 # android requires -lm for floor 424 AC_CHECK_LIB([ev], [ev_time], [have_libev=yes], [have_libev=no], [-lm]) 425 if test "x${have_libev}" = "xyes"; then 426 AC_CHECK_HEADER([ev.h], [have_libev=yes], [have_libev=no]) 427 if test "x${have_libev}" = "xyes"; then 428 LIBEV_LIBS=-lev 429 LIBEV_CFLAGS= 430 fi 431 fi 432 LIBS=$save_LIBS 433 else 434 have_libev=yes 435 fi 436 437 if test "x${have_libev}" = "xyes"; then 438 AC_DEFINE([HAVE_LIBEV], [1], [Define to 1 if you have `libev` library.]) 439 fi 440fi 441 442if test "x${request_libev}" = "xyes" && 443 test "x${have_libev}" != "xyes"; then 444 AC_MSG_ERROR([libev was requested (--with-libev) but not found]) 445fi 446 447# openssl (for src) 448have_openssl=no 449if test "x${request_openssl}" != "xno"; then 450 PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.1], 451 [have_openssl=yes], [have_openssl=no]) 452 if test "x${have_openssl}" = "xno"; then 453 AC_MSG_NOTICE($OPENSSL_PKG_ERRORS) 454 else 455 save_CFLAGS="$CFLAGS" 456 save_LIBS="$LIBS" 457 CFLAGS="$OPENSSL_CFLAGS $CFLAGS" 458 LIBS="$OPENSSL_LIBS $LIBS" 459 460 # quictls/openssl has SSL_is_quic. 461 have_ssl_is_quic=no 462 AC_MSG_CHECKING([for SSL_is_quic]) 463 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 464 #include <openssl/ssl.h> 465 ]], [[ 466 SSL *ssl = NULL; 467 SSL_is_quic(ssl); 468 ]])], 469 [AC_MSG_RESULT([yes]); have_ssl_is_quic=yes], 470 [AC_MSG_RESULT([no]); have_ssl_is_quic=no]) 471 472 # boringssl has SSL_set_quic_early_data_context. 473 AC_MSG_CHECKING([for SSL_set_quic_early_data_context]) 474 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 475 #include <openssl/ssl.h> 476 ]], [[ 477 SSL *ssl = NULL; 478 SSL_set_quic_early_data_context(ssl, NULL, 0); 479 ]])], 480 [AC_MSG_RESULT([yes]); have_boringssl_quic=yes], 481 [AC_MSG_RESULT([no]); have_boringssl_quic=no]) 482 483 CFLAGS="$save_CFLAGS" 484 LIBS="$save_LIBS" 485 fi 486fi 487 488if test "x${request_openssl}" = "xyes" && 489 test "x${have_openssl}" != "xyes"; then 490 AC_MSG_ERROR([openssl was requested (--with-openssl) but not found]) 491fi 492 493# c-ares (for src) 494have_libcares=no 495if test "x${request_libcares}" != "xno"; then 496 PKG_CHECK_MODULES([LIBCARES], [libcares >= 1.7.5], [have_libcares=yes], 497 [have_libcares=no]) 498 if test "x${have_libcares}" = "xno"; then 499 AC_MSG_NOTICE($LIBCARES_PKG_ERRORS) 500 fi 501fi 502 503if test "x${request_libcares}" = "xyes" && 504 test "x${have_libcares}" != "xyes"; then 505 AC_MSG_ERROR([libcares was requested (--with-libcares) but not found]) 506fi 507 508# ngtcp2 (for src) 509have_libngtcp2=no 510if test "x${request_libngtcp2}" != "xno"; then 511 PKG_CHECK_MODULES([LIBNGTCP2], [libngtcp2 >= 0.17.0], [have_libngtcp2=yes], 512 [have_libngtcp2=no]) 513 if test "x${have_libngtcp2}" = "xno"; then 514 AC_MSG_NOTICE($LIBNGTCP2_PKG_ERRORS) 515 fi 516fi 517 518if test "x${request_libngtcp2}" = "xyes" && 519 test "x${have_libngtcp2}" != "xyes"; then 520 AC_MSG_ERROR([libngtcp2 was requested (--with-libngtcp2) but not found]) 521fi 522 523# ngtcp2_crypto_quictls (for src) 524have_libngtcp2_crypto_quictls=no 525if test "x${have_ssl_is_quic}" = "xyes" && 526 test "x${request_libngtcp2}" != "xno"; then 527 PKG_CHECK_MODULES([LIBNGTCP2_CRYPTO_QUICTLS], 528 [libngtcp2_crypto_quictls >= 0.17.0], 529 [have_libngtcp2_crypto_quictls=yes], 530 [have_libngtcp2_crypto_quictls=no]) 531 if test "x${have_libngtcp2_crypto_quictls}" = "xno"; then 532 AC_MSG_NOTICE($LIBNGTCP2_CRYPTO_QUICTLS_PKG_ERRORS) 533 else 534 AC_DEFINE([HAVE_LIBNGTCP2_CRYPTO_QUICTLS], [1], 535 [Define to 1 if you have `libngtcp2_crypto_quictls` library.]) 536 fi 537fi 538 539if test "x${have_ssl_is_quic}" = "xyes" && 540 test "x${request_libngtcp2}" = "xyes" && 541 test "x${have_libngtcp2_crypto_quictls}" != "xyes"; then 542 AC_MSG_ERROR([libngtcp2_crypto_quictls was requested (--with-libngtcp2) but not found]) 543fi 544 545# ngtcp2_crypto_boringssl (for src) 546have_libngtcp2_crypto_boringssl=no 547if test "x${have_boringssl_quic}" = "xyes" && 548 test "x${request_libngtcp2}" != "xno"; then 549 PKG_CHECK_MODULES([LIBNGTCP2_CRYPTO_BORINGSSL], 550 [libngtcp2_crypto_boringssl >= 0.0.0], 551 [have_libngtcp2_crypto_boringssl=yes], 552 [have_libngtcp2_crypto_boringssl=no]) 553 if test "x${have_libngtcp2_crypto_boringssl}" = "xno"; then 554 AC_MSG_NOTICE($LIBNGTCP2_CRYPTO_BORINGSSL_PKG_ERRORS) 555 else 556 AC_DEFINE([HAVE_LIBNGTCP2_CRYPTO_BORINGSSL], [1], 557 [Define to 1 if you have `libngtcp2_crypto_boringssl` library.]) 558 fi 559fi 560 561if test "x${have_boringssl_quic}" = "xyes" && 562 test "x${request_libngtcp2}" = "xyes" && 563 test "x${have_libngtcp2_crypto_boringssl}" != "xyes"; then 564 AC_MSG_ERROR([libngtcp2_crypto_boringssl was requested (--with-libngtcp2) but not found]) 565fi 566 567# nghttp3 (for src) 568have_libnghttp3=no 569if test "x${request_libnghttp3}" != "xno"; then 570 PKG_CHECK_MODULES([LIBNGHTTP3], [libnghttp3 >= 0.13.0], [have_libnghttp3=yes], 571 [have_libnghttp3=no]) 572 if test "x${have_libnghttp3}" = "xno"; then 573 AC_MSG_NOTICE($LIBNGHTTP3_PKG_ERRORS) 574 fi 575fi 576 577if test "x${request_libnghttp3}" = "xyes" && 578 test "x${have_libnghttp3}" != "xyes"; then 579 AC_MSG_ERROR([libnghttp3 was requested (--with-libnghttp3) but not found]) 580fi 581 582# libbpf (for src) 583have_libbpf=no 584if test "x${request_libbpf}" != "xno"; then 585 PKG_CHECK_MODULES([LIBBPF], [libbpf >= 0.7.0], [have_libbpf=yes], 586 [have_libbpf=no]) 587 if test "x${have_libbpf}" = "xyes"; then 588 AC_DEFINE([HAVE_LIBBPF], [1], [Define to 1 if you have `libbpf` library.]) 589 if test "x${BPFCFLAGS}" = "x"; then 590 BPFCFLAGS="-Wall -O2 -g" 591 fi 592 # Add the include path for Debian 593 EXTRABPFCFLAGS="-I/usr/include/$host_cpu-$host_os" 594 AC_SUBST([EXTRABPFCFLAGS]) 595 596 AC_MSG_CHECKING([whether enum bpf_stats_type is defined in linux/bpf.h]) 597 AC_COMPILE_IFELSE([AC_LANG_PROGRAM( 598 [[ 599 #include <linux/bpf.h> 600 ]], 601 [[ 602 enum bpf_stats_type foo; 603 (void)foo; 604 ]])], 605 [have_bpf_stats_type=yes], 606 [have_bpf_stats_type=no]) 607 608 if test "x${have_bpf_stats_type}" = "xyes"; then 609 AC_MSG_RESULT([yes]) 610 AC_DEFINE([HAVE_BPF_STATS_TYPE], [1], 611 [Define to 1 if you have enum bpf_stats_type in linux/bpf.h.]) 612 else 613 AC_MSG_RESULT([no]) 614 fi 615 else 616 AC_MSG_NOTICE($LIBBPF_PKG_ERRORS) 617 fi 618fi 619 620if test "x${request_libbpf}" = "xyes" && 621 test "x${have_libbpf}" != "xyes"; then 622 AC_MSG_ERROR([libbpf was requested (--with-libbpf) but not found]) 623fi 624 625AM_CONDITIONAL([HAVE_LIBBPF], [ test "x${have_libbpf}" = "xyes" ]) 626 627# libevent_openssl (for examples) 628# 2.0.8 is required because we use evconnlistener_set_error_cb() 629have_libevent_openssl=no 630if test "x${request_libevent_openssl}" != "xno"; then 631 PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.0.8], 632 [have_libevent_openssl=yes], [have_libevent_openssl=no]) 633 if test "x${have_libevent_openssl}" = "xno"; then 634 AC_MSG_NOTICE($LIBEVENT_OPENSSL_PKG_ERRORS) 635 fi 636fi 637 638if test "x${request_libevent_openssl}" = "xyes" && 639 test "x${have_libevent_openssl}" != "xyes"; then 640 AC_MSG_ERROR([libevent_openssl was requested (--with-libevent) but not found]) 641fi 642 643# jansson (for src/nghttp, src/deflatehd and src/inflatehd) 644have_jansson=no 645if test "x${request_jansson}" != "xno"; then 646 PKG_CHECK_MODULES([JANSSON], [jansson >= 2.5], 647 [have_jansson=yes], [have_jansson=no]) 648 if test "x${have_jansson}" = "xyes"; then 649 AC_DEFINE([HAVE_JANSSON], [1], 650 [Define to 1 if you have `libjansson` library.]) 651 else 652 AC_MSG_NOTICE($JANSSON_PKG_ERRORS) 653 fi 654fi 655 656if test "x${request_jansson}" = "xyes" && 657 test "x${have_jansson}" != "xyes"; then 658 AC_MSG_ERROR([jansson was requested (--with-jansson) but not found]) 659fi 660 661# libsystemd (for src/nghttpx) 662have_libsystemd=no 663if test "x${request_systemd}" != "xno"; then 664 PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209], [have_libsystemd=yes], 665 [have_libsystemd=no]) 666 if test "x${have_libsystemd}" = "xyes"; then 667 AC_DEFINE([HAVE_LIBSYSTEMD], [1], 668 [Define to 1 if you have `libsystemd` library.]) 669 else 670 AC_MSG_NOTICE($SYSTEMD_PKG_ERRORS) 671 fi 672fi 673 674if test "x${request_systemd}" = "xyes" && 675 test "x${have_libsystemd}" != "xyes"; then 676 AC_MSG_ERROR([systemd was requested (--with-systemd) but not found]) 677fi 678 679# libxml2 (for src/nghttp) 680have_libxml2=no 681if test "x${request_libxml2}" != "xno"; then 682 PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.26], 683 [have_libxml2=yes], [have_libxml2=no]) 684 if test "x${have_libxml2}" = "xyes"; then 685 AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have `libxml2` library.]) 686 else 687 AC_MSG_NOTICE($LIBXML2_PKG_ERRORS) 688 fi 689fi 690 691if test "x${request_libxml2}" = "xyes" && 692 test "x${have_libxml2}" != "xyes"; then 693 AC_MSG_ERROR([libxml2 was requested (--with-libxml2) but not found]) 694fi 695 696AM_CONDITIONAL([HAVE_LIBXML2], [ test "x${have_libxml2}" = "xyes" ]) 697 698# jemalloc 699have_jemalloc=no 700if test "x${request_jemalloc}" != "xno"; then 701 if test "x${JEMALLOC_LIBS}" = "x" && test "x${JEMALLOC_CFLAGS}" = "x"; then 702 save_LIBS=$LIBS 703 AC_SEARCH_LIBS([malloc_stats_print], [jemalloc], [have_jemalloc=yes], [], 704 [$PTHREAD_LDFLAGS]) 705 706 if test "x${have_jemalloc}" = "xyes"; then 707 jemalloc_libs=${ac_cv_search_malloc_stats_print} 708 else 709 # On Darwin, malloc_stats_print is je_malloc_stats_print 710 AC_SEARCH_LIBS([je_malloc_stats_print], [jemalloc], [have_jemalloc=yes], [], 711 [$PTHREAD_LDFLAGS]) 712 713 if test "x${have_jemalloc}" = "xyes"; then 714 jemalloc_libs=${ac_cv_search_je_malloc_stats_print} 715 fi 716 fi 717 718 LIBS=$save_LIBS 719 720 if test "x${have_jemalloc}" = "xyes" && 721 test "x${jemalloc_libs}" != "xnone required"; then 722 JEMALLOC_LIBS=${jemalloc_libs} 723 fi 724 else 725 have_jemalloc=yes 726 fi 727fi 728 729if test "x${request_jemalloc}" = "xyes" && 730 test "x${have_jemalloc}" != "xyes"; then 731 AC_MSG_ERROR([jemalloc was requested (--with-jemalloc) but not found]) 732fi 733 734# The nghttp, nghttpd and nghttpx under src depend on zlib, OpenSSL, 735# libev, and libc-ares. 736enable_app=no 737if test "x${request_app}" != "xno" && 738 test "x${have_zlib}" = "xyes" && 739 test "x${have_openssl}" = "xyes" && 740 test "x${have_libev}" = "xyes" && 741 test "x${have_libcares}" = "xyes"; then 742 enable_app=yes 743fi 744 745if test "x${request_app}" = "xyes" && 746 test "x${enable_app}" != "xyes"; then 747 AC_MSG_ERROR([applications were requested (--enable-app) but dependencies are not met.]) 748fi 749 750AM_CONDITIONAL([ENABLE_APP], [ test "x${enable_app}" = "xyes" ]) 751 752# Check HTTP/3 support 753enable_http3=no 754if test "x${request_http3}" != "xno" && 755 (test "x${have_ssl_is_quic}" = "xyes" || 756 test "x${have_boringssl_quic}" = "xyes") && 757 test "x${have_libngtcp2}" = "xyes" && 758 (test "x${have_libngtcp2_crypto_quictls}" = "xyes" || 759 test "x${have_libngtcp2_crypto_boringssl}" = "xyes") && 760 test "x${have_libnghttp3}" = "xyes"; then 761 enable_http3=yes 762 AC_DEFINE([ENABLE_HTTP3], [1], [Define to 1 if HTTP/3 is enabled.]) 763fi 764 765if test "x${request_http3}" = "xyes" && 766 test "x${enable_http3}" != "xyes"; then 767 AC_MSG_ERROR([HTTP/3 was requested (--enable-http3) but dependencies are not met.]) 768fi 769 770AM_CONDITIONAL([ENABLE_HTTP3], [ test "x${enable_http3}" = "xyes" ]) 771 772enable_hpack_tools=no 773# HPACK tools requires jansson 774if test "x${request_hpack_tools}" != "xno" && 775 test "x${have_jansson}" = "xyes"; then 776 enable_hpack_tools=yes 777fi 778 779if test "x${request_hpack_tools}" = "xyes" && 780 test "x${enable_hpack_tools}" != "xyes"; then 781 AC_MSG_ERROR([HPACK tools were requested (--enable-hpack-tools) but dependencies are not met.]) 782fi 783 784AM_CONDITIONAL([ENABLE_HPACK_TOOLS], [ test "x${enable_hpack_tools}" = "xyes" ]) 785 786# The example programs depend on OpenSSL and libevent_openssl 787enable_examples=no 788if test "x${request_examples}" != "xno" && 789 test "x${have_openssl}" = "xyes" && 790 test "x${have_libevent_openssl}" = "xyes"; then 791 enable_examples=yes 792fi 793 794if test "x${request_examples}" = "xyes" && 795 test "x${enable_examples}" != "xyes"; then 796 AC_MSG_ERROR([examples were requested (--enable-examples) but dependencies are not met.]) 797fi 798 799AM_CONDITIONAL([ENABLE_EXAMPLES], [ test "x${enable_examples}" = "xyes" ]) 800 801# third-party only be built when needed 802 803enable_third_party=no 804have_mruby=no 805have_neverbleed=no 806if test "x${enable_examples}" = "xyes" || 807 test "x${enable_app}" = "xyes" || 808 test "x${enable_hpack_tools}" = "xyes"; then 809 enable_third_party=yes 810 811 # mruby (for src/nghttpx) 812 if test "x${request_mruby}" = "xyes"; then 813 # We are going to build mruby 814 have_mruby=yes 815 AC_DEFINE([HAVE_MRUBY], [1], [Define to 1 if you have `mruby` library.]) 816 LIBMRUBY_LIBS="-lmruby -lm" 817 LIBMRUBY_CFLAGS= 818 AC_SUBST([LIBMRUBY_LIBS]) 819 AC_SUBST([LIBMRUBY_CFLAGS]) 820 fi 821 822 # neverbleed (for src/nghttpx) 823 if test "x${request_neverbleed}" = "xyes"; then 824 have_neverbleed=yes 825 AC_DEFINE([HAVE_NEVERBLEED], [1], [Define to 1 if you have `neverbleed` library.]) 826 fi 827fi 828 829AM_CONDITIONAL([ENABLE_THIRD_PARTY], [ test "x${enable_third_party}" = "xyes" ]) 830AM_CONDITIONAL([HAVE_MRUBY], [test "x${have_mruby}" = "xyes"]) 831AM_CONDITIONAL([HAVE_NEVERBLEED], [test "x${have_neverbleed}" = "xyes"]) 832 833# failmalloc tests 834enable_failmalloc=no 835if test "x${request_failmalloc}" = "xyes"; then 836 enable_failmalloc=yes 837fi 838 839AM_CONDITIONAL([ENABLE_FAILMALLOC], [ test "x${enable_failmalloc}" = "xyes" ]) 840 841# Checks for header files. 842AC_HEADER_ASSERT 843AC_CHECK_HEADERS([ \ 844 arpa/inet.h \ 845 fcntl.h \ 846 inttypes.h \ 847 limits.h \ 848 netdb.h \ 849 netinet/in.h \ 850 pwd.h \ 851 stddef.h \ 852 stdint.h \ 853 stdlib.h \ 854 string.h \ 855 sys/socket.h \ 856 sys/time.h \ 857 sysinfoapi.h \ 858 syslog.h \ 859 time.h \ 860 unistd.h \ 861]) 862 863# Checks for typedefs, structures, and compiler characteristics. 864AC_TYPE_SIZE_T 865AC_TYPE_SSIZE_T 866AC_TYPE_UINT8_T 867AC_TYPE_UINT16_T 868AC_TYPE_UINT32_T 869AC_TYPE_UINT64_T 870AC_TYPE_INT8_T 871AC_TYPE_INT16_T 872AC_TYPE_INT32_T 873AC_TYPE_INT64_T 874AC_TYPE_OFF_T 875AC_TYPE_PID_T 876AC_TYPE_UID_T 877AC_CHECK_TYPES([ptrdiff_t]) 878AC_C_BIGENDIAN 879AC_C_INLINE 880AC_SYS_LARGEFILE 881 882AC_CHECK_MEMBER([struct tm.tm_gmtoff], [have_struct_tm_tm_gmtoff=yes], 883 [have_struct_tm_tm_gmtoff=no], [[#include <time.h>]]) 884 885AC_CHECK_MEMBER([struct sockaddr_in.sin_len], 886 [AC_DEFINE([HAVE_SOCKADDR_IN_SIN_LEN],[1], 887 [Define to 1 if struct sockaddr_in has sin_len member.])], 888 [], 889 [[ 890#include <sys/types.h> 891#include <sys/socket.h> 892#include <netinet/in.h> 893]]) 894 895AC_CHECK_MEMBER([struct sockaddr_in6.sin6_len], 896 [AC_DEFINE([HAVE_SOCKADDR_IN6_SIN6_LEN],[1], 897 [Define to 1 if struct sockaddr_in6 has sin6_len member.])], 898 [], 899 [[ 900#include <sys/types.h> 901#include <sys/socket.h> 902#include <netinet/in.h> 903]]) 904 905if test "x$have_struct_tm_tm_gmtoff" = "xyes"; then 906 AC_DEFINE([HAVE_STRUCT_TM_TM_GMTOFF], [1], 907 [Define to 1 if you have `struct tm.tm_gmtoff` member.]) 908fi 909 910# Check size of pointer to decide we need 8 bytes alignment 911# adjustment. 912AC_CHECK_SIZEOF([int *]) 913 914AC_CHECK_SIZEOF([time_t]) 915 916# Checks for library functions. 917 918# Don't check malloc, since it does not play nicely with C++ stdlib 919# AC_FUNC_MALLOC 920 921AC_FUNC_CHOWN 922AC_FUNC_ERROR_AT_LINE 923AC_FUNC_FORK 924# Don't check realloc, since LeakSanitizer detects memory leak during check 925# AC_FUNC_REALLOC 926AC_FUNC_STRERROR_R 927AC_FUNC_STRNLEN 928 929AC_CHECK_FUNCS([ \ 930 _Exit \ 931 accept4 \ 932 clock_gettime \ 933 dup2 \ 934 getcwd \ 935 getpwnam \ 936 localtime_r \ 937 memchr \ 938 memmove \ 939 memset \ 940 mkostemp \ 941 socket \ 942 sqrt \ 943 strchr \ 944 strdup \ 945 strerror \ 946 strndup \ 947 strstr \ 948 strtol \ 949 strtoul \ 950 timegm \ 951]) 952 953# timerfd_create was added in linux kernel 2.6.25 954 955AC_CHECK_FUNC([timerfd_create], 956 [have_timerfd_create=yes], [have_timerfd_create=no]) 957 958AC_MSG_CHECKING([checking for GetTickCount64]) 959AC_LINK_IFELSE([AC_LANG_PROGRAM( 960[[ 961#include <sysinfoapi.h> 962]], 963[[ 964GetTickCount64(); 965]])], 966[have_gettickcount64=yes], 967[have_gettickcount64=no]) 968 969if test "x${have_gettickcount64}" = "xyes"; then 970 AC_MSG_RESULT([yes]) 971 AC_DEFINE([HAVE_GETTICKCOUNT64], [1], 972 [Define to 1 if you have `GetTickCount64` function.]) 973else 974 AC_MSG_RESULT([no]) 975fi 976 977# For cygwin: we can link initgroups, so AC_CHECK_FUNCS succeeds, but 978# cygwin disables initgroups due to feature test macro magic with our 979# configuration. FreeBSD declares initgroups() in unistd.h. 980AC_CHECK_DECLS([initgroups], [], [], [[ 981 #ifdef HAVE_UNISTD_H 982 # include <unistd.h> 983 #endif 984 #include <grp.h> 985]]) 986 987save_CFLAGS=$CFLAGS 988save_CXXFLAGS=$CXXFLAGS 989 990CFLAGS= 991CXXFLAGS= 992 993if test "x$werror" != "xno"; then 994 # For C compiler 995 AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"]) 996 AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"]) 997 AX_CHECK_COMPILE_FLAG([-Werror], [CFLAGS="$CFLAGS -Werror"]) 998 AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"]) 999 AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], [CFLAGS="$CFLAGS -Wstrict-prototypes"]) 1000 AX_CHECK_COMPILE_FLAG([-Wmissing-declarations], [CFLAGS="$CFLAGS -Wmissing-declarations"]) 1001 AX_CHECK_COMPILE_FLAG([-Wpointer-arith], [CFLAGS="$CFLAGS -Wpointer-arith"]) 1002 AX_CHECK_COMPILE_FLAG([-Wdeclaration-after-statement], [CFLAGS="$CFLAGS -Wdeclaration-after-statement"]) 1003 AX_CHECK_COMPILE_FLAG([-Wformat-security], [CFLAGS="$CFLAGS -Wformat-security"]) 1004 AX_CHECK_COMPILE_FLAG([-Wwrite-strings], [CFLAGS="$CFLAGS -Wwrite-strings"]) 1005 AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"]) 1006 AX_CHECK_COMPILE_FLAG([-Winline], [CFLAGS="$CFLAGS -Winline"]) 1007 AX_CHECK_COMPILE_FLAG([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"]) 1008 AX_CHECK_COMPILE_FLAG([-Wfloat-equal], [CFLAGS="$CFLAGS -Wfloat-equal"]) 1009 AX_CHECK_COMPILE_FLAG([-Wundef], [CFLAGS="$CFLAGS -Wundef"]) 1010 AX_CHECK_COMPILE_FLAG([-Wendif-labels], [CFLAGS="$CFLAGS -Wendif-labels"]) 1011 AX_CHECK_COMPILE_FLAG([-Wempty-body], [CFLAGS="$CFLAGS -Wempty-body"]) 1012 AX_CHECK_COMPILE_FLAG([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"]) 1013 AX_CHECK_COMPILE_FLAG([-Wclobbered], [CFLAGS="$CFLAGS -Wclobbered"]) 1014 AX_CHECK_COMPILE_FLAG([-Wvla], [CFLAGS="$CFLAGS -Wvla"]) 1015 AX_CHECK_COMPILE_FLAG([-Wpragmas], [CFLAGS="$CFLAGS -Wpragmas"]) 1016 AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [CFLAGS="$CFLAGS -Wunreachable-code"]) 1017 AX_CHECK_COMPILE_FLAG([-Waddress], [CFLAGS="$CFLAGS -Waddress"]) 1018 AX_CHECK_COMPILE_FLAG([-Wattributes], [CFLAGS="$CFLAGS -Wattributes"]) 1019 AX_CHECK_COMPILE_FLAG([-Wdiv-by-zero], [CFLAGS="$CFLAGS -Wdiv-by-zero"]) 1020 AX_CHECK_COMPILE_FLAG([-Wshorten-64-to-32], [CFLAGS="$CFLAGS -Wshorten-64-to-32"]) 1021 1022 AX_CHECK_COMPILE_FLAG([-Wconversion], [CFLAGS="$CFLAGS -Wconversion"]) 1023 AX_CHECK_COMPILE_FLAG([-Wextended-offsetof], [CFLAGS="$CFLAGS -Wextended-offsetof"]) 1024 AX_CHECK_COMPILE_FLAG([-Wformat-nonliteral], [CFLAGS="$CFLAGS -Wformat-nonliteral"]) 1025 AX_CHECK_COMPILE_FLAG([-Wlanguage-extension-token], [CFLAGS="$CFLAGS -Wlanguage-extension-token"]) 1026 AX_CHECK_COMPILE_FLAG([-Wmissing-field-initializers], [CFLAGS="$CFLAGS -Wmissing-field-initializers"]) 1027 AX_CHECK_COMPILE_FLAG([-Wmissing-noreturn], [CFLAGS="$CFLAGS -Wmissing-noreturn"]) 1028 AX_CHECK_COMPILE_FLAG([-Wmissing-variable-declarations], [CFLAGS="$CFLAGS -Wmissing-variable-declarations"]) 1029 # Not used because we cannot change public structs 1030 # AX_CHECK_COMPILE_FLAG([-Wpadded], [CFLAGS="$CFLAGS -Wpadded"]) 1031 AX_CHECK_COMPILE_FLAG([-Wsign-conversion], [CFLAGS="$CFLAGS -Wsign-conversion"]) 1032 # Not used because this basically disallows default case 1033 # AX_CHECK_COMPILE_FLAG([-Wswitch-enum], [CFLAGS="$CFLAGS -Wswitch-enum"]) 1034 AX_CHECK_COMPILE_FLAG([-Wunreachable-code-break], [CFLAGS="$CFLAGS -Wunreachable-code-break"]) 1035 AX_CHECK_COMPILE_FLAG([-Wunused-macros], [CFLAGS="$CFLAGS -Wunused-macros"]) 1036 AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [CFLAGS="$CFLAGS -Wunused-parameter"]) 1037 AX_CHECK_COMPILE_FLAG([-Wredundant-decls], [CFLAGS="$CFLAGS -Wredundant-decls"]) 1038 # Only work with Clang for the moment 1039 AX_CHECK_COMPILE_FLAG([-Wheader-guard], [CFLAGS="$CFLAGS -Wheader-guard"]) 1040 AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CFLAGS="$CFLAGS -Wsometimes-uninitialized"]) 1041 1042 # This is required because we pass format string as "const char*. 1043 AX_CHECK_COMPILE_FLAG([-Wno-format-nonliteral], [CFLAGS="$CFLAGS -Wno-format-nonliteral"]) 1044 1045 # For C++ compiler 1046 AC_LANG_PUSH(C++) 1047 AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"]) 1048 AX_CHECK_COMPILE_FLAG([-Werror], [CXXFLAGS="$CXXFLAGS -Werror"]) 1049 AX_CHECK_COMPILE_FLAG([-Wformat-security], [CXXFLAGS="$CXXFLAGS -Wformat-security"]) 1050 AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CXXFLAGS="$CXXFLAGS -Wsometimes-uninitialized"]) 1051 # Disable noexcept-type warning of g++-7. This is not harmful as 1052 # long as all source files are compiled with the same compiler. 1053 AX_CHECK_COMPILE_FLAG([-Wno-noexcept-type], [CXXFLAGS="$CXXFLAGS -Wno-noexcept-type"]) 1054 AC_LANG_POP() 1055fi 1056 1057WARNCFLAGS=$CFLAGS 1058WARNCXXFLAGS=$CXXFLAGS 1059 1060CFLAGS=$save_CFLAGS 1061CXXFLAGS=$save_CXXFLAGS 1062 1063AC_SUBST([WARNCFLAGS]) 1064AC_SUBST([WARNCXXFLAGS]) 1065 1066EXTRACFLAG= 1067AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [EXTRACFLAG="-fvisibility=hidden"]) 1068 1069AC_SUBST([EXTRACFLAG]) 1070 1071if test "x$debug" != "xno"; then 1072 AC_DEFINE([DEBUGBUILD], [1], [Define to 1 to enable debug output.]) 1073fi 1074 1075enable_threads=yes 1076# Some platform does not have working std::future. We disable 1077# threading for those platforms. 1078if test "x$threads" != "xyes" || 1079 test "x$have_std_future" != "xyes"; then 1080 enable_threads=no 1081 AC_DEFINE([NOTHREADS], [1], [Define to 1 if you want to disable threads.]) 1082fi 1083 1084# propagate $enable_static to tests/Makefile.am 1085AM_CONDITIONAL([ENABLE_STATIC], [test "x$enable_static" = "xyes"]) 1086 1087AC_SUBST([TESTLDADD]) 1088AC_SUBST([APPLDFLAGS]) 1089 1090AC_CONFIG_FILES([ 1091 Makefile 1092 lib/Makefile 1093 lib/libnghttp2.pc 1094 lib/includes/Makefile 1095 lib/includes/nghttp2/nghttp2ver.h 1096 tests/Makefile 1097 tests/testdata/Makefile 1098 third-party/Makefile 1099 src/Makefile 1100 src/testdata/Makefile 1101 bpf/Makefile 1102 examples/Makefile 1103 integration-tests/Makefile 1104 integration-tests/config.go 1105 integration-tests/setenv 1106 doc/Makefile 1107 doc/conf.py 1108 doc/index.rst 1109 doc/package_README.rst 1110 doc/tutorial-client.rst 1111 doc/tutorial-server.rst 1112 doc/tutorial-hpack.rst 1113 doc/nghttpx-howto.rst 1114 doc/h2load-howto.rst 1115 doc/building-android-binary.rst 1116 doc/nghttp2.h.rst 1117 doc/nghttp2ver.h.rst 1118 doc/contribute.rst 1119 contrib/Makefile 1120 script/Makefile 1121]) 1122AC_OUTPUT 1123 1124AC_MSG_NOTICE([summary of build options: 1125 1126 Package version: ${VERSION} 1127 Library version: $LT_CURRENT:$LT_REVISION:$LT_AGE 1128 Install prefix: ${prefix} 1129 System types: 1130 Build: ${build} 1131 Host: ${host} 1132 Target: ${target} 1133 Compiler: 1134 C compiler: ${CC} 1135 CFLAGS: ${CFLAGS} 1136 LDFLAGS: ${LDFLAGS} 1137 C++ compiler: ${CXX} 1138 CXXFLAGS: ${CXXFLAGS} 1139 CXXCPP: ${CXXCPP} 1140 C preprocessor: ${CPP} 1141 CPPFLAGS: ${CPPFLAGS} 1142 WARNCFLAGS: ${WARNCFLAGS} 1143 WARNCXXFLAGS: ${WARNCXXFLAGS} 1144 CXX1XCXXFLAGS: ${CXX1XCXXFLAGS} 1145 EXTRACFLAG: ${EXTRACFLAG} 1146 BPFCFLAGS: ${BPFCFLAGS} 1147 EXTRABPFCFLAGS: ${EXTRABPFCFLAGS} 1148 LIBS: ${LIBS} 1149 DEFS: ${DEFS} 1150 EXTRA_DEFS: ${EXTRA_DEFS} 1151 Library: 1152 Shared: ${enable_shared} 1153 Static: ${enable_static} 1154 Libtool: 1155 LIBTOOL_LDFLAGS: ${LIBTOOL_LDFLAGS} 1156 Python: 1157 Python: ${PYTHON} 1158 PYTHON_VERSION: ${PYTHON_VERSION} 1159 Test: 1160 CUnit: ${have_cunit} (CFLAGS='${CUNIT_CFLAGS}' LIBS='${CUNIT_LIBS}') 1161 Failmalloc: ${enable_failmalloc} 1162 Libs: 1163 OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}') 1164 Libxml2: ${have_libxml2} (CFLAGS='${LIBXML2_CFLAGS}' LIBS='${LIBXML2_LIBS}') 1165 Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}') 1166 Libc-ares: ${have_libcares} (CFLAGS='${LIBCARES_CFLAGS}' LIBS='${LIBCARES_LIBS}') 1167 libngtcp2: ${have_libngtcp2} (CFLAGS='${LIBNGTCP2_CFLAGS}' LIBS='${LIBNGTCP2_LIBS}') 1168 libngtcp2_crypto_quictls: ${have_libngtcp2_crypto_quictls} (CFLAGS='${LIBNGTCP2_CRYPTO_QUICTLS_CFLAGS}' LIBS='${LIBNGTCP2_CRYPTO_QUICTLS_LIBS}') 1169 libngtcp2_crypto_boringssl: ${have_libngtcp2_crypto_boringssl} (CFLAGS='${LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS}' LIBS='${LIBNGTCP2_CRYPTO_BORINGSSL_LIBS}') 1170 libnghttp3: ${have_libnghttp3} (CFLAGS='${LIBNGHTTP3_CFLAGS}' LIBS='${LIBNGHTTP3_LIBS}') 1171 libbpf: ${have_libbpf} (CFLAGS='${LIBBPF_CFLAGS}' LIBS='${LIBBPF_LIBS}') 1172 Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}') 1173 Jansson: ${have_jansson} (CFLAGS='${JANSSON_CFLAGS}' LIBS='${JANSSON_LIBS}') 1174 Jemalloc: ${have_jemalloc} (CFLAGS='${JEMALLOC_CFLAGS}' LIBS='${JEMALLOC_LIBS}') 1175 Zlib: ${have_zlib} (CFLAGS='${ZLIB_CFLAGS}' LIBS='${ZLIB_LIBS}') 1176 Systemd: ${have_libsystemd} (CFLAGS='${SYSTEMD_CFLAGS}' LIBS='${SYSTEMD_LIBS}') 1177 Third-party: 1178 http-parser: ${enable_third_party} 1179 MRuby: ${have_mruby} (CFLAGS='${LIBMRUBY_CFLAGS}' LIBS='${LIBMRUBY_LIBS}') 1180 Neverbleed: ${have_neverbleed} 1181 Features: 1182 Applications: ${enable_app} 1183 HPACK tools: ${enable_hpack_tools} 1184 Examples: ${enable_examples} 1185 Threading: ${enable_threads} 1186 HTTP/3 (EXPERIMENTAL): ${enable_http3} 1187]) 1188