2014-03-30 12:09:21 +02:00
|
|
|
dnl nghttp2 - HTTP/2 C Library
|
2012-01-17 16:53:12 +01:00
|
|
|
|
2015-01-25 13:48:36 +01:00
|
|
|
dnl Copyright (c) 2012, 2013, 2014, 2015 Tatsuhiro Tsujikawa
|
2012-01-17 16:53:12 +01:00
|
|
|
|
|
|
|
dnl Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
dnl a copy of this software and associated documentation files (the
|
|
|
|
dnl "Software"), to deal in the Software without restriction, including
|
|
|
|
dnl without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
dnl distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
dnl permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
dnl the following conditions:
|
|
|
|
|
|
|
|
dnl The above copyright notice and this permission notice shall be
|
|
|
|
dnl included in all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2014-12-01 15:06:11 +01:00
|
|
|
|
|
|
|
dnl Do not change user variables!
|
2021-09-21 13:40:57 +02:00
|
|
|
dnl https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
|
2014-12-01 15:06:11 +01:00
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_PREREQ(2.61)
|
2022-06-24 11:27:00 +02:00
|
|
|
AC_INIT([nghttp2], [1.49.0-DEV], [t-tujikawa@users.sourceforge.net])
|
2015-07-30 13:08:43 +02:00
|
|
|
AC_CONFIG_AUX_DIR([.])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
2015-05-13 15:30:35 +02:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
|
2012-03-21 16:51:36 +01:00
|
|
|
LT_PREREQ([2.2.6])
|
|
|
|
LT_INIT()
|
2013-09-03 19:41:22 +02:00
|
|
|
|
2012-03-23 15:49:07 +01:00
|
|
|
AC_CANONICAL_BUILD
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
2013-09-03 16:47:21 +02:00
|
|
|
AM_INIT_AUTOMAKE([subdir-objects])
|
2014-05-05 11:48:26 +02:00
|
|
|
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
2015-05-13 15:30:35 +02:00
|
|
|
dnl See versioning rule:
|
2021-09-20 09:54:47 +02:00
|
|
|
dnl https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
2022-06-23 13:57:52 +02:00
|
|
|
AC_SUBST(LT_CURRENT, 36)
|
|
|
|
AC_SUBST(LT_REVISION, 0)
|
|
|
|
AC_SUBST(LT_AGE, 22)
|
2015-05-13 15:30:35 +02:00
|
|
|
|
|
|
|
major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"`
|
|
|
|
minor=`echo $PACKAGE_VERSION |cut -d. -f2 | sed -e "s/[^0-9]//g"`
|
|
|
|
patch=`echo $PACKAGE_VERSION |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
|
|
|
|
|
|
|
|
PACKAGE_VERSION_NUM=`printf "0x%02x%02x%02x" "$major" "$minor" "$patch"`
|
|
|
|
|
|
|
|
AC_SUBST(PACKAGE_VERSION_NUM)
|
|
|
|
|
2012-06-11 16:08:18 +02:00
|
|
|
dnl Checks for command-line options
|
2014-02-20 15:17:04 +01:00
|
|
|
AC_ARG_ENABLE([werror],
|
|
|
|
[AS_HELP_STRING([--enable-werror],
|
2012-06-11 16:08:18 +02:00
|
|
|
[Turn on compile time warnings])],
|
2014-02-20 15:17:04 +01:00
|
|
|
[werror=$enableval], [werror=no])
|
2012-06-11 16:08:18 +02:00
|
|
|
|
2014-02-20 15:19:55 +01:00
|
|
|
AC_ARG_ENABLE([debug],
|
|
|
|
[AS_HELP_STRING([--enable-debug],
|
|
|
|
[Turn on debug output])],
|
|
|
|
[debug=$enableval], [debug=no])
|
|
|
|
|
2014-04-23 17:47:26 +02:00
|
|
|
AC_ARG_ENABLE([threads],
|
|
|
|
[AS_HELP_STRING([--disable-threads],
|
|
|
|
[Turn off threading in apps])],
|
|
|
|
[threads=$enableval], [threads=yes])
|
|
|
|
|
2014-01-10 15:19:36 +01:00
|
|
|
AC_ARG_ENABLE([app],
|
|
|
|
[AS_HELP_STRING([--enable-app],
|
2016-02-09 07:57:11 +01:00
|
|
|
[Build applications (nghttp, nghttpd, nghttpx and h2load) [default=check]])],
|
2014-01-10 15:19:36 +01:00
|
|
|
[request_app=$enableval], [request_app=check])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([hpack-tools],
|
|
|
|
[AS_HELP_STRING([--enable-hpack-tools],
|
|
|
|
[Build HPACK tools [default=check]])],
|
|
|
|
[request_hpack_tools=$enableval], [request_hpack_tools=check])
|
2012-09-10 14:51:08 +02:00
|
|
|
|
2014-09-21 11:28:06 +02:00
|
|
|
AC_ARG_ENABLE([asio-lib],
|
|
|
|
[AS_HELP_STRING([--enable-asio-lib],
|
|
|
|
[Build C++ libnghttp2_asio library [default=no]])],
|
|
|
|
[request_asio_lib=$enableval], [request_asio_lib=no])
|
|
|
|
|
2012-08-23 19:15:57 +02:00
|
|
|
AC_ARG_ENABLE([examples],
|
|
|
|
[AS_HELP_STRING([--enable-examples],
|
2014-01-10 15:19:36 +01:00
|
|
|
[Build examples [default=check]])],
|
|
|
|
[request_examples=$enableval], [request_examples=check])
|
2012-08-23 19:15:57 +02:00
|
|
|
|
2014-01-10 17:01:28 +01:00
|
|
|
AC_ARG_ENABLE([python-bindings],
|
|
|
|
[AS_HELP_STRING([--enable-python-bindings],
|
|
|
|
[Build Python bindings [default=check]])],
|
|
|
|
[request_python_bindings=$enableval], [request_python_bindings=check])
|
|
|
|
|
2013-10-30 18:02:00 +01:00
|
|
|
AC_ARG_ENABLE([failmalloc],
|
2014-12-20 15:56:09 +01:00
|
|
|
[AS_HELP_STRING([--disable-failmalloc],
|
|
|
|
[Do not build failmalloc test program])],
|
|
|
|
[request_failmalloc=$enableval], [request_failmalloc=yes])
|
2013-10-30 18:02:00 +01:00
|
|
|
|
2015-12-16 13:31:43 +01:00
|
|
|
AC_ARG_ENABLE([lib-only],
|
|
|
|
[AS_HELP_STRING([--enable-lib-only],
|
|
|
|
[Build libnghttp2 only. This is a short hand for --disable-app --disable-examples --disable-hpack-tools --disable-python-bindings])],
|
|
|
|
[request_lib_only=$enableval], [request_lib_only=no])
|
|
|
|
|
2021-08-21 12:00:43 +02:00
|
|
|
AC_ARG_ENABLE([http3],
|
|
|
|
[AS_HELP_STRING([--enable-http3],
|
|
|
|
[(EXPERIMENTAL) Enable HTTP/3. This requires ngtcp2, nghttp3, and a custom OpenSSL.])],
|
|
|
|
[request_http3=$enableval], [request_http3=no])
|
|
|
|
|
2013-03-07 12:52:29 +01:00
|
|
|
AC_ARG_WITH([libxml2],
|
2014-01-10 15:19:36 +01:00
|
|
|
[AS_HELP_STRING([--with-libxml2],
|
|
|
|
[Use libxml2 [default=check]])],
|
|
|
|
[request_libxml2=$withval], [request_libxml2=check])
|
2013-03-07 12:52:29 +01:00
|
|
|
|
2021-02-21 13:38:59 +01:00
|
|
|
AC_ARG_WITH([jansson],
|
|
|
|
[AS_HELP_STRING([--with-jansson],
|
|
|
|
[Use jansson [default=check]])],
|
|
|
|
[request_jansson=$withval], [request_jansson=check])
|
|
|
|
|
|
|
|
AC_ARG_WITH([zlib],
|
|
|
|
[AS_HELP_STRING([--with-zlib],
|
|
|
|
[Use zlib [default=check]])],
|
|
|
|
[request_zlib=$withval], [request_zlib=check])
|
|
|
|
|
|
|
|
AC_ARG_WITH([libevent-openssl],
|
|
|
|
[AS_HELP_STRING([--with-libevent-openssl],
|
|
|
|
[Use libevent_openssl [default=check]])],
|
|
|
|
[request_libevent_openssl=$withval], [request_libevent_openssl=check])
|
|
|
|
|
|
|
|
AC_ARG_WITH([libcares],
|
|
|
|
[AS_HELP_STRING([--with-libcares],
|
|
|
|
[Use libc-ares [default=check]])],
|
|
|
|
[request_libcares=$withval], [request_libcares=check])
|
|
|
|
|
|
|
|
AC_ARG_WITH([openssl],
|
|
|
|
[AS_HELP_STRING([--with-openssl],
|
|
|
|
[Use openssl [default=check]])],
|
|
|
|
[request_openssl=$withval], [request_openssl=check])
|
|
|
|
|
|
|
|
AC_ARG_WITH([libev],
|
|
|
|
[AS_HELP_STRING([--with-libev],
|
|
|
|
[Use libev [default=check]])],
|
|
|
|
[request_libev=$withval], [request_libev=check])
|
|
|
|
|
|
|
|
AC_ARG_WITH([cunit],
|
|
|
|
[AS_HELP_STRING([--with-cunit],
|
|
|
|
[Use cunit [default=check]])],
|
|
|
|
[request_cunit=$withval], [request_cunit=check])
|
|
|
|
|
2014-03-05 13:38:33 +01:00
|
|
|
AC_ARG_WITH([jemalloc],
|
|
|
|
[AS_HELP_STRING([--with-jemalloc],
|
|
|
|
[Use jemalloc [default=check]])],
|
|
|
|
[request_jemalloc=$withval], [request_jemalloc=check])
|
|
|
|
|
2017-02-10 09:13:16 +01:00
|
|
|
AC_ARG_WITH([systemd],
|
|
|
|
[AS_HELP_STRING([--with-systemd],
|
|
|
|
[Enable systemd support in nghttpx [default=check]])],
|
|
|
|
[request_systemd=$withval], [request_systemd=check])
|
|
|
|
|
2015-09-03 17:54:41 +02:00
|
|
|
AC_ARG_WITH([mruby],
|
|
|
|
[AS_HELP_STRING([--with-mruby],
|
2015-09-05 10:49:10 +02:00
|
|
|
[Use mruby [default=no]])],
|
|
|
|
[request_mruby=$withval], [request_mruby=no])
|
2015-09-03 17:54:41 +02:00
|
|
|
|
2015-09-23 12:45:53 +02:00
|
|
|
AC_ARG_WITH([neverbleed],
|
|
|
|
[AS_HELP_STRING([--with-neverbleed],
|
|
|
|
[Use neverbleed [default=no]])],
|
|
|
|
[request_neverbleed=$withval], [request_neverbleed=no])
|
|
|
|
|
2014-01-10 17:01:28 +01:00
|
|
|
AC_ARG_WITH([cython],
|
|
|
|
[AS_HELP_STRING([--with-cython=PATH],
|
|
|
|
[Use cython in given PATH])],
|
|
|
|
[cython_path=$withval], [])
|
|
|
|
|
2021-08-21 12:00:43 +02:00
|
|
|
AC_ARG_WITH([libngtcp2],
|
|
|
|
[AS_HELP_STRING([--with-libngtcp2],
|
|
|
|
[Use libngtcp2 [default=check]])],
|
|
|
|
[request_libngtcp2=$withval], [request_libngtcp2=check])
|
|
|
|
|
|
|
|
AC_ARG_WITH([libnghttp3],
|
|
|
|
[AS_HELP_STRING([--with-libnghttp3],
|
|
|
|
[Use libnghttp3 [default=check]])],
|
|
|
|
[request_libnghttp3=$withval], [request_libnghttp3=check])
|
|
|
|
|
2021-08-24 14:13:05 +02:00
|
|
|
AC_ARG_WITH([libbpf],
|
|
|
|
[AS_HELP_STRING([--with-libbpf],
|
2021-08-29 12:09:36 +02:00
|
|
|
[Use libbpf [default=no]])],
|
2021-08-24 14:13:05 +02:00
|
|
|
[request_libbpf=$withval], [request_libbpf=no])
|
|
|
|
|
2013-12-16 13:46:50 +01:00
|
|
|
dnl Define variables
|
|
|
|
AC_ARG_VAR([CYTHON], [the Cython executable])
|
|
|
|
|
2021-03-06 14:32:17 +01:00
|
|
|
AC_ARG_VAR([LIBEV_CFLAGS], [C compiler flags for libev, skipping any checks])
|
|
|
|
AC_ARG_VAR([LIBEV_LIBS], [linker flags for libev, skipping any checks])
|
|
|
|
|
|
|
|
AC_ARG_VAR([JEMALLOC_CFLAGS],
|
|
|
|
[C compiler flags for jemalloc, skipping any checks])
|
|
|
|
AC_ARG_VAR([JEMALLOC_LIBS], [linker flags for jemalloc, skipping any checks])
|
|
|
|
|
2021-02-21 13:32:48 +01:00
|
|
|
AC_ARG_VAR([LIBTOOL_LDFLAGS],
|
|
|
|
[libtool specific flags (e.g., -static-libtool-libs)])
|
|
|
|
|
2021-08-24 14:13:05 +02:00
|
|
|
AC_ARG_VAR([BPFCFLAGS], [C compiler flags for bpf program])
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
dnl Checks for programs
|
|
|
|
AC_PROG_CC
|
2012-01-31 20:10:09 +01:00
|
|
|
AC_PROG_CXX
|
2015-05-13 15:30:35 +02:00
|
|
|
AC_PROG_CPP
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2015-05-13 15:30:35 +02:00
|
|
|
AC_PROG_MKDIR_P
|
|
|
|
|
2012-01-24 14:02:24 +01:00
|
|
|
PKG_PROG_PKG_CONFIG([0.20])
|
2014-01-12 13:31:33 +01:00
|
|
|
|
2020-12-29 10:23:54 +01:00
|
|
|
AM_PATH_PYTHON([3.8],, [:])
|
2015-06-07 06:14:31 +02:00
|
|
|
|
2021-10-10 09:52:05 +02:00
|
|
|
if test "x$request_python_bindings" = "xyes" &&
|
|
|
|
test "x$PYTHON" = "x:"; then
|
|
|
|
AC_MSG_ERROR([python was requested (enable-python-bindings) but not found])
|
|
|
|
fi
|
|
|
|
|
2015-12-16 13:31:43 +01:00
|
|
|
if [test "x$request_lib_only" = "xyes"]; then
|
|
|
|
request_app=no
|
|
|
|
request_hpack_tools=no
|
|
|
|
request_examples=no
|
|
|
|
request_python_bindings=no
|
2022-03-12 11:24:04 +01:00
|
|
|
request_http3=no
|
|
|
|
request_libxml2=no
|
|
|
|
request_jansson=no
|
|
|
|
request_zlib=no
|
|
|
|
request_libevent_openssl=no
|
|
|
|
request_libcares=no
|
|
|
|
request_openssl=no
|
|
|
|
request_libev=no
|
|
|
|
request_jemalloc=no
|
|
|
|
request_systemd=no
|
|
|
|
request_mruby=no
|
|
|
|
request_neverbleed=no
|
|
|
|
request_libngtcp2=no
|
|
|
|
request_libnghttp3=no
|
|
|
|
request_libbpf=no
|
2015-12-16 13:31:43 +01:00
|
|
|
fi
|
|
|
|
|
2021-10-10 09:52:05 +02:00
|
|
|
if test "x$request_python_bindings" != "xno" &&
|
|
|
|
test "x$PYTHON" != "x:"; then
|
|
|
|
# version check is broken
|
|
|
|
AX_PYTHON_DEVEL()
|
2014-01-12 13:31:33 +01:00
|
|
|
fi
|
2014-01-10 17:01:28 +01:00
|
|
|
|
|
|
|
if test "x${cython_path}" = "x"; then
|
|
|
|
AC_CHECK_PROGS([CYTHON], [cython.py cython])
|
|
|
|
else
|
|
|
|
CYTHON=${cython_path}
|
|
|
|
AC_SUBST([CYTHON])
|
|
|
|
fi
|
2012-01-17 16:53:12 +01:00
|
|
|
|
2014-10-19 14:45:56 +02:00
|
|
|
if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
|
2015-09-23 07:41:53 +02:00
|
|
|
AC_DEFINE([NGHTTP2_NORETURN], [__attribute__((noreturn))], [Hint to the compiler that a function never return])
|
2014-10-19 14:45:56 +02:00
|
|
|
else
|
2016-02-11 15:05:16 +01:00
|
|
|
AC_DEFINE([NGHTTP2_NORETURN], , [Hint to the compiler that a function never return])
|
2014-10-19 14:45:56 +02:00
|
|
|
fi
|
|
|
|
|
2016-02-02 16:48:47 +01:00
|
|
|
save_CXXFLAGS="$CXXFLAGS"
|
2016-01-30 10:42:48 +01:00
|
|
|
CXXFLAGS=
|
|
|
|
|
2018-10-15 15:35:05 +02:00
|
|
|
AX_CXX_COMPILE_STDCXX([14], [noext], [optional])
|
2013-08-06 14:20:36 +02:00
|
|
|
|
2016-01-30 10:42:48 +01:00
|
|
|
CXX1XCXXFLAGS="$CXXFLAGS"
|
2016-02-02 16:48:47 +01:00
|
|
|
CXXFLAGS="$save_CXXFLAGS"
|
2016-01-30 10:42:48 +01:00
|
|
|
AC_SUBST([CXX1XCXXFLAGS])
|
|
|
|
|
2014-06-18 07:24:45 +02:00
|
|
|
AC_LANG_PUSH(C++)
|
|
|
|
|
2016-02-02 16:48:47 +01:00
|
|
|
save_CXXFLAGS="$CXXFLAGS"
|
2016-01-30 10:42:48 +01:00
|
|
|
CXXFLAGS="$CXXFLAGS $CXX1XCXXFLAGS"
|
|
|
|
|
2014-10-08 16:36:55 +02:00
|
|
|
# Check that std::future is available.
|
|
|
|
AC_MSG_CHECKING([whether std::future is available])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
|
|
[[
|
|
|
|
#include <vector>
|
|
|
|
#include <future>
|
|
|
|
]],
|
|
|
|
[[
|
|
|
|
std::vector<std::future<int>> v;
|
2021-08-31 09:49:14 +02:00
|
|
|
(void)v;
|
2014-10-08 16:36:55 +02:00
|
|
|
]])],
|
|
|
|
[AC_DEFINE([HAVE_STD_FUTURE], [1],
|
|
|
|
[Define to 1 if you have the `std::future`.])
|
|
|
|
have_std_future=yes
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[have_std_future=no
|
|
|
|
AC_MSG_RESULT([no])])
|
|
|
|
|
2015-01-17 07:32:49 +01:00
|
|
|
# Check that std::map::emplace is available for g++-4.7.
|
|
|
|
AC_MSG_CHECKING([whether std::map::emplace is available])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
|
|
[[
|
|
|
|
#include <map>
|
|
|
|
]],
|
|
|
|
[[
|
|
|
|
std::map<int, int>().emplace(1, 2);
|
|
|
|
]])],
|
|
|
|
[AC_DEFINE([HAVE_STD_MAP_EMPLACE], [1],
|
|
|
|
[Define to 1 if you have the `std::map::emplace`.])
|
|
|
|
have_std_map_emplace=yes
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[have_std_map_emplace=no
|
|
|
|
AC_MSG_RESULT([no])])
|
|
|
|
|
2016-09-20 15:24:12 +02:00
|
|
|
# Check that std::atomic_* overloads for std::shared_ptr are
|
|
|
|
# available.
|
|
|
|
AC_MSG_CHECKING([whether std::atomic_* overloads for std::shared_ptr are available])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
|
|
[[
|
|
|
|
#include <memory>
|
|
|
|
]],
|
|
|
|
[[
|
|
|
|
auto a = std::make_shared<int>(1000000007);
|
|
|
|
auto p = std::atomic_load(&a);
|
|
|
|
++*p;
|
|
|
|
std::atomic_store(&a, p);
|
|
|
|
]])],
|
|
|
|
[AC_DEFINE([HAVE_ATOMIC_STD_SHARED_PTR], [1],
|
|
|
|
[Define to 1 if you have the std::atomic_* overloads for std::shared_ptr.])
|
|
|
|
have_atomic_std_shared_ptr=yes
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[have_atomic_std_shared_ptr=no
|
|
|
|
AC_MSG_RESULT([no])])
|
|
|
|
|
2016-10-23 12:10:56 +02:00
|
|
|
# Check that thread_local storage specifier is available
|
|
|
|
AC_MSG_CHECKING([whether thread_local storage class specifier is available.])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
|
|
,
|
|
|
|
[[
|
|
|
|
thread_local int a = 0;
|
|
|
|
(void)a;
|
|
|
|
]])],
|
|
|
|
[AC_DEFINE([HAVE_THREAD_LOCAL], [1],
|
|
|
|
[Define to 1 if you have thread_local storage specifier.])
|
|
|
|
have_thread_local=yes
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[have_Thread_local=no
|
|
|
|
AC_MSG_RESULT([no])])
|
|
|
|
|
2016-02-02 16:48:47 +01:00
|
|
|
CXXFLAGS=$save_CXXFLAGS
|
2016-01-30 10:42:48 +01:00
|
|
|
|
2013-09-17 15:48:30 +02:00
|
|
|
AC_LANG_POP()
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
# Checks for libraries.
|
2012-02-08 15:11:06 +01:00
|
|
|
|
2013-01-27 08:46:58 +01:00
|
|
|
# Additional libraries required for tests.
|
2015-01-24 16:58:30 +01:00
|
|
|
TESTLDADD=
|
2013-01-27 08:46:58 +01:00
|
|
|
|
2013-01-27 09:16:13 +01:00
|
|
|
# Additional libraries required for programs under src directory.
|
2014-12-01 15:14:28 +01:00
|
|
|
APPLDFLAGS=
|
2013-01-27 09:16:13 +01:00
|
|
|
|
2016-08-30 14:25:47 +02:00
|
|
|
case "$host_os" in
|
2013-03-07 13:17:55 +01:00
|
|
|
*android*)
|
2013-03-07 13:24:40 +01:00
|
|
|
android_build=yes
|
2022-01-13 21:21:56 +01:00
|
|
|
# android does not need -pthread, but needs following 3 libs for C++
|
2015-01-11 10:48:31 +01:00
|
|
|
APPLDFLAGS="$APPLDFLAGS -lstdc++ -latomic -lsupc++"
|
2013-03-07 13:17:55 +01:00
|
|
|
;;
|
|
|
|
*)
|
2014-08-05 14:49:50 +02:00
|
|
|
PTHREAD_LDFLAGS="-pthread"
|
2014-12-01 15:14:28 +01:00
|
|
|
APPLDFLAGS="$APPLDFLAGS $PTHREAD_LDFLAGS"
|
2013-03-07 13:17:55 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-08-30 14:25:47 +02:00
|
|
|
case "$host_os" in
|
|
|
|
*solaris*)
|
|
|
|
APPLDFLAGS="$APPLDFLAGS -lsocket -lnsl"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2021-08-21 12:00:43 +02:00
|
|
|
case "${build}" in
|
|
|
|
*-apple-darwin*)
|
|
|
|
EXTRA_DEFS="-D__APPLE_USE_RFC_3542"
|
|
|
|
AC_SUBST([EXTRA_DEFS])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2012-02-08 15:11:06 +01:00
|
|
|
# zlib
|
2021-02-21 13:38:59 +01:00
|
|
|
have_zlib=no
|
|
|
|
if test "x${request_zlib}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no])
|
2014-05-06 16:10:50 +02:00
|
|
|
|
2021-02-21 13:38:59 +01:00
|
|
|
if test "x${have_zlib}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($ZLIB_PKG_ERRORS)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_zlib}" = "xyes" &&
|
|
|
|
test "x${have_zlib}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([zlib was requested (--with-zlib) but not found])
|
2013-03-07 13:24:40 +01:00
|
|
|
fi
|
2012-01-24 14:02:24 +01:00
|
|
|
|
2015-12-30 16:13:16 +01:00
|
|
|
# dl: openssl requires libdl when it is statically linked.
|
2016-02-06 14:36:27 +01:00
|
|
|
case "${host_os}" in
|
|
|
|
*bsd*)
|
|
|
|
# dlopen is in libc on *BSD
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
save_LIBS=$LIBS
|
|
|
|
AC_SEARCH_LIBS([dlopen], [dl], [APPLDFLAGS="-ldl $APPLDFLAGS"], [], [])
|
|
|
|
LIBS=$save_LIBS
|
|
|
|
;;
|
|
|
|
esac
|
2015-12-30 16:13:16 +01:00
|
|
|
|
2012-02-08 15:11:06 +01:00
|
|
|
# cunit
|
2021-02-21 13:38:59 +01:00
|
|
|
have_cunit=no
|
|
|
|
if test "x${request_cunit}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no])
|
|
|
|
# If pkg-config does not find cunit, check it using AC_CHECK_LIB. We
|
|
|
|
# do this because Debian (Ubuntu) lacks pkg-config file for cunit.
|
|
|
|
if test "x${have_cunit}" = "xno"; then
|
|
|
|
AC_MSG_WARN([${CUNIT_PKG_ERRORS}])
|
|
|
|
AC_CHECK_LIB([cunit], [CU_initialize_registry],
|
|
|
|
[have_cunit=yes], [have_cunit=no])
|
|
|
|
if test "x${have_cunit}" = "xyes"; then
|
|
|
|
CUNIT_LIBS="-lcunit"
|
|
|
|
CUNIT_CFLAGS=""
|
|
|
|
AC_SUBST([CUNIT_LIBS])
|
|
|
|
AC_SUBST([CUNIT_CFLAGS])
|
|
|
|
fi
|
|
|
|
fi
|
2012-02-08 15:11:06 +01:00
|
|
|
if test "x${have_cunit}" = "xyes"; then
|
2021-02-21 13:38:59 +01:00
|
|
|
# cunit in Mac OS X requires ncurses. Note that in Mac OS X, test
|
|
|
|
# program can be built without -lncurses, but it emits runtime
|
|
|
|
# error.
|
|
|
|
case "${build}" in
|
|
|
|
*-apple-darwin*)
|
|
|
|
CUNIT_LIBS="$CUNIT_LIBS -lncurses"
|
|
|
|
AC_SUBST([CUNIT_LIBS])
|
|
|
|
;;
|
|
|
|
esac
|
2012-02-08 15:11:06 +01:00
|
|
|
fi
|
|
|
|
fi
|
2021-02-21 13:38:59 +01:00
|
|
|
|
|
|
|
if test "x${request_cunit}" = "xyes" &&
|
|
|
|
test "x${have_cunit}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([cunit was requested (--with-cunit) but not found])
|
2012-02-09 14:11:30 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
|
|
|
|
|
2014-12-23 16:05:45 +01:00
|
|
|
# libev (for src)
|
2021-02-21 13:38:59 +01:00
|
|
|
have_libev=no
|
|
|
|
if test "x${request_libev}" != "xno"; then
|
|
|
|
if test "x${LIBEV_LIBS}" = "x" && test "x${LIBEV_CFLAGS}" = "x"; then
|
|
|
|
# libev does not have pkg-config file. Check it in an old way.
|
|
|
|
save_LIBS=$LIBS
|
|
|
|
# android requires -lm for floor
|
|
|
|
AC_CHECK_LIB([ev], [ev_time], [have_libev=yes], [have_libev=no], [-lm])
|
|
|
|
if test "x${have_libev}" = "xyes"; then
|
|
|
|
AC_CHECK_HEADER([ev.h], [have_libev=yes], [have_libev=no])
|
|
|
|
if test "x${have_libev}" = "xyes"; then
|
|
|
|
LIBEV_LIBS=-lev
|
|
|
|
LIBEV_CFLAGS=
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
LIBS=$save_LIBS
|
|
|
|
else
|
|
|
|
have_libev=yes
|
2014-12-23 16:05:45 +01:00
|
|
|
fi
|
|
|
|
fi
|
2021-02-21 13:38:59 +01:00
|
|
|
|
|
|
|
if test "x${request_libev}" = "xyes" &&
|
|
|
|
test "x${have_libev}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libev was requested (--with-libev) but not found])
|
|
|
|
fi
|
2014-12-23 16:05:45 +01:00
|
|
|
|
2013-07-28 12:50:02 +02:00
|
|
|
# openssl (for src)
|
2021-02-21 13:38:59 +01:00
|
|
|
have_openssl=no
|
|
|
|
if test "x${request_openssl}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.1],
|
|
|
|
[have_openssl=yes], [have_openssl=no])
|
|
|
|
if test "x${have_openssl}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($OPENSSL_PKG_ERRORS)
|
2021-08-22 16:59:09 +02:00
|
|
|
else
|
|
|
|
save_CFLAGS="$CFLAGS"
|
|
|
|
save_LIBS="$LIBS"
|
|
|
|
CFLAGS="$OPENSSL_CFLAGS $CFLAGS"
|
|
|
|
LIBS="$OPENSSL_LIBS $LIBS"
|
|
|
|
|
2021-10-15 12:52:01 +02:00
|
|
|
# quictls/openssl has SSL_is_quic.
|
2021-08-22 16:59:09 +02:00
|
|
|
have_ssl_is_quic=no
|
|
|
|
AC_MSG_CHECKING([for SSL_is_quic])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
#include <openssl/ssl.h>
|
|
|
|
]], [[
|
|
|
|
SSL *ssl = NULL;
|
|
|
|
SSL_is_quic(ssl);
|
|
|
|
]])],
|
|
|
|
[AC_MSG_RESULT([yes]); have_ssl_is_quic=yes],
|
|
|
|
[AC_MSG_RESULT([no]); have_ssl_is_quic=no])
|
|
|
|
|
2021-10-15 12:52:01 +02:00
|
|
|
# boringssl has SSL_set_quic_early_data_context.
|
|
|
|
AC_MSG_CHECKING([for SSL_set_quic_early_data_context])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
#include <openssl/ssl.h>
|
|
|
|
]], [[
|
|
|
|
SSL *ssl = NULL;
|
|
|
|
SSL_set_quic_early_data_context(ssl, NULL, 0);
|
|
|
|
]])],
|
|
|
|
[AC_MSG_RESULT([yes]); have_boringssl_quic=yes],
|
|
|
|
[AC_MSG_RESULT([no]); have_boringssl_quic=no])
|
|
|
|
|
2021-08-22 16:59:09 +02:00
|
|
|
CFLAGS="$save_CFLAGS"
|
|
|
|
LIBS="$save_LIBS"
|
2021-02-21 13:38:59 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_openssl}" = "xyes" &&
|
|
|
|
test "x${have_openssl}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([openssl was requested (--with-openssl) but not found])
|
2012-03-28 19:13:33 +02:00
|
|
|
fi
|
|
|
|
|
2016-12-04 15:43:41 +01:00
|
|
|
# c-ares (for src)
|
2021-02-21 13:38:59 +01:00
|
|
|
have_libcares=no
|
|
|
|
if test "x${request_libcares}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([LIBCARES], [libcares >= 1.7.5], [have_libcares=yes],
|
|
|
|
[have_libcares=no])
|
|
|
|
if test "x${have_libcares}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($LIBCARES_PKG_ERRORS)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_libcares}" = "xyes" &&
|
|
|
|
test "x${have_libcares}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libcares was requested (--with-libcares) but not found])
|
2016-12-04 15:43:41 +01:00
|
|
|
fi
|
|
|
|
|
2019-06-08 15:05:25 +02:00
|
|
|
# ngtcp2 (for src)
|
2021-08-21 12:00:43 +02:00
|
|
|
have_libngtcp2=no
|
|
|
|
if test "x${request_libngtcp2}" != "xno"; then
|
2022-08-21 11:25:08 +02:00
|
|
|
PKG_CHECK_MODULES([LIBNGTCP2], [libngtcp2 >= 0.8.0], [have_libngtcp2=yes],
|
2021-08-21 12:00:43 +02:00
|
|
|
[have_libngtcp2=no])
|
|
|
|
if test "x${have_libngtcp2}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($LIBNGTCP2_PKG_ERRORS)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_libngtcp2}" = "xyes" &&
|
|
|
|
test "x${have_libngtcp2}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libngtcp2 was requested (--with-libngtcp2) but not found])
|
2019-06-08 15:05:25 +02:00
|
|
|
fi
|
|
|
|
|
2019-08-25 03:20:10 +02:00
|
|
|
# ngtcp2_crypto_openssl (for src)
|
2021-08-21 12:00:43 +02:00
|
|
|
have_libngtcp2_crypto_openssl=no
|
2021-10-15 12:52:01 +02:00
|
|
|
if test "x${have_ssl_is_quic}" = "xyes" &&
|
|
|
|
test "x${request_libngtcp2}" != "xno"; then
|
2021-08-21 12:00:43 +02:00
|
|
|
PKG_CHECK_MODULES([LIBNGTCP2_CRYPTO_OPENSSL],
|
2022-08-21 11:25:08 +02:00
|
|
|
[libngtcp2_crypto_openssl >= 0.8.0],
|
2021-08-21 12:00:43 +02:00
|
|
|
[have_libngtcp2_crypto_openssl=yes],
|
|
|
|
[have_libngtcp2_crypto_openssl=no])
|
|
|
|
if test "x${have_libngtcp2_crypto_openssl}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($LIBNGTCP2_CRYPTO_OPENSSL_PKG_ERRORS)
|
2021-10-15 12:52:01 +02:00
|
|
|
else
|
|
|
|
AC_DEFINE([HAVE_LIBNGTCP2_CRYPTO_OPENSSL], [1],
|
|
|
|
[Define to 1 if you have `libngtcp2_crypto_openssl` library.])
|
2021-08-21 12:00:43 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-10-15 12:52:01 +02:00
|
|
|
if test "x${have_ssl_is_quic}" = "xyes" &&
|
|
|
|
test "x${request_libngtcp2}" = "xyes" &&
|
2021-08-21 12:00:43 +02:00
|
|
|
test "x${have_libngtcp2_crypto_openssl}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libngtcp2_crypto_openssl was requested (--with-libngtcp2) but not found])
|
2019-08-25 03:20:10 +02:00
|
|
|
fi
|
|
|
|
|
2021-10-15 12:52:01 +02:00
|
|
|
# ngtcp2_crypto_boringssl (for src)
|
|
|
|
have_libngtcp2_crypto_boringssl=no
|
|
|
|
if test "x${have_boringssl_quic}" = "xyes" &&
|
|
|
|
test "x${request_libngtcp2}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([LIBNGTCP2_CRYPTO_BORINGSSL],
|
|
|
|
[libngtcp2_crypto_boringssl >= 0.0.0],
|
|
|
|
[have_libngtcp2_crypto_boringssl=yes],
|
|
|
|
[have_libngtcp2_crypto_boringssl=no])
|
|
|
|
if test "x${have_libngtcp2_crypto_boringssl}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($LIBNGTCP2_CRYPTO_BORINGSSL_PKG_ERRORS)
|
|
|
|
else
|
|
|
|
AC_DEFINE([HAVE_LIBNGTCP2_CRYPTO_BORINGSSL], [1],
|
|
|
|
[Define to 1 if you have `libngtcp2_crypto_boringssl` library.])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${have_boringssl_quic}" = "xyes" &&
|
|
|
|
test "x${request_libngtcp2}" = "xyes" &&
|
|
|
|
test "x${have_libngtcp2_crypto_boringssl}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libngtcp2_crypto_boringssl was requested (--with-libngtcp2) but not found])
|
|
|
|
fi
|
|
|
|
|
2019-06-08 15:05:25 +02:00
|
|
|
# nghttp3 (for src)
|
2021-08-21 12:00:43 +02:00
|
|
|
have_libnghttp3=no
|
|
|
|
if test "x${request_libnghttp3}" != "xno"; then
|
2022-08-21 11:25:08 +02:00
|
|
|
PKG_CHECK_MODULES([LIBNGHTTP3], [libnghttp3 >= 0.7.0], [have_libnghttp3=yes],
|
2021-08-21 12:00:43 +02:00
|
|
|
[have_libnghttp3=no])
|
|
|
|
if test "x${have_libnghttp3}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($LIBNGHTTP3_PKG_ERRORS)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_libnghttp3}" = "xyes" &&
|
|
|
|
test "x${have_libnghttp3}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libnghttp3 was requested (--with-libnghttp3) but not found])
|
2019-06-08 15:05:25 +02:00
|
|
|
fi
|
|
|
|
|
2021-08-24 14:13:05 +02:00
|
|
|
# libbpf (for src)
|
|
|
|
have_libbpf=no
|
|
|
|
if test "x${request_libbpf}" != "xno"; then
|
2022-02-21 13:18:52 +01:00
|
|
|
PKG_CHECK_MODULES([LIBBPF], [libbpf >= 0.7.0], [have_libbpf=yes],
|
2021-08-29 06:43:07 +02:00
|
|
|
[have_libbpf=no])
|
|
|
|
if test "x${have_libbpf}" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_LIBBPF], [1], [Define to 1 if you have `libbpf` library.])
|
2021-08-29 08:36:52 +02:00
|
|
|
if test "x${BPFCFLAGS}" = "x"; then
|
2021-08-30 11:33:27 +02:00
|
|
|
BPFCFLAGS="-Wall -O2 -g"
|
2021-08-29 08:36:52 +02:00
|
|
|
fi
|
2021-08-29 06:43:07 +02:00
|
|
|
# Add the include path for Debian
|
|
|
|
EXTRABPFCFLAGS="-I/usr/include/$host_cpu-$host_os"
|
|
|
|
AC_SUBST([EXTRABPFCFLAGS])
|
2021-08-29 07:30:05 +02:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether enum bpf_stats_type is defined in linux/bpf.h])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
|
|
[[
|
|
|
|
#include <linux/bpf.h>
|
|
|
|
]],
|
|
|
|
[[
|
|
|
|
enum bpf_stats_type foo;
|
2021-08-31 09:49:14 +02:00
|
|
|
(void)foo;
|
2021-08-29 07:30:05 +02:00
|
|
|
]])],
|
|
|
|
[have_bpf_stats_type=yes],
|
|
|
|
[have_bpf_stats_type=no])
|
|
|
|
|
|
|
|
if test "x${have_bpf_stats_type}" = "xyes"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE([HAVE_BPF_STATS_TYPE], [1],
|
|
|
|
[Define to 1 if you have enum bpf_stats_type in linux/bpf.h.])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
2021-08-24 14:13:05 +02:00
|
|
|
else
|
2021-08-29 06:43:07 +02:00
|
|
|
AC_MSG_NOTICE($LIBBPF_PKG_ERRORS)
|
2021-08-24 14:13:05 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_libbpf}" = "xyes" &&
|
|
|
|
test "x${have_libbpf}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libbpf was requested (--with-libbpf) but not found])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([HAVE_LIBBPF], [ test "x${have_libbpf}" = "xyes" ])
|
|
|
|
|
2015-01-02 06:55:19 +01:00
|
|
|
# libevent_openssl (for examples)
|
2012-06-06 18:36:49 +02:00
|
|
|
# 2.0.8 is required because we use evconnlistener_set_error_cb()
|
2021-02-21 13:38:59 +01:00
|
|
|
have_libevent_openssl=no
|
|
|
|
if test "x${request_libevent_openssl}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.0.8],
|
|
|
|
[have_libevent_openssl=yes], [have_libevent_openssl=no])
|
|
|
|
if test "x${have_libevent_openssl}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($LIBEVENT_OPENSSL_PKG_ERRORS)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_libevent_openssl}" = "xyes" &&
|
|
|
|
test "x${have_libevent_openssl}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libevent_openssl was requested (--with-libevent) but not found])
|
2012-06-04 16:48:31 +02:00
|
|
|
fi
|
|
|
|
|
2014-11-15 14:06:16 +01:00
|
|
|
# jansson (for src/nghttp, src/deflatehd and src/inflatehd)
|
2021-02-21 13:38:59 +01:00
|
|
|
have_jansson=no
|
|
|
|
if test "x${request_jansson}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([JANSSON], [jansson >= 2.5],
|
|
|
|
[have_jansson=yes], [have_jansson=no])
|
|
|
|
if test "x${have_jansson}" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_JANSSON], [1],
|
|
|
|
[Define to 1 if you have `libjansson` library.])
|
|
|
|
else
|
|
|
|
AC_MSG_NOTICE($JANSSON_PKG_ERRORS)
|
|
|
|
fi
|
2013-10-21 17:42:46 +02:00
|
|
|
fi
|
|
|
|
|
2021-02-21 13:38:59 +01:00
|
|
|
if test "x${request_jansson}" = "xyes" &&
|
|
|
|
test "x${have_jansson}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([jansson was requested (--with-jansson) but not found])
|
|
|
|
fi
|
2017-02-08 19:15:25 +01:00
|
|
|
|
2017-02-10 09:13:16 +01:00
|
|
|
# libsystemd (for src/nghttpx)
|
|
|
|
have_libsystemd=no
|
|
|
|
if test "x${request_systemd}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209], [have_libsystemd=yes],
|
|
|
|
[have_libsystemd=no])
|
|
|
|
if test "x${have_libsystemd}" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_LIBSYSTEMD], [1],
|
|
|
|
[Define to 1 if you have `libsystemd` library.])
|
|
|
|
else
|
|
|
|
AC_MSG_NOTICE($SYSTEMD_PKG_ERRORS)
|
|
|
|
fi
|
2017-02-08 19:15:25 +01:00
|
|
|
fi
|
|
|
|
|
2017-02-10 09:13:16 +01:00
|
|
|
if test "x${request_systemd}" = "xyes" &&
|
|
|
|
test "x${have_libsystemd}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([systemd was requested (--with-systemd) but not found])
|
|
|
|
fi
|
2017-02-08 19:15:25 +01:00
|
|
|
|
2013-07-28 12:50:02 +02:00
|
|
|
# libxml2 (for src/nghttp)
|
2021-02-21 13:38:59 +01:00
|
|
|
have_libxml2=no
|
|
|
|
if test "x${request_libxml2}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.26],
|
|
|
|
[have_libxml2=yes], [have_libxml2=no])
|
|
|
|
if test "x${have_libxml2}" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have `libxml2` library.])
|
|
|
|
else
|
|
|
|
AC_MSG_NOTICE($LIBXML2_PKG_ERRORS)
|
|
|
|
fi
|
2012-05-19 10:05:12 +02:00
|
|
|
fi
|
2014-01-10 15:19:36 +01:00
|
|
|
|
|
|
|
if test "x${request_libxml2}" = "xyes" &&
|
|
|
|
test "x${have_libxml2}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([libxml2 was requested (--with-libxml2) but not found])
|
|
|
|
fi
|
|
|
|
|
2012-05-19 10:05:12 +02:00
|
|
|
AM_CONDITIONAL([HAVE_LIBXML2], [ test "x${have_libxml2}" = "xyes" ])
|
|
|
|
|
2014-03-05 13:38:33 +01:00
|
|
|
# jemalloc
|
|
|
|
have_jemalloc=no
|
|
|
|
if test "x${request_jemalloc}" != "xno"; then
|
2021-02-21 13:38:59 +01:00
|
|
|
if test "x${JEMALLOC_LIBS}" = "x" && test "x${JEMALLOC_CFLAGS}" = "x"; then
|
|
|
|
save_LIBS=$LIBS
|
|
|
|
AC_SEARCH_LIBS([malloc_stats_print], [jemalloc], [have_jemalloc=yes], [],
|
2015-05-15 15:38:51 +02:00
|
|
|
[$PTHREAD_LDFLAGS])
|
|
|
|
|
|
|
|
if test "x${have_jemalloc}" = "xyes"; then
|
2021-02-21 13:38:59 +01:00
|
|
|
jemalloc_libs=${ac_cv_search_malloc_stats_print}
|
|
|
|
else
|
|
|
|
# On Darwin, malloc_stats_print is je_malloc_stats_print
|
|
|
|
AC_SEARCH_LIBS([je_malloc_stats_print], [jemalloc], [have_jemalloc=yes], [],
|
|
|
|
[$PTHREAD_LDFLAGS])
|
|
|
|
|
|
|
|
if test "x${have_jemalloc}" = "xyes"; then
|
|
|
|
jemalloc_libs=${ac_cv_search_je_malloc_stats_print}
|
|
|
|
fi
|
2015-05-15 15:38:51 +02:00
|
|
|
fi
|
|
|
|
|
2021-02-21 13:38:59 +01:00
|
|
|
LIBS=$save_LIBS
|
2016-01-22 14:37:45 +01:00
|
|
|
|
2021-02-21 13:38:59 +01:00
|
|
|
if test "x${have_jemalloc}" = "xyes" &&
|
|
|
|
test "x${jemalloc_libs}" != "xnone required"; then
|
|
|
|
JEMALLOC_LIBS=${jemalloc_libs}
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
have_jemalloc=yes
|
2014-03-05 13:38:33 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_jemalloc}" = "xyes" &&
|
|
|
|
test "x${have_jemalloc}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([jemalloc was requested (--with-jemalloc) but not found])
|
|
|
|
fi
|
|
|
|
|
2014-09-21 11:28:06 +02:00
|
|
|
# Check Boost Asio library
|
|
|
|
have_asio_lib=no
|
|
|
|
|
2014-09-27 16:50:33 +02:00
|
|
|
if test "x${request_asio_lib}" = "xyes"; then
|
|
|
|
AX_BOOST_BASE([1.54.0], [have_boost_base=yes], [have_boost_base=no])
|
|
|
|
|
|
|
|
if test "x${have_boost_base}" = "xyes"; then
|
|
|
|
AX_BOOST_ASIO()
|
|
|
|
AX_BOOST_SYSTEM()
|
|
|
|
AX_BOOST_THREAD()
|
|
|
|
|
|
|
|
if test "x${ax_cv_boost_asio}" = "xyes" &&
|
|
|
|
test "x${ax_cv_boost_system}" = "xyes" &&
|
|
|
|
test "x${ax_cv_boost_thread}" = "xyes"; then
|
|
|
|
have_asio_lib=yes
|
|
|
|
fi
|
2014-09-21 11:28:06 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-12-04 15:43:41 +01:00
|
|
|
# The nghttp, nghttpd and nghttpx under src depend on zlib, OpenSSL,
|
|
|
|
# libev, and libc-ares.
|
2014-01-10 15:19:36 +01:00
|
|
|
enable_app=no
|
|
|
|
if test "x${request_app}" != "xno" &&
|
2014-05-06 16:10:50 +02:00
|
|
|
test "x${have_zlib}" = "xyes" &&
|
2013-07-28 12:50:02 +02:00
|
|
|
test "x${have_openssl}" = "xyes" &&
|
2016-12-04 15:43:41 +01:00
|
|
|
test "x${have_libev}" = "xyes" &&
|
|
|
|
test "x${have_libcares}" = "xyes"; then
|
2014-01-10 15:19:36 +01:00
|
|
|
enable_app=yes
|
2012-09-10 14:51:08 +02:00
|
|
|
fi
|
|
|
|
|
2014-01-10 15:19:36 +01:00
|
|
|
if test "x${request_app}" = "xyes" &&
|
|
|
|
test "x${enable_app}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([applications were requested (--enable-app) but dependencies are not met.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ENABLE_APP], [ test "x${enable_app}" = "xyes" ])
|
|
|
|
|
2021-08-21 12:00:43 +02:00
|
|
|
# Check HTTP/3 support
|
|
|
|
enable_http3=no
|
|
|
|
if test "x${request_http3}" != "xno" &&
|
2021-10-15 12:52:01 +02:00
|
|
|
(test "x${have_ssl_is_quic}" = "xyes" ||
|
|
|
|
test "x${have_boringssl_quic}" = "xyes") &&
|
2021-08-21 12:00:43 +02:00
|
|
|
test "x${have_libngtcp2}" = "xyes" &&
|
2021-10-15 12:52:01 +02:00
|
|
|
(test "x${have_libngtcp2_crypto_openssl}" = "xyes" ||
|
|
|
|
test "x${have_libngtcp2_crypto_boringssl}" = "xyes") &&
|
2021-08-21 12:00:43 +02:00
|
|
|
test "x${have_libnghttp3}" = "xyes"; then
|
|
|
|
enable_http3=yes
|
|
|
|
AC_DEFINE([ENABLE_HTTP3], [1], [Define to 1 if HTTP/3 is enabled.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_http3}" = "xyes" &&
|
|
|
|
test "x${enable_http3}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([HTTP/3 was requested (--enable-http3) but dependencies are not met.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ENABLE_HTTP3], [ test "x${enable_http3}" = "xyes" ])
|
|
|
|
|
2014-01-10 15:19:36 +01:00
|
|
|
enable_hpack_tools=no
|
|
|
|
# HPACK tools requires jansson
|
|
|
|
if test "x${request_hpack_tools}" != "xno" &&
|
|
|
|
test "x${have_jansson}" = "xyes"; then
|
|
|
|
enable_hpack_tools=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_hpack_tools}" = "xyes" &&
|
|
|
|
test "x${enable_hpack_tools}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([HPACK tools were requested (--enable-hpack-tools) but dependencies are not met.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ENABLE_HPACK_TOOLS], [ test "x${enable_hpack_tools}" = "xyes" ])
|
2012-09-10 14:51:08 +02:00
|
|
|
|
2014-09-21 11:28:06 +02:00
|
|
|
# C++ library libnghttp2_asio
|
|
|
|
|
|
|
|
enable_asio_lib=no
|
|
|
|
if test "x${request_asio_lib}" != "xno" &&
|
|
|
|
test "x${have_asio_lib}" = "xyes"; then
|
|
|
|
enable_asio_lib=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ENABLE_ASIO_LIB], [ test "x${enable_asio_lib}" = "xyes" ])
|
|
|
|
|
2014-01-10 15:19:36 +01:00
|
|
|
# The example programs depend on OpenSSL and libevent_openssl
|
2012-08-23 19:15:57 +02:00
|
|
|
enable_examples=no
|
2014-01-10 15:19:36 +01:00
|
|
|
if test "x${request_examples}" != "xno" &&
|
2013-12-22 11:26:32 +01:00
|
|
|
test "x${have_openssl}" = "xyes" &&
|
|
|
|
test "x${have_libevent_openssl}" = "xyes"; then
|
2014-01-10 15:19:36 +01:00
|
|
|
enable_examples=yes
|
2012-08-23 19:15:57 +02:00
|
|
|
fi
|
|
|
|
|
2014-01-10 15:19:36 +01:00
|
|
|
if test "x${request_examples}" = "xyes" &&
|
|
|
|
test "x${enable_examples}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([examples were requested (--enable-examples) but dependencies are not met.])
|
2013-10-21 17:42:46 +02:00
|
|
|
fi
|
|
|
|
|
2014-01-10 15:19:36 +01:00
|
|
|
AM_CONDITIONAL([ENABLE_EXAMPLES], [ test "x${enable_examples}" = "xyes" ])
|
2013-10-21 17:42:46 +02:00
|
|
|
|
2015-06-17 19:29:37 +02:00
|
|
|
# third-party only be built when needed
|
2015-05-28 15:55:47 +02:00
|
|
|
|
|
|
|
enable_third_party=no
|
2015-10-16 15:49:42 +02:00
|
|
|
have_mruby=no
|
|
|
|
have_neverbleed=no
|
2015-06-17 19:29:37 +02:00
|
|
|
if test "x${enable_examples}" = "xyes" ||
|
|
|
|
test "x${enable_app}" = "xyes" ||
|
2015-09-09 14:11:42 +02:00
|
|
|
test "x${enable_hpack_tools}" = "xyes" ||
|
2015-06-17 19:29:37 +02:00
|
|
|
test "x${enable_asio_lib}" = "xyes"; then
|
2015-05-28 15:55:47 +02:00
|
|
|
enable_third_party=yes
|
2015-10-16 15:49:42 +02:00
|
|
|
|
|
|
|
# mruby (for src/nghttpx)
|
|
|
|
if test "x${request_mruby}" = "xyes"; then
|
|
|
|
# We are going to build mruby
|
|
|
|
have_mruby=yes
|
|
|
|
AC_DEFINE([HAVE_MRUBY], [1], [Define to 1 if you have `mruby` library.])
|
|
|
|
LIBMRUBY_LIBS="-lmruby -lm"
|
|
|
|
LIBMRUBY_CFLAGS=
|
|
|
|
AC_SUBST([LIBMRUBY_LIBS])
|
|
|
|
AC_SUBST([LIBMRUBY_CFLAGS])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# neverbleed (for src/nghttpx)
|
|
|
|
if test "x${request_neverbleed}" = "xyes"; then
|
|
|
|
have_neverbleed=yes
|
|
|
|
AC_DEFINE([HAVE_NEVERBLEED], [1], [Define to 1 if you have `neverbleed` library.])
|
|
|
|
fi
|
2015-05-28 15:55:47 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ENABLE_THIRD_PARTY], [ test "x${enable_third_party}" = "xyes" ])
|
2015-10-16 15:49:42 +02:00
|
|
|
AM_CONDITIONAL([HAVE_MRUBY], [test "x${have_mruby}" = "xyes"])
|
|
|
|
AM_CONDITIONAL([HAVE_NEVERBLEED], [test "x${have_neverbleed}" = "xyes"])
|
2015-05-28 15:55:47 +02:00
|
|
|
|
2014-01-10 17:01:28 +01:00
|
|
|
# Python bindings
|
|
|
|
enable_python_bindings=no
|
|
|
|
if test "x${request_python_bindings}" != "xno" &&
|
|
|
|
test "x${CYTHON}" != "x" &&
|
2014-01-12 13:31:33 +01:00
|
|
|
test "x${PYTHON}" != "x:" &&
|
2020-12-29 10:23:35 +01:00
|
|
|
test "x${PYTHON_VERSION}" != "x"; then
|
2014-01-10 17:01:28 +01:00
|
|
|
enable_python_bindings=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x${request_python_bindings}" = "xyes" &&
|
|
|
|
test "x${enable_python_bindings}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([python bindings were requested (--enable-python-bindings) but dependencies are not met.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS],
|
|
|
|
[test "x${enable_python_bindings}" = "xyes"])
|
|
|
|
|
2014-02-26 16:58:21 +01:00
|
|
|
# Produce cython conditional, so that we can distribute generated C
|
|
|
|
# source
|
|
|
|
AM_CONDITIONAL([HAVE_CYTHON], [test "x${CYTHON}" != "x"])
|
|
|
|
|
2013-10-30 18:02:00 +01:00
|
|
|
# failmalloc tests
|
2014-12-20 15:56:09 +01:00
|
|
|
enable_failmalloc=no
|
|
|
|
if test "x${request_failmalloc}" = "xyes"; then
|
|
|
|
enable_failmalloc=yes
|
|
|
|
fi
|
|
|
|
|
2013-10-30 18:02:00 +01:00
|
|
|
AM_CONDITIONAL([ENABLE_FAILMALLOC], [ test "x${enable_failmalloc}" = "xyes" ])
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
# Checks for header files.
|
2014-01-10 17:12:30 +01:00
|
|
|
AC_HEADER_ASSERT
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CHECK_HEADERS([ \
|
|
|
|
arpa/inet.h \
|
2015-05-13 15:30:35 +02:00
|
|
|
fcntl.h \
|
|
|
|
inttypes.h \
|
|
|
|
limits.h \
|
|
|
|
netdb.h \
|
2012-03-23 15:49:07 +01:00
|
|
|
netinet/in.h \
|
2012-07-31 19:06:27 +02:00
|
|
|
pwd.h \
|
2012-01-17 16:53:12 +01:00
|
|
|
stddef.h \
|
|
|
|
stdint.h \
|
|
|
|
stdlib.h \
|
|
|
|
string.h \
|
2015-05-13 15:30:35 +02:00
|
|
|
sys/socket.h \
|
|
|
|
sys/time.h \
|
|
|
|
syslog.h \
|
2012-01-27 15:05:29 +01:00
|
|
|
time.h \
|
2012-01-17 16:53:12 +01:00
|
|
|
unistd.h \
|
|
|
|
])
|
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_SSIZE_T
|
|
|
|
AC_TYPE_UINT8_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT64_T
|
2015-05-13 15:30:35 +02:00
|
|
|
AC_TYPE_INT8_T
|
|
|
|
AC_TYPE_INT16_T
|
|
|
|
AC_TYPE_INT32_T
|
|
|
|
AC_TYPE_INT64_T
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
AC_TYPE_PID_T
|
|
|
|
AC_TYPE_UID_T
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CHECK_TYPES([ptrdiff_t])
|
|
|
|
AC_C_BIGENDIAN
|
2015-05-13 15:30:35 +02:00
|
|
|
AC_C_INLINE
|
2013-01-10 16:17:43 +01:00
|
|
|
AC_SYS_LARGEFILE
|
2012-01-17 16:53:12 +01:00
|
|
|
|
2014-11-24 10:39:35 +01:00
|
|
|
AC_CHECK_MEMBER([struct tm.tm_gmtoff], [have_struct_tm_tm_gmtoff=yes],
|
|
|
|
[have_struct_tm_tm_gmtoff=no], [[#include <time.h>]])
|
|
|
|
|
2016-12-04 15:43:41 +01:00
|
|
|
AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
|
|
|
|
[AC_DEFINE([HAVE_SOCKADDR_IN_SIN_LEN],[1],
|
|
|
|
[Define to 1 if struct sockaddr_in has sin_len member.])],
|
|
|
|
[],
|
|
|
|
[[
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
]])
|
|
|
|
|
|
|
|
AC_CHECK_MEMBER([struct sockaddr_in6.sin6_len],
|
|
|
|
[AC_DEFINE([HAVE_SOCKADDR_IN6_SIN6_LEN],[1],
|
|
|
|
[Define to 1 if struct sockaddr_in6 has sin6_len member.])],
|
|
|
|
[],
|
|
|
|
[[
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
]])
|
|
|
|
|
2014-11-24 10:39:35 +01:00
|
|
|
if test "x$have_struct_tm_tm_gmtoff" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_STRUCT_TM_TM_GMTOFF], [1],
|
|
|
|
[Define to 1 if you have `struct tm.tm_gmtoff` member.])
|
|
|
|
fi
|
|
|
|
|
2015-03-03 14:36:24 +01:00
|
|
|
# Check size of pointer to decide we need 8 bytes alignment
|
|
|
|
# adjustment.
|
|
|
|
AC_CHECK_SIZEOF([int *])
|
|
|
|
|
2015-06-29 17:01:26 +02:00
|
|
|
AC_CHECK_SIZEOF([time_t])
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
# Checks for library functions.
|
2015-07-07 14:13:46 +02:00
|
|
|
|
|
|
|
# Don't check malloc, since it does not play nicely with C++ stdlib
|
|
|
|
# AC_FUNC_MALLOC
|
2015-05-13 15:30:35 +02:00
|
|
|
|
|
|
|
AC_FUNC_CHOWN
|
|
|
|
AC_FUNC_ERROR_AT_LINE
|
|
|
|
AC_FUNC_FORK
|
|
|
|
# Don't check realloc, since LeakSanitizer detects memory leak during check
|
|
|
|
# AC_FUNC_REALLOC
|
|
|
|
AC_FUNC_STRERROR_R
|
|
|
|
AC_FUNC_STRNLEN
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CHECK_FUNCS([ \
|
2014-09-14 14:32:53 +02:00
|
|
|
_Exit \
|
2015-01-05 07:59:51 +01:00
|
|
|
accept4 \
|
2015-05-13 15:30:35 +02:00
|
|
|
dup2 \
|
|
|
|
getcwd \
|
2012-07-31 19:06:27 +02:00
|
|
|
getpwnam \
|
2015-05-13 15:30:35 +02:00
|
|
|
localtime_r \
|
|
|
|
memchr \
|
2012-01-17 16:53:12 +01:00
|
|
|
memmove \
|
|
|
|
memset \
|
2017-12-02 05:35:00 +01:00
|
|
|
mkostemp \
|
2015-05-13 15:30:35 +02:00
|
|
|
socket \
|
|
|
|
sqrt \
|
|
|
|
strchr \
|
|
|
|
strdup \
|
|
|
|
strerror \
|
|
|
|
strndup \
|
|
|
|
strstr \
|
|
|
|
strtol \
|
|
|
|
strtoul \
|
2013-03-07 13:17:55 +01:00
|
|
|
timegm \
|
2012-01-17 16:53:12 +01:00
|
|
|
])
|
|
|
|
|
2014-10-09 14:18:24 +02:00
|
|
|
# timerfd_create was added in linux kernel 2.6.25
|
|
|
|
|
|
|
|
AC_CHECK_FUNC([timerfd_create],
|
|
|
|
[have_timerfd_create=yes], [have_timerfd_create=no])
|
|
|
|
|
2015-12-24 13:15:46 +01:00
|
|
|
# For cygwin: we can link initgroups, so AC_CHECK_FUNCS succeeds, but
|
|
|
|
# cygwin disables initgroups due to feature test macro magic with our
|
2016-02-16 16:26:34 +01:00
|
|
|
# configuration. FreeBSD declares initgroups() in unistd.h.
|
|
|
|
AC_CHECK_DECLS([initgroups], [], [], [[
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
|
|
|
#include <grp.h>
|
|
|
|
]])
|
2014-10-09 14:18:24 +02:00
|
|
|
|
2016-02-02 16:48:47 +01:00
|
|
|
save_CFLAGS=$CFLAGS
|
|
|
|
save_CXXFLAGS=$CXXFLAGS
|
2016-01-22 14:48:45 +01:00
|
|
|
|
2014-12-01 15:06:11 +01:00
|
|
|
CFLAGS=
|
2016-01-22 14:48:45 +01:00
|
|
|
CXXFLAGS=
|
2014-12-01 15:06:11 +01:00
|
|
|
|
2014-02-20 15:17:04 +01:00
|
|
|
if test "x$werror" != "xno"; then
|
2016-01-22 14:48:45 +01:00
|
|
|
# For C compiler
|
2014-05-10 17:46:59 +02:00
|
|
|
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wextra], [CFLAGS="$CFLAGS -Wextra"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Werror], [CFLAGS="$CFLAGS -Werror"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], [CFLAGS="$CFLAGS -Wstrict-prototypes"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wmissing-declarations], [CFLAGS="$CFLAGS -Wmissing-declarations"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wpointer-arith], [CFLAGS="$CFLAGS -Wpointer-arith"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wdeclaration-after-statement], [CFLAGS="$CFLAGS -Wdeclaration-after-statement"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wformat-security], [CFLAGS="$CFLAGS -Wformat-security"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wwrite-strings], [CFLAGS="$CFLAGS -Wwrite-strings"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Winline], [CFLAGS="$CFLAGS -Winline"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wfloat-equal], [CFLAGS="$CFLAGS -Wfloat-equal"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wundef], [CFLAGS="$CFLAGS -Wundef"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wendif-labels], [CFLAGS="$CFLAGS -Wendif-labels"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wempty-body], [CFLAGS="$CFLAGS -Wempty-body"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wclobbered], [CFLAGS="$CFLAGS -Wclobbered"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wvla], [CFLAGS="$CFLAGS -Wvla"])
|
2014-05-11 11:28:29 +02:00
|
|
|
AX_CHECK_COMPILE_FLAG([-Wpragmas], [CFLAGS="$CFLAGS -Wpragmas"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [CFLAGS="$CFLAGS -Wunreachable-code"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Waddress], [CFLAGS="$CFLAGS -Waddress"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wattributes], [CFLAGS="$CFLAGS -Wattributes"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wdiv-by-zero], [CFLAGS="$CFLAGS -Wdiv-by-zero"])
|
2014-05-31 17:11:48 +02:00
|
|
|
AX_CHECK_COMPILE_FLAG([-Wshorten-64-to-32], [CFLAGS="$CFLAGS -Wshorten-64-to-32"])
|
2014-05-11 11:28:29 +02:00
|
|
|
|
2015-09-23 07:41:53 +02:00
|
|
|
AX_CHECK_COMPILE_FLAG([-Wconversion], [CFLAGS="$CFLAGS -Wconversion"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wextended-offsetof], [CFLAGS="$CFLAGS -Wextended-offsetof"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wformat-nonliteral], [CFLAGS="$CFLAGS -Wformat-nonliteral"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wlanguage-extension-token], [CFLAGS="$CFLAGS -Wlanguage-extension-token"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wmissing-field-initializers], [CFLAGS="$CFLAGS -Wmissing-field-initializers"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wmissing-noreturn], [CFLAGS="$CFLAGS -Wmissing-noreturn"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wmissing-variable-declarations], [CFLAGS="$CFLAGS -Wmissing-variable-declarations"])
|
|
|
|
# Not used because we cannot change public structs
|
|
|
|
# AX_CHECK_COMPILE_FLAG([-Wpadded], [CFLAGS="$CFLAGS -Wpadded"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wsign-conversion], [CFLAGS="$CFLAGS -Wsign-conversion"])
|
|
|
|
# Not used because this basically disallows default case
|
|
|
|
# AX_CHECK_COMPILE_FLAG([-Wswitch-enum], [CFLAGS="$CFLAGS -Wswitch-enum"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wunreachable-code-break], [CFLAGS="$CFLAGS -Wunreachable-code-break"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wunused-macros], [CFLAGS="$CFLAGS -Wunused-macros"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [CFLAGS="$CFLAGS -Wunused-parameter"])
|
2015-10-04 14:48:32 +02:00
|
|
|
AX_CHECK_COMPILE_FLAG([-Wredundant-decls], [CFLAGS="$CFLAGS -Wredundant-decls"])
|
2014-05-11 11:28:29 +02:00
|
|
|
# Only work with Clang for the moment
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wheader-guard], [CFLAGS="$CFLAGS -Wheader-guard"])
|
2016-08-30 16:47:07 +02:00
|
|
|
AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CFLAGS="$CFLAGS -Wsometimes-uninitialized"])
|
2016-01-22 14:48:45 +01:00
|
|
|
|
2016-03-13 10:21:07 +01:00
|
|
|
# This is required because we pass format string as "const char*.
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wno-format-nonliteral], [CFLAGS="$CFLAGS -Wno-format-nonliteral"])
|
|
|
|
|
2016-01-22 14:48:45 +01:00
|
|
|
# For C++ compiler
|
|
|
|
AC_LANG_PUSH(C++)
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Werror], [CXXFLAGS="$CXXFLAGS -Werror"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wformat-security], [CXXFLAGS="$CXXFLAGS -Wformat-security"])
|
2016-08-30 16:47:07 +02:00
|
|
|
AX_CHECK_COMPILE_FLAG([-Wsometimes-uninitialized], [CXXFLAGS="$CXXFLAGS -Wsometimes-uninitialized"])
|
2017-10-19 16:03:37 +02:00
|
|
|
# Disable noexcept-type warning of g++-7. This is not harmful as
|
|
|
|
# long as all source files are compiled with the same compiler.
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wno-noexcept-type], [CXXFLAGS="$CXXFLAGS -Wno-noexcept-type"])
|
2016-01-22 14:48:45 +01:00
|
|
|
AC_LANG_POP()
|
2012-06-11 16:08:18 +02:00
|
|
|
fi
|
|
|
|
|
2014-12-01 15:06:11 +01:00
|
|
|
WARNCFLAGS=$CFLAGS
|
2016-01-22 14:48:45 +01:00
|
|
|
WARNCXXFLAGS=$CXXFLAGS
|
|
|
|
|
2016-02-02 16:48:47 +01:00
|
|
|
CFLAGS=$save_CFLAGS
|
|
|
|
CXXFLAGS=$save_CXXFLAGS
|
2014-12-01 15:06:11 +01:00
|
|
|
|
|
|
|
AC_SUBST([WARNCFLAGS])
|
2016-01-22 14:48:45 +01:00
|
|
|
AC_SUBST([WARNCXXFLAGS])
|
2014-12-01 15:06:11 +01:00
|
|
|
|
2015-10-21 17:57:00 +02:00
|
|
|
EXTRACFLAG=
|
|
|
|
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [EXTRACFLAG="-fvisibility=hidden"])
|
|
|
|
|
|
|
|
AC_SUBST([EXTRACFLAG])
|
|
|
|
|
2014-02-20 15:19:55 +01:00
|
|
|
if test "x$debug" != "xno"; then
|
2014-04-29 05:58:52 +02:00
|
|
|
AC_DEFINE([DEBUGBUILD], [1], [Define to 1 to enable debug output.])
|
2014-02-20 15:19:55 +01:00
|
|
|
fi
|
|
|
|
|
2015-01-17 07:52:28 +01:00
|
|
|
enable_threads=yes
|
2015-03-04 18:06:31 +01:00
|
|
|
# Some platform does not have working std::future. We disable
|
|
|
|
# threading for those platforms.
|
2015-01-17 07:52:28 +01:00
|
|
|
if test "x$threads" != "xyes" ||
|
2015-03-04 18:06:31 +01:00
|
|
|
test "x$have_std_future" != "xyes"; then
|
2015-01-17 07:52:28 +01:00
|
|
|
enable_threads=no
|
2014-04-23 17:47:26 +02:00
|
|
|
AC_DEFINE([NOTHREADS], [1], [Define to 1 if you want to disable threads.])
|
|
|
|
fi
|
|
|
|
|
2015-10-26 20:30:13 +01:00
|
|
|
# propagate $enable_static to tests/Makefile.am
|
|
|
|
AM_CONDITIONAL([ENABLE_STATIC], [test "x$enable_static" = "xyes"])
|
|
|
|
|
2015-01-24 16:58:30 +01:00
|
|
|
AC_SUBST([TESTLDADD])
|
2014-12-01 15:14:28 +01:00
|
|
|
AC_SUBST([APPLDFLAGS])
|
2013-01-27 08:46:58 +01:00
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
lib/Makefile
|
2013-07-12 17:19:03 +02:00
|
|
|
lib/libnghttp2.pc
|
2012-01-17 16:53:12 +01:00
|
|
|
lib/includes/Makefile
|
2013-07-12 17:19:03 +02:00
|
|
|
lib/includes/nghttp2/nghttp2ver.h
|
2012-01-17 16:53:12 +01:00
|
|
|
tests/Makefile
|
2012-04-25 15:27:50 +02:00
|
|
|
tests/testdata/Makefile
|
2014-01-10 16:36:20 +01:00
|
|
|
third-party/Makefile
|
2012-09-10 14:39:51 +02:00
|
|
|
src/Makefile
|
2014-09-21 11:28:06 +02:00
|
|
|
src/includes/Makefile
|
|
|
|
src/libnghttp2_asio.pc
|
2021-08-24 14:13:05 +02:00
|
|
|
bpf/Makefile
|
2012-01-31 20:10:09 +01:00
|
|
|
examples/Makefile
|
2013-12-14 15:50:30 +01:00
|
|
|
python/Makefile
|
2014-02-26 16:58:21 +01:00
|
|
|
python/setup.py
|
2015-01-19 17:14:22 +01:00
|
|
|
integration-tests/Makefile
|
2015-01-18 15:50:20 +01:00
|
|
|
integration-tests/config.go
|
2015-01-19 16:45:51 +01:00
|
|
|
integration-tests/setenv
|
2012-03-13 16:32:52 +01:00
|
|
|
doc/Makefile
|
|
|
|
doc/conf.py
|
2014-02-12 14:40:37 +01:00
|
|
|
doc/index.rst
|
|
|
|
doc/package_README.rst
|
|
|
|
doc/tutorial-client.rst
|
|
|
|
doc/tutorial-server.rst
|
2014-06-29 16:45:49 +02:00
|
|
|
doc/tutorial-hpack.rst
|
2014-04-20 16:42:15 +02:00
|
|
|
doc/nghttpx-howto.rst
|
2014-06-26 17:05:49 +02:00
|
|
|
doc/h2load-howto.rst
|
2014-09-23 17:25:37 +02:00
|
|
|
doc/libnghttp2_asio.rst
|
2014-06-29 16:56:15 +02:00
|
|
|
doc/python-apiref.rst
|
2014-08-17 12:15:19 +02:00
|
|
|
doc/building-android-binary.rst
|
2014-02-12 14:40:37 +01:00
|
|
|
doc/nghttp2.h.rst
|
|
|
|
doc/nghttp2ver.h.rst
|
2014-09-23 17:25:37 +02:00
|
|
|
doc/asio_http2.h.rst
|
2015-03-06 19:12:13 +01:00
|
|
|
doc/asio_http2_server.h.rst
|
|
|
|
doc/asio_http2_client.h.rst
|
2014-11-26 15:43:20 +01:00
|
|
|
doc/contribute.rst
|
2014-10-19 11:06:34 +02:00
|
|
|
contrib/Makefile
|
2015-06-06 16:32:32 +02:00
|
|
|
script/Makefile
|
2012-01-17 16:53:12 +01:00
|
|
|
])
|
|
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
AC_MSG_NOTICE([summary of build options:
|
|
|
|
|
2015-10-16 15:49:42 +02:00
|
|
|
Package version: ${VERSION}
|
|
|
|
Library version: $LT_CURRENT:$LT_REVISION:$LT_AGE
|
|
|
|
Install prefix: ${prefix}
|
|
|
|
System types:
|
|
|
|
Build: ${build}
|
|
|
|
Host: ${host}
|
|
|
|
Target: ${target}
|
|
|
|
Compiler:
|
|
|
|
C compiler: ${CC}
|
|
|
|
CFLAGS: ${CFLAGS}
|
|
|
|
LDFLAGS: ${LDFLAGS}
|
|
|
|
C++ compiler: ${CXX}
|
|
|
|
CXXFLAGS: ${CXXFLAGS}
|
|
|
|
CXXCPP: ${CXXCPP}
|
|
|
|
C preprocessor: ${CPP}
|
|
|
|
CPPFLAGS: ${CPPFLAGS}
|
|
|
|
WARNCFLAGS: ${WARNCFLAGS}
|
2016-08-30 16:47:07 +02:00
|
|
|
WARNCXXFLAGS: ${WARNCXXFLAGS}
|
2016-01-30 10:42:48 +01:00
|
|
|
CXX1XCXXFLAGS: ${CXX1XCXXFLAGS}
|
2015-10-21 17:57:00 +02:00
|
|
|
EXTRACFLAG: ${EXTRACFLAG}
|
2021-08-24 14:13:05 +02:00
|
|
|
BPFCFLAGS: ${BPFCFLAGS}
|
|
|
|
EXTRABPFCFLAGS: ${EXTRABPFCFLAGS}
|
2015-10-16 15:49:42 +02:00
|
|
|
LIBS: ${LIBS}
|
2021-08-22 12:49:55 +02:00
|
|
|
DEFS: ${DEFS}
|
|
|
|
EXTRA_DEFS: ${EXTRA_DEFS}
|
2015-10-16 15:49:42 +02:00
|
|
|
Library:
|
|
|
|
Shared: ${enable_shared}
|
|
|
|
Static: ${enable_static}
|
2021-02-21 13:32:48 +01:00
|
|
|
Libtool:
|
|
|
|
LIBTOOL_LDFLAGS: ${LIBTOOL_LDFLAGS}
|
2014-12-01 15:10:34 +01:00
|
|
|
Python:
|
|
|
|
Python: ${PYTHON}
|
|
|
|
PYTHON_VERSION: ${PYTHON_VERSION}
|
|
|
|
pyexecdir: ${pyexecdir}
|
|
|
|
PYTHON_CPPFLAGS:${PYTHON_CPPFLAGS}
|
2020-12-29 10:23:35 +01:00
|
|
|
PYTHON_LIBS: ${PYTHON_LIBS}
|
2014-12-01 15:10:34 +01:00
|
|
|
Cython: ${CYTHON}
|
|
|
|
Test:
|
2015-10-16 15:49:42 +02:00
|
|
|
CUnit: ${have_cunit} (CFLAGS='${CUNIT_CFLAGS}' LIBS='${CUNIT_LIBS}')
|
2014-12-20 15:56:09 +01:00
|
|
|
Failmalloc: ${enable_failmalloc}
|
2014-12-01 15:10:34 +01:00
|
|
|
Libs:
|
2015-10-16 15:49:42 +02:00
|
|
|
OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}')
|
2019-05-28 17:14:29 +02:00
|
|
|
Libxml2: ${have_libxml2} (CFLAGS='${LIBXML2_CFLAGS}' LIBS='${LIBXML2_LIBS}')
|
2015-10-16 15:49:42 +02:00
|
|
|
Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}')
|
2019-06-10 12:18:10 +02:00
|
|
|
Libc-ares: ${have_libcares} (CFLAGS='${LIBCARES_CFLAGS}' LIBS='${LIBCARES_LIBS}')
|
2019-06-08 15:05:25 +02:00
|
|
|
libngtcp2: ${have_libngtcp2} (CFLAGS='${LIBNGTCP2_CFLAGS}' LIBS='${LIBNGTCP2_LIBS}')
|
2019-08-25 03:20:10 +02:00
|
|
|
libngtcp2_crypto_openssl: ${have_libngtcp2_crypto_openssl} (CFLAGS='${LIBNGTCP2_CRYPTO_OPENSSL_CFLAGS}' LIBS='${LIBNGTCP2_CRYPTO_OPENSSL_LIBS}')
|
2021-10-15 12:52:01 +02:00
|
|
|
libngtcp2_crypto_boringssl: ${have_libngtcp2_crypto_boringssl} (CFLAGS='${LIBNGTCP2_CRYPTO_BORINGSSL_CFLAGS}' LIBS='${LIBNGTCP2_CRYPTO_BORINGSSL_LIBS}')
|
2019-06-08 15:05:25 +02:00
|
|
|
libnghttp3: ${have_libnghttp3} (CFLAGS='${LIBNGHTTP3_CFLAGS}' LIBS='${LIBNGHTTP3_LIBS}')
|
2021-08-29 06:43:07 +02:00
|
|
|
libbpf: ${have_libbpf} (CFLAGS='${LIBBPF_CFLAGS}' LIBS='${LIBBPF_LIBS}')
|
2015-10-16 15:49:42 +02:00
|
|
|
Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}')
|
|
|
|
Jansson: ${have_jansson} (CFLAGS='${JANSSON_CFLAGS}' LIBS='${JANSSON_LIBS}')
|
2021-03-06 14:32:17 +01:00
|
|
|
Jemalloc: ${have_jemalloc} (CFLAGS='${JEMALLOC_CFLAGS}' LIBS='${JEMALLOC_LIBS}')
|
2015-10-16 15:49:42 +02:00
|
|
|
Zlib: ${have_zlib} (CFLAGS='${ZLIB_CFLAGS}' LIBS='${ZLIB_LIBS}')
|
2017-02-10 09:13:34 +01:00
|
|
|
Systemd: ${have_libsystemd} (CFLAGS='${SYSTEMD_CFLAGS}' LIBS='${SYSTEMD_LIBS}')
|
2014-12-01 15:10:34 +01:00
|
|
|
Boost CPPFLAGS: ${BOOST_CPPFLAGS}
|
|
|
|
Boost LDFLAGS: ${BOOST_LDFLAGS}
|
|
|
|
Boost::ASIO: ${BOOST_ASIO_LIB}
|
|
|
|
Boost::System: ${BOOST_SYSTEM_LIB}
|
|
|
|
Boost::Thread: ${BOOST_THREAD_LIB}
|
2015-10-16 15:49:42 +02:00
|
|
|
Third-party:
|
|
|
|
http-parser: ${enable_third_party}
|
|
|
|
MRuby: ${have_mruby} (CFLAGS='${LIBMRUBY_CFLAGS}' LIBS='${LIBMRUBY_LIBS}')
|
|
|
|
Neverbleed: ${have_neverbleed}
|
2014-12-01 15:10:34 +01:00
|
|
|
Features:
|
|
|
|
Applications: ${enable_app}
|
|
|
|
HPACK tools: ${enable_hpack_tools}
|
|
|
|
Libnghttp2_asio:${enable_asio_lib}
|
|
|
|
Examples: ${enable_examples}
|
|
|
|
Python bindings:${enable_python_bindings}
|
2015-01-17 07:52:28 +01:00
|
|
|
Threading: ${enable_threads}
|
2021-08-21 12:00:43 +02:00
|
|
|
HTTP/3 (EXPERIMENTAL): ${enable_http3}
|
2012-01-17 16:53:12 +01:00
|
|
|
])
|