1748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# This file is part of libmicrohttpd.
2748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# (C) 2006-2015 Christian Grothoff (and other contributing authors)
3748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#
4748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# libmicrohttpd is free software; you can redistribute it and/or modify
5748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# it under the terms of the GNU General Public License as published
6748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# by the Free Software Foundation; either version 3, or (at your
7748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# option) any later version.
8748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#
9748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# libmicrohttpd is distributed in the hope that it will be useful, but
10748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# WITHOUT ANY WARRANTY; without even the implied warranty of
11748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# General Public License for more details.
13748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#
14748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# You should have received a copy of the GNU General Public License
15748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# along with libmicrohttpd; see the file COPYING.  If not, write to the
16748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Boston, MA 02111-1307, USA.
18748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#
19748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#
20748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Process this file with autoconf to produce a configure script.
21748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#
22748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#
23748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_PREREQ([2.60])
24748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratLT_PREREQ([2.4.0])
25748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_INIT([libmicrohttpd],[0.9.42],[libmicrohttpd@gnu.org])
26748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_INIT_AUTOMAKE([silent-rules] [subdir-objects])
27748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CONFIG_HEADERS([MHD_config.h])
28748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CONFIG_MACRO_DIR([m4])
29748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAH_TOP([#define _GNU_SOURCE  1])
30748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
31748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratLIB_VERSION_CURRENT=42
32748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratLIB_VERSION_REVISION=0
33748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratLIB_VERSION_AGE=32
34748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(LIB_VERSION_CURRENT)
35748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(LIB_VERSION_REVISION)
36748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(LIB_VERSION_AGE)
37748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
38748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratLIBSPDY_VERSION_CURRENT=0
39748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratLIBSPDY_VERSION_REVISION=0
40748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratLIBSPDY_VERSION_AGE=0
41748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(LIBSPDY_VERSION_CURRENT)
42748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(LIBSPDY_VERSION_REVISION)
43748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(LIBSPDY_VERSION_AGE)
44748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
45748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
46748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test `uname -s` = "OS/390"
47748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
48748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# configure binaries for z/OS
49748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test -z "$CC"
50748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  then
51748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    CC=`pwd`"/contrib/xcc"
52748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    chmod +x $CC || true
53748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
54748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test -z "$CPP"
55748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  then
56748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    CPP="c89 -E"
57748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
58748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test -z "$CXXCPP"
59748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  then
60748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    CXXCPP="c++ -E -+"
61748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
62748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#  _CCC_CCMODE=1
63748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#  _C89_CCMODE=1
64748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
65748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
66748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Checks for programs.
67748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_PROG_AWK
68748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_PROG_INSTALL
69748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_PROG_LN_S
70748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_PROG_MAKE_SET
71748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CANONICAL_HOST
72748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_PROG_CC_C_O
73748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratLT_INIT([win32-dll])
74748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratLT_LANG([Windows Resource])
75748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
76748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratPACKAGE_VERSION_MAJOR=${PACKAGE_VERSION%.*.*}
77748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratPACKAGE_VERSION_MINOR=${PACKAGE_VERSION%.*}; PACKAGE_VERSION_MINOR=${PACKAGE_VERSION_MINOR#*.}
78748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratPACKAGE_VERSION_SUBMINOR=${PACKAGE_VERSION#*.*.}
79748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([PACKAGE_VERSION_MAJOR])
80748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([PACKAGE_VERSION_MINOR])
81748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([PACKAGE_VERSION_SUBMINOR])
82748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CONFIG_FILES([src/microhttpd/microhttpd_dll_res.rc])
83748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
84748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratMHD_LIB_CPPFLAGS=""
85748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratMHD_LIB_CFLAGS=""
86748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratMHD_LIB_LDFLAGS=""
87748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratMHD_LIBDEPS=""
88748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
89748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_WITH([threads],
90748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [AC_HELP_STRING([--with-threads=LIB],[choose threading library (posix, w32, auto) [auto]])],
91748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [], [with_threads='auto'])
92748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erattest "x$with_threads" = "xwin32" && with_threads='w32'
93748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erattest "x$with_threads" = "xpthreads" && with_threads='posix'
94748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
95748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Check for posix threads support
96748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAX_PTHREAD([HAVE_POSIX_THREADS='yes'],[HAVE_POSIX_THREADS='no'])
97748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_POSIX_THREADS],[test "x$HAVE_POSIX_THREADS" = "xyes"])
98748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Simple check for W32 threads support
99748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_HEADER([windows.h],
100748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [
101748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_MSG_CHECKING([for CreateThread()])
102748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_LINK_IFELSE(
103748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      [AC_LANG_PROGRAM([#include <windows.h>], [ HANDLE h = CreateThread(NULL, 0, NULL, NULL, 0, NULL);])],
104748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      [
105748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AC_MSG_RESULT([yes])
106748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        HAVE_W32_THREADS='yes'
107748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      ],
108748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      [
109748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AC_MSG_RESULT([no])
110748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        HAVE_W32_THREADS='no'
111748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      ])
112748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  ],
113748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [HAVE_W32_THREADS='no'])
114748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
115748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# for pkg-config
116748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratMHD_LIBDEPS=""
117748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratMHD_REQ_PRIVATE=''
118748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Check system type
119748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratcase "$host_os" in
120748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat*darwin* | *rhapsody* | *macosx*)
121748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system])
122748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     CFLAGS="-no-cpp-precomp -fno-common $CFLAGS"
123748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     ;;
124748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfreebsd*)
125748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
126748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
127748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     ;;
128748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratopenbsd*)
129748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
130748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
131748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     ;;
132748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratnetbsd*)
133748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
134748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
135748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     ;;
136748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat*solaris*)
137748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
138748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work])
139748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_SEARCH_LIBS(gethostbyname, nsl)
140748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_SEARCH_LIBS(socket, socket)
141748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     ;;
142748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat*arm-linux*)
143748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
144748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(HAVE_LISTEN_SHUTDOWN,1,[can use shutdown on listen sockets])
145748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     CFLAGS="-fPIC -pipe $CFLAGS"
146748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     ;;
147748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat*linux*)
148748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
149748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(HAVE_LISTEN_SHUTDOWN,1,[can use shutdown on listen sockets])
150748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     ;;
151748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat*cygwin*)
152748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
153748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     os_is_windows=yes
154748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     ;;
155748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat*mingw*)
156748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
157748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
158748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     LIBS="$LIBS -lws2_32"
159748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_CHECK_HEADERS([winsock2.h ws2tcpip.h],, AC_MSG_ERROR([[Winsock2 headers are required for W32]]))
160748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_CACHE_CHECK([for MS lib utility], [ac_cv_use_ms_lib_tool],
161748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       [[mslibcheck=`lib 2>&1`
162748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        if [[ $mslibcheck = "Microsoft (R) Library Manager"* ]]; then
163748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          ac_cv_use_ms_lib_tool=yes
164748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        else
165748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          ac_cv_use_ms_lib_tool=no
166748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        fi
167748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat         ]])
168748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     if test "x$ac_cv_use_ms_lib_tool" = "xyes"; then
169748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       AC_SUBST([MS_LIB_TOOL], [[lib]])
170748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     fi
171748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_SUBST([lt_cv_objdir])
172748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     os_is_windows=yes
173748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     os_is_native_w32=yes
174748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     ;;
175748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat*openedition*)
176748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(OS390,1,[This is a OS/390 system])
177748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    ;;
178748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat*)
179748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_MSG_WARN([Unrecognised OS $host_os])
180748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
181748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#    You might want to find out if your OS supports shutdown on listen sockets,
182748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#    and extend the switch statement; if we do not have 'HAVE_LISTEN_SHUTDOWN',
183748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#    pipes are used instead to signal 'select'.
184748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#    AC_DEFINE_UNQUOTED(HAVE_LISTEN_SHUTDOWN,1,[can use shutdown on listen sockets])
185748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat;;
186748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratesac
187748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
188748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$with_threads" = "xposix"; then
189748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# forced posix threads
190748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test "x$HAVE_POSIX_THREADS" = "xyes"; then
191748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    USE_THREADS='posix'
192748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  else
193748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    if test "x$HAVE_W32_THREADS" = "xyes"; then
194748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      AC_MSG_ERROR([[Posix threads are not available. Try to configure --with-threads=auto]])
195748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    else
196748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      AC_MSG_ERROR([[Posix threads are not available]])
197748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    fi
198748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
199748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelif test "x$with_threads" = "xw32"; then
200748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# forced w32 threads
201748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test "x$HAVE_W32_THREADS" = "xyes"; then
202748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    USE_THREADS='w32'
203748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  else
204748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    if test "x$HAVE_POSIX_THREADS" = "xyes"; then
205748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      AC_MSG_ERROR([[W32 threads are not available. Try to configure --with-threads=auto]])
206748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    else
207748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      AC_MSG_ERROR([[W32 threads are not available]])
208748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    fi
209748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
210748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelse
211748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# automatic threads lib selection
212748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test "x$HAVE_POSIX_THREADS" = "xyes" && test "x$HAVE_W32_THREADS" = "xyes"; then
213748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    if test "x$os_is_native_w32" = "xyes"; then
214748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      USE_THREADS='w32'
215748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    else
216748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      USE_THREADS='posix'
217748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    fi
218748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  elif test "x$HAVE_POSIX_THREADS" = "xyes"; then
219748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    USE_THREADS='posix'
220748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  elif test "x$HAVE_W32_THREADS" = "xyes"; then
221748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    USE_THREADS='w32'
222748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  else
223748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_MSG_ERROR([[No threading lib is available. Cosider installing pthreads]])
224748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
225748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
226748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
227748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$USE_THREADS" = "xposix"; then
228748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  CC="$PTHREAD_CC"
229748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_DEFINE([MHD_USE_POSIX_THREADS],[1],[define to use pthreads])
230748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $PTHREAD_CFLAGS"
231748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  MHD_LIBDEPS="$PTHREAD_LIBS $MHD_LIBDEPS"
232748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelif test "x$USE_THREADS" = "xw32"; then
233748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_DEFINE([MHD_USE_W32_THREADS],[1],[define to use W32 threads])
234748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
235748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([USE_POSIX_THREADS], [test "x$USE_THREADS" = "xposix"])
236748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"])
237748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
238748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
239748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL(HAVE_W32, [test "x$os_is_native_w32" = "xyes"])
240748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratw32_shared_lib_exp=no
241748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_shared" = "xyes" && test "x$os_is_native_w32" = "xyes"; then
242748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test "x$ac_cv_use_ms_lib_tool" = "xyes" || test -n "$DLLTOOL"; then
243748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    w32_shared_lib_exp=yes
244748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  else
245748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_MSG_WARN([[GNU dlltool or MS lib.exe is required for creating shared library export on W32]])
246748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_MSG_WARN([[Export library libmicrohttpd.lib will not be created]])
247748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
248748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
249748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL(W32_SHARED_LIB_EXP, [test "x$w32_shared_lib_exp" = "xyes"])
250748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL(USE_MS_LIB_TOOL, [test "x$ac_cv_use_ms_lib_tool" = "xyes"])
251748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
252748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# set GCC options
253748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# use '-fno-strict-aliasing', but only if the compiler
254748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# and linker can take it
255748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAX_CHECK_LINK_FLAG([-fno-strict-aliasing],
256748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing])])
257748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
258748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_C_BIGENDIAN
259748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
260748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_PROG([HAVE_CURL_BINARY],[curl],[yes],[no])
261748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_CURL_BINARY],[test "x$HAVE_CURL_BINARY" = "xyes"])
262748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_PROG([HAVE_MAKEINFO_BINARY],[makeinfo],[yes],[no])
263748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_MAKEINFO_BINARY],[test "x$HAVE_MAKEINFO_BINARY" = "xyes"])
264748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL(W32_STATIC_LIB, [test "x$os_is_native_w32" = "xyes"  && test "x$enable_static" = "xyes"])
265748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
266748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
267748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([[doc]],
268748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [AS_HELP_STRING([[--disable-doc]], [do not build any documentation])], ,
269748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [enable_doc=yes])
270748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erattest "x$enable_doc" = "xno" || enable_doc=yes
271748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([BUILD_DOC], [test "x$enable_doc" = "xyes"])
272748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
273748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([[examples]],
274748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [AS_HELP_STRING([[--disable-examples]], [do not build any examples])], ,
275748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [enable_examples=yes])
276748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erattest "x$enable_examples" = "xno" || enable_examples=yes
277748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([BUILD_EXAMPLES], [test "x$enable_examples" = "xyes"])
278748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
279748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([[poll]],
280748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [AS_HELP_STRING([[--enable-poll[=ARG]]], [enable poll support (yes, no, auto) [auto]])],
281748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [enable_poll=${enableval}],
282748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [enable_poll='auto']
283748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  )
284748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
285748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "$enable_poll" != "no"; then
286748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test "$os_is_native_w32" != "yes"; then
287748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_CHECK_HEADERS([poll.h],
288748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      [
289748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AC_CHECK_FUNCS([poll], [have_poll='yes'], [have_poll='no'])
290748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      ])
291748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  else
292748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_MSG_CHECKING([for WSAPoll()])
293748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_LINK_IFELSE([
294748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      AC_LANG_PROGRAM([[#include <winsock2.h>]], [[
295748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratWSAPOLLFD fda[2];
296748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratWSAPoll(fda, 2, 0);]])],
297748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        [
298748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          have_poll='yes'
299748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          AC_DEFINE([HAVE_POLL],[1])
300748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        ], [have_poll='no'])
301748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_MSG_RESULT([$have_poll])
302748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
303748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test "$enable_poll" = "yes" && test "$have_poll" != "yes"; then
304748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_MSG_ERROR([[Support for poll was explicitly requested but cannot be enabled on this platform.]])
305748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
306748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  enable_poll="$have_poll"
307748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
308748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
309748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([[epoll]],
310748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [AS_HELP_STRING([[--enable-epoll[=ARG]]], [enable epoll support (yes, no, auto) [auto]])],
311748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [enable_epoll=${enableval}],
312748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [enable_epoll='auto']
313748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  )
314748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
315748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "$enable_epoll" != "no"; then
316748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AX_HAVE_EPOLL
317748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test "${ax_cv_have_epoll}" = "yes"; then
318748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_DEFINE([EPOLL_SUPPORT],[1],[define to 1 to enable epoll support])
319748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    enable_epoll='yes'
320748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  else
321748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_DEFINE([EPOLL_SUPPORT],[0],[define to 0 to disable epoll support])
322748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    if test "$enable_epoll" = "yes"; then
323748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      AC_MSG_ERROR([[Support for epoll was explicitly requested but cannot be enabled on this platform.]])
324748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    fi
325748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    enable_epoll='no'
326748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
327748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
328748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
329748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_epoll" = "xyes"; then
330748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_CACHE_CHECK([for epoll_create1()], [mhd_cv_have_epoll_create1], [
331748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_LINK_IFELSE([
332748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      AC_LANG_PROGRAM([[#include <sys/epoll.h>]], [[
333748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratint fd;
334748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfd = epoll_create1(EPOLL_CLOEXEC);]])],
335748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      [mhd_cv_have_epoll_create1=yes],
336748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      [mhd_cv_have_epoll_create1=no])])
337748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AS_IF([test "x$mhd_cv_have_epoll_create1" = "xyes"],[
338748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_DEFINE([[HAVE_EPOLL_CREATE1]], [[1]], [Define if you have epoll_create1 function.])])
339748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
340748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
341748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$HAVE_POSIX_THREADS" = "xyes"; then
342748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  # Check for pthread_setname_np()
343748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  SAVE_LIBS="$LIBS"
344748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  SAVE_CFLAGS="$CFLAGS"
345748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  LIBS="$PTHREAD_LIBS $LIBS"
346748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
347748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_MSG_CHECKING([[for pthread_setname_np]])
348748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_LINK_IFELSE(
349748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [AC_LANG_PROGRAM([[#include <pthread.h>]], [[  pthread_setname_np(pthread_self(), "name")]])],
350748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [AC_DEFINE([[HAVE_PTHREAD_SETNAME_NP]], [[1]], [Define if you have pthread_setname_np function.])
351748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     AC_MSG_RESULT([[yes]])],
352748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [AC_MSG_RESULT([[no]])] )
353748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  LIBS="$SAVE_LIBS"
354748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  CFLAGS="$SAVE_CFLAGS"
355748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
356748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
357748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Check for headers that are ALWAYS required
358748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_HEADERS([fcntl.h math.h errno.h limits.h stdio.h locale.h sys/stat.h sys/types.h pthread.h],,AC_MSG_ERROR([Compiling libmicrohttpd requires standard UNIX headers files]))
359748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
360748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Check for optional headers
361748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_HEADERS([sys/types.h sys/time.h sys/msg.h netdb.h netinet/in.h netinet/tcp.h time.h sys/socket.h sys/mman.h arpa/inet.h sys/select.h search.h])
362748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_TSEARCH], [test "x$ac_cv_header_search_h" = "xyes"])
363748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
364748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_MEMBER([struct sockaddr_in.sin_len],
365748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [ AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN, 1, [Do we have sockaddr_in.sin_len?])
366748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   ],
367748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [],
368748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [
369748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    #ifdef HAVE_SYS_TYPES_H
370748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      #include <sys/types.h>
371748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    #endif
372748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    #ifdef HAVE_SYS_SOCKET_H
373748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      #include <sys/socket.h>
374748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    #endif
375748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    #ifdef HAVE_NETINET_IN_H
376748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      #include <netinet/in.h>
377748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    #endif
378748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   ])
379748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
380748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
381748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Check for pipe/socketpair signaling
382748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING([[whether to enable signaling by socketpair]])
383748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
384748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([[socketpair]],
385748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat	[AS_HELP_STRING([[--enable-socketpair[=ARG]]], [disable internal singalling by pipes and use socket pair instead (yes, no, try) [no]])], ,
386748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat	[AS_IF([[test "x$os_is_windows" = "xyes"]], [enable_socketpair=yes], [enable_socketpair=no])]
387748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  )
388748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
389748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAS_IF(
390748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       [[test "x$enable_socketpair" != "xno"]],
391748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat         [AS_IF([[test "x$os_is_windows" = "xyes"]],
392748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           [ AC_MSG_RESULT([[yes, forced on W32]]) ],
393748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           [ AC_LINK_IFELSE(
394748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat             [ AC_LANG_PROGRAM([[
395748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				#ifdef HAVE_SYS_TYPES_H
396748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				#include <sys/types.h>
397748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				#endif
398748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				#ifdef HAVE_SYS_SOCKET_H
399748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				#include <sys/socket.h>
400748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				#endif
401748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				]],[[
402748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				  int sv[2];
403748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				  if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv) != 0) return 1
404748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				]])
405748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat             ],
406748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat             [ AC_MSG_RESULT([[yes, socketpair in available]]) ],
407748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat             [ AC_MSG_RESULT([[no, socketpair in not available]])
408748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat              AS_IF([[test "x$enable_socketpair" = "xyes"]], [ AC_MSG_ERROR([[socketpair signalling cannot be enabled.]]) ])
409748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat             ]
410748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat             )
411748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           ]
412748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          )
413748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat         ],
414748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       [
415748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AC_MSG_RESULT([[no]])
416748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AS_IF([[test "x$os_is_windows" = "xyes"]], [ AC_MSG_ERROR([[socketpair must be enabled on W32]]) ])
417748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       ]
418748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat     )
419748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_socketpair" = "xyes"; then
420748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat	AC_DEFINE([[MHD_DONT_USE_PIPES]], [[1]], [Define to use pair of sockets instead of pipes for signaling])
421748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
422748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
423748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_FUNCS_ONCE([memmem accept4])
424748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING([[for gmtime_s]])
425748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_LINK_IFELSE(
426748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [AC_LANG_PROGRAM(
427748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [[ #include <time.h>]], [[struct tm now; time_t t; time (&t); gmtime_s (&now, &t)]])
428748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  ],
429748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [
430748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_DEFINE([HAVE_GMTIME_S], [1], [Define to 1 if you have `gmtime_s' function (only for W32).])
431748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_MSG_RESULT([[yes]])
432748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  ],
433748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [AC_MSG_RESULT([[no]])
434748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  ])
435748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
436748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
437748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_DECLS([SOCK_NONBLOCK], [AC_DEFINE([HAVE_SOCK_NONBLOCK], [1], [SOCK_NONBLOCK is defined in a socket header])], [],
438748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                   [
439748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    #if defined HAVE_SYS_TYPES_H
440748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    #  include <sys/types.h>
441748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    #endif
442748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    #if defined HAVE_SYS_SOCKET_H
443748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    #  include <sys/socket.h>
444748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    #elif defined HAVE_WINSOCK2_H
445748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    #  include <winsock2.h>
446748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    #endif
447748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                   ])
448748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
449748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
450748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SEARCH_LIBS([clock_gettime], [rt], [
451748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat				AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Have clock_gettime])
452748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat])
453748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
454748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# IPv6
455748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING(for IPv6)
456748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
457748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#include <stdio.h>
458748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#if HAVE_NETINET_IN_H
459748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#include <netinet/in.h>
460748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#endif
461748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#if HAVE_SYS_SOCKET_H
462748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#include <sys/socket.h>
463748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#endif
464748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#if HAVE_WINSOCK2_H
465748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#include <winsock2.h>
466748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#endif
467748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#if HAVE_WS2TCPIP_H
468748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#include <ws2tcpip.h>
469748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat#endif
470748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat]], [[
471748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratint af=AF_INET6;
472748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratint pf=PF_INET6;
473748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratstruct sockaddr_in6 sa;
474748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratprintf("%d %d %p\n", af, pf, &sa);
475748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat]])],[
476748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erathave_inet6=yes;
477748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_DEFINE([HAVE_INET6], [1], [Provides IPv6 headers])
478748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat],[
479748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erathave_inet6=no
480748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat])
481748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_RESULT($have_inet6)
482748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
483748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# TCP_CORK and TCP_NOPUSH
484748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_DECLS([TCP_CORK, TCP_NOPUSH], [], [], [[#include <netinet/tcp.h>]])
485748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
486748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratHIDDEN_VISIBILITY_CFLAGS=""
487748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratcase "$host" in
488748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  *-*-mingw*)
489748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
490748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_DEFINE([_MHD_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
491748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat              [defines how to decorate public symbols while building])
492748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
493748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    ;;
494748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  *)
495748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    dnl on other compilers, check if we can do -fvisibility=hidden
496748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AX_CHECK_LINK_FLAG([-fvisibility=hidden],
497748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      [AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
498748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                           [AC_DEFINE([_MHD_EXTERN], [__attribute__((visibility("default"))) extern],
499748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                                       [defines how to decorate public symbols while building])
500748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                            HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"])])
501748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    ;;
502748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratesac
503748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(HIDDEN_VISIBILITY_CFLAGS)
504748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
505748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# libcurl (required for testing)
506748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([curl],
507748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [AS_HELP_STRING([--disable-curl],[disable cURL based testcases])],
508748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [enable_curl=${enableval}])
509748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratcurl=0
510748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "$enable_curl" != "no"
511748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
512748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  LIBCURL_CHECK_CONFIG([yes],[7.16.4],[enable_curl=yes],
513748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    [
514748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      if test "x$enable_curl" = "xyes"; then
515748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AC_MSG_WARN([[cURL-based tests cannot be enabled because libcurl is missing]])
516748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      fi
517748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      enable_curl=no
518748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    ])
519748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
520748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "$enable_curl" != "no"
521748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
522748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Lib cURL & cURL - OpenSSL versions
523748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_DEFINE([MHD_REQ_CURL_VERSION], ["7.16.4"], [required cURL version to run tests])
524748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_DEFINE([MHD_REQ_CURL_OPENSSL_VERSION], ["0.9.8"], [required cURL SSL version to run tests])
525748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_DEFINE([MHD_REQ_CURL_GNUTLS_VERSION], ["2.8.6"], [gnuTLS lib version - used in conjunction with cURL])
526748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_DEFINE([MHD_REQ_CURL_NSS_VERSION], ["3.12.0"], [NSS lib version - used in conjunction with cURL])
527748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
528748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_CURL], [test "x$enable_curl" = "xyes"])
529748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
530748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_LIB([[magic]], [[magic_open]],
531748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [AC_CHECK_HEADERS([magic.h],
532748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   AM_CONDITIONAL(HAVE_MAGIC, true),
533748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   AM_CONDITIONAL(HAVE_MAGIC, false))],
534748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AM_CONDITIONAL(HAVE_MAGIC, false))
535748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
536748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
537748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# optional: libmicrospdy support. Enabled by default if not on W32
538748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([spdy],
539748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat		AS_HELP_STRING([--enable-spdy],
540748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat			[enable build libmicrospdy (yes, no, auto) [auto]]),
541748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat		[enable_spdy=${enableval}],
542748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat		[ AS_IF([[test "x$os_is_windows" = "xyes"]], [enable_spdy=no]) ])
543748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
544748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "$enable_spdy" != "no"
545748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
546748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AX_CHECK_OPENSSL([ have_openssl=yes ],[ have_openssl=no ])
547748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test "x$have_openssl" = "xyes"
548748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  then
549748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    # check OpenSSL headers
550748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    SAVE_CPP_FLAGS="$CPPFLAGS"
551748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
552748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AC_CHECK_HEADERS([openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h openssl/engine.h], [ have_openssl=yes ],[ have_openssl=no ])
553748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    if test "x$have_openssl" = "xyes"
554748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    then
555748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      # check OpenSSL libs
556748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      SAVE_LIBS="$LIBS"
557748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      SAVE_LD_FLAGS="$LDFLAGS"
558748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
559748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      LIBS="$OPENSSL_LIBS $LIBS"
560748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      AC_CHECK_FUNC([SSL_CTX_set_next_protos_advertised_cb],
561748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        [
562748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          AC_CHECK_FUNC([SSL_library_init], [ have_openssl=yes ],[ have_openssl=no ])
563748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        ],[ have_openssl=no ])
564748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      LIBS="$SAVE_LIBS"
565748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      LDFLAGS="$SAVE_LD_FLAGS"
566748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    fi
567748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    CPPFLAGS="$SAVE_CPP_FLAGS"
568748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
569748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  if test "x$have_openssl" = "xyes"
570748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  then
571748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    enable_spdy=yes
572748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  else
573748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    AS_IF([[test "x$enable_spdy" = "xyes" ]], [AC_MSG_ERROR([[libmicrospdy cannot be enabled without OpenSSL.]])])
574748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    have_openssl=no
575748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    enable_spdy=no
576748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  fi
577748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelse
578748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  # OpenSSL is used only for libmicrospdy
579748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  have_openssl=no
580748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
581748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_OPENSSL], [test "x$have_openssl" = "xyes"])
582748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
583748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "$enable_spdy" = "yes"
584748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
585748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_DEFINE([SPDY_SUPPORT],[1],[include libmicrospdy support])
586748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelse
587748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_DEFINE([SPDY_SUPPORT],[0],[disable libmicrospdy support])
588748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
589748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL(ENABLE_SPDY, [test "x$enable_spdy" != "xno"])
590748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING(whether we have OpenSSL and thus can support libmicrospdy)
591748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_RESULT($enable_spdy)
592748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
593748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# for pkg-config
594748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratSPDY_LIBDEPS="$OPENSSL_LIBS"
595748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
596748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratSPDY_LIB_LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
597748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratSPDY_LIB_CFLAGS="$CFLAGS"
598748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratSPDY_LIB_CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
599748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(SPDY_LIB_LDFLAGS)
600748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(SPDY_LIB_CFLAGS)
601748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(SPDY_LIB_CPPFLAGS)
602748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# for pkg-config
603748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(SPDY_LIBDEPS)
604748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
605748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_HEADERS([spdylay/spdylay.h], [ have_spdylay="yes" ], [have_spdylay="no"])
606748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL(HAVE_SPDYLAY, [test "x$have_spdylay" = "xyes"])
607748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
608748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# large file support (> 4 GB)
609748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SYS_LARGEFILE
610748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_FUNC_FSEEKO
611748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
612748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# optional: have error messages ?
613748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING(whether to generate error messages)
614748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([messages],
615748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [AS_HELP_STRING([--disable-messages],
616748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat               [disable MHD error messages])],
617748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [enable_messages=${enableval}],
618748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [enable_messages=yes])
619748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_RESULT($enable_messages)
620748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "$enable_messages" = "yes"
621748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
622748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_DEFINE([HAVE_MESSAGES],[1],[Include error messages])
623748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelse
624748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_DEFINE([HAVE_MESSAGES],[0],[Disable error messages])
625748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
626748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
627748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
628748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# optional: have postprocessor?
629748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING(whether to enable postprocessor)
630748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([postprocessor],
631748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [AS_HELP_STRING([--disable-postprocessor],
632748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat               [disable MHD PostProcessor functionality])],
633748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [enable_postprocessor=${enableval}],
634748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [enable_postprocessor=yes])
635748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erattest "x$enable_postprocessor" = "xno" || enable_postprocessor=yes
636748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_RESULT([[$enable_postprocessor]])
637748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_POSTPROCESSOR],test "x$enable_postprocessor" != "xno")
638748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_postprocessor" != "xno"
639748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
640748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_DEFINE([HAVE_POSTPROCESSOR],[1],[define to 1 if MHD was build with postprocessor.c])
641748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
642748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
643748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
644748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# optional: have zzuf, socat?
645748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_PROG([have_zzuf],[zzuf], [yes], [no])
646748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CHECK_PROG([have_socat],[socat], [yes], [no])
647748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_ZZUF], [test "x$have_zzuf" = "xyes"])
648748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_SOCAT], [test "x$have_socat" = "xyes"])
649748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
650748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
651748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# libgcrypt linkage: required for HTTPS support
652748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_PATH_LIBGCRYPT([1.2.2], [have_gcrypt=yes], [have_gcrypt=no])
653748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$have_gcrypt" = "xyes"
654748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
655748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  SAVE_CFLAGS="$CFLAGS"
656748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
657748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  # LIBGCRYPT_CFLAGS can be actually a CPPFLAGS, so check them both
658748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  SAVE_CPPFLAGS="$CPPFLAGS"
659748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  CPPFLAGS="$CPPFLAGS $LIBGCRYPT_CFLAGS"
660748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_CHECK_HEADERS([gcrypt.h], [], [have_gcrypt=no])
661748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  CFLAGS="$SAVE_CFLAGS"
662748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  CPPFLAGS="$SAVE_CPPFLAGS"
663748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
664748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
665748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# gnutls
666748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratGNUTLS_CPPFLAGS=""
667748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratGNUTLS_LDFLAGS=""
668748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erathave_gnutls=no
669748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erathave_gnutls_sni=no
670748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erathave_gnutls_pkgcfg=no
671748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING([[how to find GnuTLS library]])
672748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_WITH([[gnutls]],
673748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [AC_HELP_STRING([[--with-gnutls[=PFX]]],[use GnuTLS for HTTPS support, optional PFX overrides pkg-config data for GnuTLS headers (PFX/include) and libs (PFX/lib)])],
674748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [
675748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    case $with_gnutls in
676748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      no)
677748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AC_MSG_RESULT([[GnuTLS disabled]])
678748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        ;;
679748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      yes)
680748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AC_MSG_RESULT([[automatically, forced]])
681748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        ;;
682748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      *)
683748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AC_MSG_RESULT([[-I$with_gnutls/include -L$with_gnutls/lib -lgnutls]])
684748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        SAVE_LDFLAGS="$LDFLAGS"
685748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        SAVE_CPPFLAGS="$CPPFLAGS"
686748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        LDFLAGS="-L$with_gnutls/lib $LDFLAGS"
687748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        CPPFLAGS="-I$with_gnutls/include $CPPFLAGS"
688748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        have_gnutls_pkgcfg=no
689748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          AC_CHECK_HEADERS([gnutls/gnutls.h],
690748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat            [AC_CHECK_LIB([gnutls], [gnutls_priority_set],
691748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat              [
692748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                GNUTLS_CPPFLAGS="-I$with_gnutls/include"
693748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                GNUTLS_LDFLAGS="-L$with_gnutls/lib"
694748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                GNUTLS_LIBS="-lgnutls"
695748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                AC_CHECK_LIB([gnutls], [gnutls_load_file], [AC_CHECK_LIB([gnutls], [gnutls_privkey_import_x509_raw], [have_gnutls_sni=yes])])
696748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                have_gnutls=yes
697748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat              ])])
698748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        AS_IF([test "x$have_gnutls" != "xyes"], [AC_MSG_ERROR([can't find usable libgnutls at specified prefix $with_gnutls])])
699748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        LDFLAGS="$SAVE_LDFLAGS"
700748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        CPPFLAGS="$SAVE_CPPFLAGS"
701748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        ;;
702748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    esac
703748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   ],
704748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [AC_MSG_RESULT([[automatically]])
705748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   ])
706748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
707748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAS_IF([test "x$with_gnutls" != "xno" && test "x$have_gnutls" != "xyes"],
708748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  [
709748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat    PKG_CHECK_MODULES(GNUTLS, [[gnutls]],
710748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      [
711748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       have_gnutls_pkgcfg='yes'
712748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       SAVE_CPPFLAGS="$CPPFLAGS"
713748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       SAVE_CFLAGS="$CFLAGS"
714748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       SAVE_LDFLAGS="$LDFLAGS"
715748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       SAVE_LIBS="$LIBS"
716748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       CPPFLAGS="$GNUTLS_CFLAGS $CPPFLAGS"
717748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       CFLAGS="$GNUTLS_CFLAGS $CFLAGS"
718748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       LDFLAGS="$GNUTLS_LIBS $LDFLAGS"
719748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       LIBS="$LIBS $GNUTLS_LIBS"
720748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       AC_MSG_CHECKING([[whether GnuTLS is usable]])
721748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       AC_LINK_IFELSE([
722748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat         AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]], [[
723748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                gnutls_session_t session;
724748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                gnutls_priority_t priorities;
725748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                gnutls_global_init();
726748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                gnutls_priority_init(&priorities, "NORMAL", NULL);
727748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                gnutls_init(&session, GNUTLS_SERVER);
728748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                gnutls_priority_set(session, priorities);
729748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          ]])],
730748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          [
731748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           AC_MSG_RESULT([[yes]])
732748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           have_gnutls=yes
733748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           GNUTLS_CPPLAGS="$GNUTLS_CFLAGS"
734748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           GNUTLS_LDFLAGS="$GNUTLS_LIBS"
735748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           AC_MSG_CHECKING([[for gnutls_privkey_import_x509_raw()]])
736748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           AC_LINK_IFELSE([
737748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat             AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]], [[
738748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    gnutls_datum_t data;
739748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    gnutls_privkey_t key;
740748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    gnutls_load_file("key.pem", &data);
741748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    gnutls_privkey_import_x509_raw(key, &data, GNUTLS_X509_FMT_PEM, NULL, 0);
742748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                    gnutls_free(data.data);
743748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                  ]])], [[have_gnutls_sni=yes]], [[have_gnutls_sni=no]])
744748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           AC_MSG_RESULT([[$have_gnutls_sni]])
745748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          ],
746748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          [
747748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           AC_MSG_RESULT([[no]])
748748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat           have_gnutls=no
749748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          ])
750748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
751748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       AS_IF([test "x$have_gnutls" != "xyes"], [AC_MSG_WARN([pkg-config reports that GnuTLS is present, but GnuTLS can't be used])])
752748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       CPPFLAGS="$SAVE_CPPFLAGS"
753748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       CFLAGS="$SAVE_CFLAGS"
754748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       LDFLAGS="$SAVE_LDFLAGS"
755748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       LIBS="$SAVE_LIBS"
756748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      ],
757748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      [
758748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       have_gnutls_pkgcfg='no'
759748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat       AC_CHECK_HEADERS([gnutls/gnutls.h],
760748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        [AC_CHECK_LIB([gnutls], [gnutls_priority_set],
761748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          [
762748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat            GNUTLS_LIBS="-lgnutls"
763748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat            AC_CHECK_LIB([gnutls], [gnutls_load_file], [AC_CHECK_LIB([gnutls], [gnutls_privkey_import_x509_raw], [have_gnutls_sni=yes])])
764748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat            have_gnutls=yes
765748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          ])])
766748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat      ])
767748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  ])
768748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
769748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAS_IF([test "x$have_gnutls" != "xyes" && test "x$with_gnutls" = "xyes"], [AC_MSG_ERROR([[can't find usable libgnutls]])])
770748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
771748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL(HAVE_GNUTLS, test "x$have_gnutls" = "xyes")
772748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([HAVE_GNUTLS_SNI], [test "x$have_gnutls_sni" = "xyes"])
773748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
774748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([GNUTLS_CPPFLAGS])
775748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([GNUTLS_CFLAGS])
776748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([GNUTLS_LDFLAGS])
777748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([GNUTLS_LIBS])
778748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
779748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# optional: HTTPS support.  Enabled by default
780748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING(whether to support HTTPS)
781748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([https],
782748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [AS_HELP_STRING([--enable-https],
783748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat               [enable HTTPS support (yes, no, auto)[auto]])],
784748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   [enable_https=${enableval}])
785748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_https" != "xno"
786748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
787748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AS_IF([test "x$have_gnutls" = "xyes" && test "x$have_gcrypt" = "xyes"], [
788748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          AC_DEFINE([HTTPS_SUPPORT],[1],[include HTTPS support])
789748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          MHD_LIB_CPPFLAGS="$MHD_LIB_CPPFLAGS $LIBGCRYPT_CFLAGS $GNUTLS_CPPFLAGS"
790748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $LIBGCRYPT_CFLAGS $GNUTLS_CFLAGS"
791748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          MHD_LIB_LDFLAGS="$MHD_LIB_LDFLAGS $GNUTLS_LDFLAGS"
792748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          MHD_LIBDEPS="$GNUTLS_LIBS $LIBGCRYPT_LIBS $MHD_LIBDEPS"
793748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          enable_https=yes
794748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          MSG_HTTPS="yes (using libgnutls and libgcrypt)"
795748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        ], [
796748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          AS_IF([test "x$have_gnutls" = "xyes"], [crypt_missing="libgrypt"],
797748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                [test "x$have_gcrypt" = "xyes"], [crypt_missing="libgnutls"],
798748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                                                 [crypt_missing="libgrypt and libgnutls"])
799748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          AS_IF([[test "x$enable_https" = "xyes" ]], [AC_MSG_ERROR([[HTTPS support cannot be enabled without $crypt_missing.]])])
800748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          AC_DEFINE([HTTPS_SUPPORT],[0],[no libgcrypt or libgnutls])
801748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          enable_https=no
802748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat          MSG_HTTPS="no (lacking $crypt_missing)"
803748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        ])
804748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelse
805748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  AC_DEFINE([HTTPS_SUPPORT],[0],[disable HTTPS support])
806748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  MSG_HTTPS="no (disabled)"
807748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
808748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_RESULT([$MSG_HTTPS])
809748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
810748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([ENABLE_HTTPS], [test "x$enable_https" = "xyes"])
811748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
812748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# optional: HTTP Basic Auth support. Enabled by default
813748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING(whether to support HTTP basic authentication)
814748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([bauth],
815748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat		AS_HELP_STRING([--disable-bauth],
816748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat			[disable HTTP basic Auth support]),
817748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat		[enable_bauth=${enableval}],
818748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat		[enable_bauth=yes])
819748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_bauth" != "xno"
820748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
821748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat enable_bauth=yes
822748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_DEFINE([BAUTH_SUPPORT],[1],[include basic Auth support])
823748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelse
824748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_DEFINE([BAUTH_SUPPORT],[0],[disable basic Auth support])
825748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
826748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_RESULT($enable_bauth)
827748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL(ENABLE_BAUTH, [test "x$enable_bauth" != "xno"])
828748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
829748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# optional: HTTP Digest Auth support. Enabled by default
830748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING(whether to support HTTP digest authentication)
831748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([dauth],
832748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat		AS_HELP_STRING([--disable-dauth],
833748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat			[disable HTTP basic and digest Auth support]),
834748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat		[enable_dauth=${enableval}],
835748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat		[enable_dauth=yes])
836748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_dauth" != "xno"
837748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
838748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat enable_dauth=yes
839748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_DEFINE([DAUTH_SUPPORT],[1],[include digest Auth support])
840748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelse
841748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_DEFINE([DAUTH_SUPPORT],[0],[disable digest Auth support])
842748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
843748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_RESULT($enable_dauth)
844748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL(ENABLE_DAUTH, [test "x$enable_dauth" != "xno"])
845748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
846748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
847748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
848748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratMHD_LIB_LDFLAGS="$MHD_LIB_LDFLAGS -export-dynamic -no-undefined"
849748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
850748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# gcov compilation
851748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_CHECKING(whether to compile with support for code coverage analysis)
852748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_ARG_ENABLE([coverage],
853748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat              AS_HELP_STRING([--enable-coverage],
854748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat                             [compile the library with code coverage support]),
855748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat              [use_gcov=${enableval}],
856748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat              [use_gcov=no])
857748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_RESULT($use_gcov)
858748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
859748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
860748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAX_COUNT_CPUS
861748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([CPU_COUNT])
862748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
863748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(MHD_LIB_CPPFLAGS)
864748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(MHD_LIB_CFLAGS)
865748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(MHD_LIB_LDFLAGS)
866748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
867748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# for pkg-config
868748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAS_IF([[test "x$enable_https" = "xyes" && test "x$have_gnutls_pkgcfg" = "xyes" ]],
869748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat [ # remove GnuTLS from private libs in .pc file as it defined in Requires.private
870748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   MHD_REQ_PRIVATE='gnutls'
871748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   MHD_LIBDEPS_PKGCFG="${MHD_LIBDEPS//$GNUTLS_LIBS/}"
872748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat ],
873748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat [
874748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   MHD_REQ_PRIVATE=''
875748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat   MHD_LIBDEPS_PKGCFG="$MHD_LIBDEPS"
876748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat ])
877748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([MHD_REQ_PRIVATE])
878748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST([MHD_LIBDEPS_PKGCFG])
879748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(MHD_LIBDEPS)
880748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
881748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(CPPFLAGS)
882748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(LIBS)
883748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_SUBST(LDFLAGS)
884748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
885748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_CONFIG_FILES([
886748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratlibmicrohttpd.pc
887748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratlibmicrospdy.pc
888748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratw32/VS2013/microhttpd_dll_res_vc.rc
889748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratMakefile
890748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratcontrib/Makefile
891748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratdoc/Makefile
892748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratdoc/doxygen/Makefile
893748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratdoc/examples/Makefile
894748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratm4/Makefile
895748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/Makefile
896748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/include/Makefile
897748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/platform/Makefile
898748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/microhttpd/Makefile
899748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/microspdy/Makefile
900748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/spdy2http/Makefile
901748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/examples/Makefile
902748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/testcurl/Makefile
903748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/testcurl/https/Makefile
904748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/testspdy/Makefile
905748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratsrc/testzzuf/Makefile])
906748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_OUTPUT
907748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
908748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat# Finally: summary
909748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_curl" != "xyes"; then
910748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat MSG_CURL="no, many unit tests will not run"
911748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelse
912748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat MSG_CURL="yes"
913748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
914748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
915748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel EratAC_MSG_NOTICE([Configuration Summary:
916748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  Operating System:  ${host_os}
917748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  Threading lib:     ${USE_THREADS}
918748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  libcurl (testing): ${MSG_CURL}
919748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  Target directory:  ${prefix}
920748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  Messages:          ${enable_messages}
921748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  Basic auth.:       ${enable_bauth}
922748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  Digest auth.:      ${enable_dauth}
923748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  Postproc:          ${enable_postprocessor}
924748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  HTTPS support:     ${MSG_HTTPS}
925748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  poll support:      ${enable_poll=no}
926748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  epoll support:     ${enable_epoll=no}
927748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  build docs:        ${enable_doc}
928748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  build examples:    ${enable_examples}
929748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  libmicrospdy:      ${enable_spdy}
930748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  spdylay (testing): ${have_spdylay}
931748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat])
932748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
933748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_https" = "xyes"
934748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
935748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_MSG_NOTICE([HTTPS subsystem configuration:
936748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  License         :  LGPL only
937748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat ])
938748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratelse
939748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_MSG_NOTICE([
940748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat  License         :  LGPL or eCos
941748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat])
942748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
943748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat
944748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratif test "x$enable_bauth" != "xyes" -o \
945748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        "x$enable_dauth" != "xyes" -o \
946748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat        "x$enable_postprocessor" != "xyes"
947748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratthen
948748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Erat AC_MSG_NOTICE([WARNING: This will be a custom build with missing symbols. Do NOT use this build in a distribution. Building with these kinds of configure options is only for custom builds for embedded systems.])
949748945ec6f1c67b7efc934ab0808e1d32f2fb98dDaniel Eratfi
950