2014-03-30 12:09:21 +02:00
|
|
|
dnl nghttp2 - HTTP/2 C Library
|
2012-01-17 16:53:12 +01:00
|
|
|
|
2013-09-03 19:41:22 +02:00
|
|
|
dnl Copyright (c) 2012, 2013 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.
|
|
|
|
AC_PREREQ(2.61)
|
2014-07-22 17:45:39 +02:00
|
|
|
AC_INIT([nghttp2], [0.5.1], [t-tujikawa@users.sourceforge.net])
|
2012-03-21 16:51:36 +01:00
|
|
|
LT_PREREQ([2.2.6])
|
|
|
|
LT_INIT()
|
2012-01-17 16:53:12 +01:00
|
|
|
dnl See versioning rule:
|
|
|
|
dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
2014-07-18 14:20:11 +02:00
|
|
|
AC_SUBST(LT_CURRENT, 4)
|
2014-07-22 17:45:39 +02:00
|
|
|
AC_SUBST(LT_REVISION, 1)
|
2013-01-12 13:30:38 +01:00
|
|
|
AC_SUBST(LT_AGE, 0)
|
2012-01-17 16:53:12 +01:00
|
|
|
|
2013-09-03 19:41:22 +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-03-23 15:49:07 +01:00
|
|
|
AC_CANONICAL_BUILD
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
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])])
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
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],
|
|
|
|
[Build applications (nghttp, nghttpd and nghttpx) [default=check]])],
|
|
|
|
[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
|
|
|
|
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],
|
|
|
|
[AS_HELP_STRING([--enable-failmalloc],
|
2014-01-10 15:19:36 +01:00
|
|
|
[Build failmalloc test program [default=no]])],
|
2013-10-30 18:02:00 +01:00
|
|
|
[request_failmalloc=$enableval], [request_failmalloc=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
|
|
|
|
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])
|
|
|
|
|
2014-03-05 13:44:28 +01:00
|
|
|
AC_ARG_WITH([spdylay],
|
|
|
|
[AS_HELP_STRING([--with-spdylay],
|
|
|
|
[Use spdylay [default=check]])],
|
|
|
|
[request_spdylay=$withval], [request_spdylay=check])
|
|
|
|
|
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], [])
|
|
|
|
|
2013-12-16 13:46:50 +01:00
|
|
|
dnl Define variables
|
|
|
|
AC_ARG_VAR([CYTHON], [the Cython executable])
|
|
|
|
|
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
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2013-02-10 10:28:53 +01:00
|
|
|
AM_PROG_CC_C_O
|
2012-01-24 14:02:24 +01:00
|
|
|
PKG_PROG_PKG_CONFIG([0.20])
|
2014-01-12 13:31:33 +01:00
|
|
|
|
|
|
|
if [test "x$request_python_bindings" != "xno"]; then
|
|
|
|
AM_PATH_PYTHON([2.7],, [:])
|
|
|
|
AX_PYTHON_DEVEL([>= '2.7'])
|
|
|
|
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
|
|
|
|
2013-08-06 14:20:36 +02:00
|
|
|
AX_CXX_COMPILE_STDCXX_11([noext], [optional])
|
|
|
|
|
2014-06-18 07:24:45 +02:00
|
|
|
AC_LANG_PUSH(C++)
|
|
|
|
|
2013-09-17 15:48:30 +02:00
|
|
|
# Check that std::chrono::steady_clock is available. In particular,
|
|
|
|
# gcc 4.6 does not have one, but has monotonic_clock which is the old
|
|
|
|
# name existed in the pre-standard draft. If steady_clock is not
|
|
|
|
# available, don't define HAVE_STEADY_CLOCK and replace steady_clock
|
|
|
|
# with monotonic_clock.
|
|
|
|
AC_MSG_CHECKING([whether std::chrono::steady_clock is available])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
|
|
[[
|
|
|
|
#include <chrono>
|
|
|
|
]],
|
|
|
|
[[
|
|
|
|
auto tp = std::chrono::steady_clock::now();
|
|
|
|
]])],
|
|
|
|
[AC_DEFINE([HAVE_STEADY_CLOCK], [1],
|
|
|
|
[Define to 1 if you have the `std::chrono::steady_clock`.])
|
|
|
|
AC_MSG_RESULT([yes])],
|
|
|
|
[AC_MSG_RESULT([no])])
|
2014-06-18 07:24:45 +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;
|
|
|
|
]])],
|
|
|
|
[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])])
|
|
|
|
|
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.
|
|
|
|
TESTS_LIBS=
|
|
|
|
|
2013-01-27 09:16:13 +01:00
|
|
|
# Additional libraries required for programs under src directory.
|
|
|
|
SRC_LIBS=
|
|
|
|
|
2013-01-27 08:46:58 +01:00
|
|
|
LIBS_OLD=$LIBS
|
2012-07-27 15:11:13 +02:00
|
|
|
# Search for dlsym function, which is used in tests. Linux needs -ldl,
|
|
|
|
# but netbsd does not need it.
|
|
|
|
AC_SEARCH_LIBS([dlsym], [dl])
|
2013-03-07 13:17:55 +01:00
|
|
|
TESTS_LIBS="$LIBS $TESTS_LIBS"
|
2013-01-27 08:46:58 +01:00
|
|
|
LIBS=$LIBS_OLD
|
2012-07-27 15:11:13 +02:00
|
|
|
|
2013-01-27 09:16:13 +01:00
|
|
|
LIBS_OLD=$LIBS
|
|
|
|
AC_SEARCH_LIBS([clock_gettime], [rt],
|
|
|
|
[AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
|
|
|
|
[Define to 1 if you have the `clock_gettime`.])])
|
2013-03-07 13:17:55 +01:00
|
|
|
SRC_LIBS="$LIBS $SRC_LIBS"
|
2013-01-27 09:16:13 +01:00
|
|
|
LIBS=$LIBS_OLD
|
|
|
|
|
2013-03-07 13:17:55 +01:00
|
|
|
case "$host" in
|
|
|
|
*android*)
|
2013-03-07 13:24:40 +01:00
|
|
|
android_build=yes
|
2013-03-07 13:17:55 +01:00
|
|
|
# android does not need -pthread, but needs followng 2 libs for C++
|
|
|
|
SRC_LIBS="$SRC_LIBS -lstdc++ -lsupc++"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
SRC_LIBS="$SRC_LIBS -pthread"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2012-02-08 15:11:06 +01:00
|
|
|
# zlib
|
2013-03-07 13:24:40 +01:00
|
|
|
if test "x$android_build" = "xyes"; then
|
|
|
|
# Use zlib provided by NDK
|
2014-05-06 16:10:50 +02:00
|
|
|
SRC_LIBS="-lz $SRC_LIBS"
|
2014-06-18 07:12:40 +02:00
|
|
|
have_zlib=yes
|
2013-03-07 13:24:40 +01:00
|
|
|
else
|
2014-05-06 16:10:50 +02:00
|
|
|
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no])
|
|
|
|
|
|
|
|
if test "x${have_zlib}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($ZLIB_PKG_ERRORS)
|
|
|
|
fi
|
2013-03-07 13:24:40 +01:00
|
|
|
fi
|
2012-01-24 14:02:24 +01:00
|
|
|
|
2012-02-08 15:11:06 +01:00
|
|
|
# cunit
|
|
|
|
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-09 14:11:30 +01:00
|
|
|
if test "x${have_cunit}" = "xyes"; then
|
2012-02-14 13:26:52 +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-09 14:11:30 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
|
|
|
|
|
2013-07-28 12:50:02 +02:00
|
|
|
# openssl (for src)
|
2012-03-28 19:13:33 +02:00
|
|
|
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)
|
|
|
|
fi
|
|
|
|
|
2013-07-28 12:50:02 +02:00
|
|
|
# libevent_openssl (for src)
|
2012-06-06 18:36:49 +02:00
|
|
|
# 2.0.8 is required because we use evconnlistener_set_error_cb()
|
|
|
|
PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.0.8],
|
2012-06-04 16:48:31 +02:00
|
|
|
[have_libevent_openssl=yes], [have_libevent_openssl=no])
|
|
|
|
if test "x${have_libevent_openssl}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($LIBEVENT_OPENSSL_PKG_ERRORS)
|
|
|
|
fi
|
|
|
|
|
2013-10-21 17:42:46 +02:00
|
|
|
# jansson (for hdtest/deflatehd and hdtest/inflatehd)
|
2014-01-07 13:19:46 +01:00
|
|
|
PKG_CHECK_MODULES([JANSSON], [jansson >= 2.5],
|
2013-10-21 17:42:46 +02:00
|
|
|
[have_jansson=yes], [have_jansson=no])
|
|
|
|
if test "x${have_jansson}" == "xno"; then
|
|
|
|
AC_MSG_NOTICE($JANSSON_PKG_ERRORS)
|
|
|
|
fi
|
|
|
|
|
2013-07-28 12:50:02 +02:00
|
|
|
# libxml2 (for src/nghttp)
|
2013-03-07 12:52:29 +01:00
|
|
|
have_libxml2=no
|
2014-01-10 15:19:36 +01:00
|
|
|
if test "x${request_libxml2}" != "xno"; then
|
2013-03-07 12:52:29 +01:00
|
|
|
AM_PATH_XML2(2.7.7, [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.])
|
|
|
|
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
|
|
|
|
LIBS_OLD=$LIBS
|
|
|
|
AC_SEARCH_LIBS([malloc_stats_print], [jemalloc], [have_jemalloc=yes])
|
|
|
|
LIBS=$LIBS_OLD
|
2014-05-18 12:38:33 +02:00
|
|
|
if test "x${have_jemalloc}" = "xyes" &&
|
|
|
|
test "x${ac_cv_search_malloc_stats_print}" != "xnone required"; then
|
|
|
|
JEMALLOC_LIBS=${ac_cv_search_malloc_stats_print}
|
2014-03-05 13:38:33 +01:00
|
|
|
AC_SUBST([JEMALLOC_LIBS])
|
|
|
|
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-03-05 13:44:28 +01:00
|
|
|
# spdylay (for src/nghttpx and src/h2load)
|
|
|
|
have_spdylay=no
|
|
|
|
if test "x${request_spdylay}" != "xno"; then
|
|
|
|
PKG_CHECK_MODULES([LIBSPDYLAY], [libspdylay >= 1.2.3],
|
|
|
|
[have_spdylay=yes], [have_spdylay=no])
|
|
|
|
if test "x${have_spdylay}" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_SPDYLAY], [1], [Define to 1 if you have `spdylay` library.])
|
|
|
|
else
|
|
|
|
AC_MSG_NOTICE($LIBSPDYLAY_PKG_ERRORS)
|
|
|
|
AC_MSG_NOTICE([The SPDY support in nghttpx and h2load will be disabled.])
|
|
|
|
fi
|
2013-07-26 13:12:55 +02:00
|
|
|
fi
|
2014-03-05 13:44:28 +01:00
|
|
|
|
|
|
|
if test "x${request_spdylay}" = "xyes" &&
|
|
|
|
test "x${have_spdylay}" != "xyes"; then
|
|
|
|
AC_MSG_ERROR([spdylay was requested (--with-spdylay) but not found])
|
|
|
|
fi
|
|
|
|
|
2013-07-26 13:12:55 +02:00
|
|
|
AM_CONDITIONAL([HAVE_SPDYLAY], [ test "x${have_spdylay}" = "xyes" ])
|
|
|
|
|
2014-05-06 16:10:50 +02:00
|
|
|
# The nghttp, nghttpd and nghttpx under src depend on zlib, OpenSSL
|
|
|
|
# and libevent_openssl
|
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" &&
|
|
|
|
test "x${have_libevent_openssl}" = "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" ])
|
2014-06-18 07:24:45 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_H2LOAD], [ test "x${have_std_future}" = "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-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
|
|
|
|
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:" &&
|
|
|
|
test "x${have_python_dev}" = "xyes"; 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
|
|
|
|
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 \
|
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 \
|
2012-01-27 15:05:29 +01:00
|
|
|
time.h \
|
2012-01-17 16:53:12 +01:00
|
|
|
unistd.h \
|
|
|
|
])
|
|
|
|
|
2013-03-27 17:25:42 +01:00
|
|
|
case "${host}" in
|
|
|
|
*mingw*)
|
|
|
|
# For ntohl, ntohs in Windows
|
|
|
|
AC_CHECK_HEADERS([winsock2.h])
|
|
|
|
;;
|
|
|
|
esac
|
2012-08-23 19:15:57 +02:00
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
# 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
|
|
|
|
AC_CHECK_TYPES([ptrdiff_t])
|
|
|
|
AC_C_BIGENDIAN
|
2013-01-10 16:17:43 +01:00
|
|
|
AC_SYS_LARGEFILE
|
2012-01-17 16:53:12 +01:00
|
|
|
|
|
|
|
# Checks for library functions.
|
2012-03-23 15:49:07 +01:00
|
|
|
if test "x$cross_compiling" != "xyes"; then
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
fi
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CHECK_FUNCS([ \
|
2012-07-31 19:06:27 +02:00
|
|
|
getpwnam \
|
2012-01-17 16:53:12 +01:00
|
|
|
memmove \
|
|
|
|
memset \
|
2013-03-07 13:17:55 +01:00
|
|
|
timegm \
|
2012-01-17 16:53:12 +01:00
|
|
|
])
|
|
|
|
|
2012-08-23 19:15:57 +02:00
|
|
|
dnl Windows library for winsock2
|
|
|
|
case "${host}" in
|
|
|
|
*mingw*)
|
|
|
|
LIBS="$LIBS -lws2_32"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2014-02-20 15:17:04 +01:00
|
|
|
if test "x$werror" != "xno"; then
|
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"])
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wno-unused-parameter], [CFLAGS="$CFLAGS -Wno-unused-parameter"])
|
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
|
|
|
|
|
|
|
# Only work with Clang for the moment
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wheader-guard], [CFLAGS="$CFLAGS -Wheader-guard"])
|
2012-06-11 16:08:18 +02:00
|
|
|
fi
|
|
|
|
|
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
|
|
|
|
|
2014-04-23 17:47:26 +02:00
|
|
|
if test "x$threads" != "xyes"; then
|
|
|
|
AC_DEFINE([NOTHREADS], [1], [Define to 1 if you want to disable threads.])
|
|
|
|
fi
|
|
|
|
|
2013-01-27 08:46:58 +01:00
|
|
|
AC_SUBST([TESTS_LIBS])
|
2013-01-27 09:16:13 +01:00
|
|
|
AC_SUBST([SRC_LIBS])
|
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
|
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
|
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-06-29 16:56:15 +02:00
|
|
|
doc/python-apiref.rst
|
2014-02-12 14:40:37 +01:00
|
|
|
doc/nghttp2.h.rst
|
|
|
|
doc/nghttp2ver.h.rst
|
2012-01-17 16:53:12 +01:00
|
|
|
])
|
|
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
AC_MSG_NOTICE([summary of build options:
|
|
|
|
|
2012-05-27 16:52:48 +02:00
|
|
|
Version: ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
|
2012-01-17 16:53:12 +01:00
|
|
|
Host type: ${host}
|
|
|
|
Install prefix: ${prefix}
|
|
|
|
C compiler: ${CC}
|
2012-05-27 16:52:08 +02:00
|
|
|
CFLAGS: ${CFLAGS}
|
|
|
|
LDFLAGS: ${LDFLAGS}
|
|
|
|
LIBS: ${LIBS}
|
|
|
|
CPPFLAGS: ${CPPFLAGS}
|
|
|
|
C preprocessor: ${CPP}
|
|
|
|
C++ compiler: ${CXX}
|
|
|
|
CXXFLAGS: ${CXXFLAGS}
|
|
|
|
CXXCPP: ${CXXCPP}
|
2012-01-17 16:53:12 +01:00
|
|
|
Library types: Shared=${enable_shared}, Static=${enable_static}
|
2014-01-10 17:01:28 +01:00
|
|
|
Python: ${PYTHON}
|
|
|
|
PYTHON_VERSION: ${PYTHON_VERSION}
|
|
|
|
pyexecdir: ${pyexecdir}
|
2014-01-12 13:31:33 +01:00
|
|
|
Python-dev: ${have_python_dev}
|
2014-01-10 17:01:28 +01:00
|
|
|
PYTHON_CPPFLAGS:${PYTHON_CPPFLAGS}
|
|
|
|
PYTHON_LDFLAGS: ${PYTHON_LDFLAGS}
|
2014-01-10 15:19:36 +01:00
|
|
|
Cython: ${CYTHON}
|
2012-01-17 16:53:12 +01:00
|
|
|
CUnit: ${have_cunit}
|
2012-03-28 19:13:33 +02:00
|
|
|
OpenSSL: ${have_openssl}
|
2012-05-27 16:52:08 +02:00
|
|
|
Libxml2: ${have_libxml2}
|
2012-06-06 18:36:49 +02:00
|
|
|
Libevent(SSL): ${have_libevent_openssl}
|
2013-12-25 16:13:35 +01:00
|
|
|
Spdylay: ${have_spdylay}
|
2013-10-27 08:24:42 +01:00
|
|
|
Jansson: ${have_jansson}
|
2014-03-05 13:38:33 +01:00
|
|
|
Jemalloc: ${have_jemalloc}
|
2014-01-10 15:19:36 +01:00
|
|
|
Applications: ${enable_app}
|
2014-01-10 13:53:48 +01:00
|
|
|
HPACK tools: ${enable_hpack_tools}
|
2014-01-10 15:19:36 +01:00
|
|
|
Examples: ${enable_examples}
|
2014-01-10 17:01:28 +01:00
|
|
|
Python bindings:${enable_python_bindings}
|
2013-10-30 18:02:00 +01:00
|
|
|
Failmalloc: ${request_failmalloc}
|
2012-01-17 16:53:12 +01:00
|
|
|
])
|