"Fossies" - the Fresh Open Source Software Archive

Member "hitch-1.7.2/configure.ac" (29 Nov 2021, 6529 Bytes) of package /linux/www/hitch-1.7.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.7.0_vs_1.7.2.

    1 #                                               -*- Autoconf -*-
    2 # Process this file with autoconf to produce a configure script.
    3 
    4 AC_PREREQ([2.59])
    5 AC_INIT([hitch], [1.7.2], [opensource@varnish-software.com])
    6 AC_CONFIG_SRCDIR([src/configuration.c])
    7 AC_CONFIG_HEADERS([config.h])
    8 AC_CONFIG_AUX_DIR([build-aux])
    9 AC_CONFIG_MACRO_DIR([.])
   10 
   11 AC_USE_SYSTEM_EXTENSIONS
   12 
   13 AM_INIT_AUTOMAKE([
   14     -Wall
   15     -Werror
   16     foreign
   17     color-tests
   18     parallel-tests
   19     subdir-objects
   20 ])
   21 AM_PROG_AR
   22 
   23 # Checks for programs.
   24 AM_PROG_CC_C_O
   25 AC_PROG_RANLIB
   26 AC_PROG_INSTALL
   27 AC_PROG_MAKE_SET
   28 
   29 AC_ARG_WITH([lex],
   30     AS_HELP_STRING([--with-lex], [Build with lex]),
   31     [], [with_lex=no])
   32 AC_ARG_WITH([yacc],
   33     AS_HELP_STRING([--with-yacc], [Build with yacc]),
   34     [], [with_yacc=no])
   35 AC_ARG_ENABLE([documentation],
   36     AS_HELP_STRING([--enable-documentation], [Build the documentation]),
   37     [], [enable_documentation=no])
   38 AC_ARG_ENABLE([warnings],
   39     AS_HELP_STRING([--enable-warnings], [Enable warnings]),
   40     [], [enable_warnings=no])
   41 
   42 if test "$with_lex" = yes
   43 then
   44     AC_PROG_LEX
   45     if test "$LEX" = :
   46     then
   47         AC_MSG_ERROR([flex or lex not found])
   48 
   49     fi
   50 fi
   51 
   52 if test "$with_yacc" = yes
   53 then
   54     AC_PROG_YACC
   55     if test -z "$YACC" || ! $YACC -V >/dev/null 2>&1
   56     then
   57         AC_MSG_ERROR([bison, byacc or yacc not found])
   58     fi
   59 fi
   60 
   61 AM_CONDITIONAL([ENABLE_DOCUMENTATION], [test "$enable_documentation" = yes])
   62 AM_CONDITIONAL([ENABLE_WARNINGS], [test "$enable_warnings" = yes])
   63 
   64 AM_COND_IF([ENABLE_DOCUMENTATION], [
   65     AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], [no])
   66     if test "$RST2MAN" = no
   67     then
   68         AC_MSG_ERROR([rst2man is needed to build the documentation])
   69     fi
   70 ])
   71 
   72 AC_CHECK_PROGS(SOCKSTAT, [lsof sockstat fstat], [no])
   73 if test "x$SOCKSTAT" = xno; then
   74     AC_MSG_WARN([No tool found for socket inspection, tests will fail.])
   75 fi
   76 
   77 AM_MAINTAINER_MODE([disable])
   78 
   79 # Checks for libraries.
   80 PKG_CHECK_EXISTS([libev], [
   81     PKG_CHECK_MODULES([EV], [libev])], [
   82     HITCH_SEARCH_LIBS([EV], [ev], [ev_default_loop],
   83         [AC_MSG_ERROR([Cannot find libev.])])
   84 ])
   85 
   86 PKG_CHECK_MODULES([SSL], [libssl])
   87 PKG_CHECK_MODULES([CRYPTO], [libcrypto])
   88 HITCH_SEARCH_LIBS([SOCKET], [socket], [socket])
   89 HITCH_SEARCH_LIBS([NSL], [nsl], [inet_ntop])
   90 HITCH_SEARCH_LIBS([RT], [rt], [clock_gettime])
   91 
   92 AC_CHECK_MEMBERS([struct stat.st_mtim, struct stat.st_mtimespec])
   93 
   94 AC_ARG_ENABLE(sessioncache,
   95     AC_HELP_STRING([--enable-sessioncache],
   96            [Enable TLS session cache. (default is off)]),
   97     [use_shctx="$enableval"],
   98     [use_shctx=no])
   99 if test x"$use_shctx" != xno; then
  100   if test ! -e 'src/ebtree/ebtree.h'; then
  101     AC_MSG_ERROR([Must clone https://github.com/haproxy/ebtree to src/ebtree/])
  102   fi
  103   AC_DEFINE([USE_SHARED_CACHE], [1], [sessioncache is enabled])
  104 fi
  105 AM_CONDITIONAL(USE_SHCTX, test xno != x"$use_shctx")
  106 
  107 # Checks for header files.
  108 AC_CHECK_HEADERS([stdlib.h unistd.h])
  109 
  110 # Checks for typedefs, structures, and compiler characteristics.
  111 AC_TYPE_UID_T
  112 AC_C_INLINE
  113 AC_TYPE_INT32_T
  114 AC_TYPE_PID_T
  115 AC_TYPE_SIZE_T
  116 AC_TYPE_SSIZE_T
  117 AC_TYPE_UINT32_T
  118 
  119 # Checks for library functions.
  120 AC_FUNC_FORK
  121 AC_FUNC_MMAP
  122 AC_CHECK_FUNCS([accept4])
  123 
  124 AC_CACHE_CHECK([whether SO_REUSEPORT works],
  125   [ac_cv_so_reuseport_works],
  126   [AC_RUN_IFELSE(
  127     [AC_LANG_PROGRAM([[
  128 #include <sys/types.h>
  129 #include <sys/socket.h>
  130     ]], [[
  131     int s = socket(AF_INET, SOCK_STREAM, 0);
  132     int i = 5;
  133     if (setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &i, sizeof i) < 0)
  134       return (1);
  135     return (0);
  136 ]])],
  137   [ac_cv_so_reuseport_works=yes],
  138   [ac_cv_so_reuseport_works=no])
  139   ]
  140 )
  141 if test "$ac_cv_so_reuseport_works" = yes; then
  142   AC_DEFINE([SO_REUSEPORT_WORKS], [1], [Define if SO_REUSEPORT works])
  143 fi
  144 
  145 AC_ARG_ENABLE(tcp-fastopen,
  146     AC_HELP_STRING([--enable-tcp-fastopen],
  147         [Enable TCP Fast Open. (default is auto)]),
  148     [use_tfo="$enableval"],
  149     [use_tfo=auto])
  150 
  151 if test x"$use_tfo" != xno; then
  152     AC_CACHE_CHECK([whether TCP_FASTOPEN works],
  153         [ac_cv_so_tfo],
  154         [AC_RUN_IFELSE(
  155             [AC_LANG_PROGRAM([[
  156                 #include <sys/types.h>
  157                 #include <sys/socket.h>
  158                 #include <netinet/tcp.h>
  159             ]], [[
  160                 int s = socket(AF_INET, SOCK_STREAM, 0);
  161                 int i = 5;
  162                 if (setsockopt(s, SOL_TCP, TCP_FASTOPEN, &i, sizeof i) < 0)
  163                 return (1);
  164                 return (0);
  165             ]])],
  166         [ac_cv_so_tfo=yes],
  167         [ac_cv_so_tfo=no])
  168         ]
  169     )
  170     if test "$ac_cv_so_tfo" != yes && test use_tfo = yes; then
  171         AC_MSG_ERROR([Socket option TCP_FASTOPEN is not supported by the kernel])
  172     fi
  173     if test "$ac_cv_so_tfo" = yes; then
  174         AC_DEFINE([TCP_FASTOPEN_WORKS], [1], [TCP Fast Open is enabled])
  175     fi
  176 fi
  177 
  178 AC_CHECK_HEADERS([linux/futex.h])
  179 AM_CONDITIONAL([HAVE_LINUX_FUTEX], [test $ac_cv_header_linux_futex_h = yes])
  180 
  181 HITCH_CHECK_FUNC([SSL_get0_alpn_selected], [$SSL_LIBS], [
  182     AC_DEFINE([OPENSSL_WITH_ALPN], [1], [OpenSSL supports ALPN])
  183 ])
  184 
  185 HITCH_CHECK_FUNC([SSL_get0_next_proto_negotiated], [$SSL_LIBS], [
  186     AC_DEFINE([OPENSSL_WITH_NPN], [1], [OpenSSL supports NPN])
  187 ])
  188 
  189 HITCH_CHECK_FUNC([SSL_CTX_get_default_passwd_cb], [$SSL_LIBS], [
  190     AC_DEFINE([HAVE_SSL_CTX_GET_DEFAULT_PASSWD_CB], [1],
  191         [OpenSSL has SSL_CTX_get_default_passwd_cb()])
  192 ])
  193 
  194 HITCH_CHECK_FUNC([SSL_CTX_get_default_passwd_cb_userdata], [$SSL_LIBS], [
  195     AC_DEFINE([HAVE_SSL_CTX_GET_DEFAULT_PASSWD_CB_USERDATA], [1],
  196         [OpenSSL has SSL_CTX_get_default_passwd_cb_userdata()])
  197 ])
  198 
  199 HITCH_CHECK_FUNC([CRYPTO_get_locking_callback], [$CRYPTO_LIBS], [
  200     AC_DEFINE([OPENSSL_WITH_LOCKS], [1], [OpenSSL needs explicit locking])
  201 ])
  202 
  203 HITCH_CHECK_FUNC([X509_NAME_ENTRY_get_data], [$CRYPTO_LIBS], [
  204     AC_DEFINE([HAVE_X509_NAME_ENTRY_GET_DATA], [1],
  205         [OpenSSL has X509_NAME_ENTRY_get_data()])
  206 ])
  207 
  208 HITCH_CHECK_FUNC([X509_STORE_get0_objects], [$CRYPTO_LIBS], [
  209     AC_DEFINE([HAVE_X509_STORE_GET0_OBJECTS], [1],
  210         [OpenSSL has X509_STORE_get0_objects()])
  211 ])
  212 
  213 HITCH_CHECK_FUNC([X509_OBJECT_get0_X509], [$CRYPTO_LIBS], [
  214     AC_DEFINE([HAVE_X509_OBJECT_GET0_X509], [1],
  215         [OpenSSL has X509_OBJECT_get0_X509()])
  216 ])
  217 
  218 AC_CHECK_MEMBERS([struct ssl_st.s3], [], [], [[#include <openssl/ssl.h>]])
  219 
  220 AS_VERSION_COMPARE([$($PKG_CONFIG --modversion openssl)], [1.1.1],
  221     [openssl111=no],
  222     [openssl111=yes], [openssl111=yes])
  223 
  224 AS_IF([test "x$openssl111" = xyes],
  225     [AC_DEFINE([HAVE_TLS_1_3], [1], [Define to 1 if TLSv1.3 is available])], [])
  226 
  227 SH_TESTS="$(cd $srcdir/src && echo tests/test*.sh)"
  228 AC_SUBST(SH_TESTS)
  229 
  230 dnl Desired CFLAGS
  231 HITCH_CHECK_FLAGS([HITCH_CFLAGS], [
  232     -g
  233     -O2
  234 ])
  235 
  236 AM_COND_IF([ENABLE_WARNINGS], [
  237     dnl XXX: expand developer warnings?
  238     HITCH_CHECK_FLAGS([HITCH_CFLAGS], [
  239         -Wall
  240         -W
  241         -Werror
  242     ])
  243 ])
  244 
  245 AC_SUBST([HITCH_CFLAGS])
  246 
  247 dnl Help libev macros
  248 HITCH_CHECK_FLAGS([EV_CFLAGS], [-fno-strict-aliasing])
  249 
  250 AC_CONFIG_FILES([
  251     Makefile
  252     src/Makefile
  253     src/util/Makefile
  254 ])
  255 
  256 AC_OUTPUT