2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([spawn-fcgi],[1.6.3])
6 AC_CONFIG_SRCDIR([src/spawn-fcgi.c])
7 AC_CONFIG_HEADER([config.h])
9 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
11 # Checks for programs.
15 # Checks for libraries.
17 # Checks for header files.
20 AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h getopt.h grp.h netdb.h \
21 netinet/in.h netinet/tcp.h pwd.h stdio.h stdlib.h \
22 string.h sys/ioctl.h sys/socket.h sys/stat.h sys/time.h \
23 sys/types.h sys/un.h sys/wait.h unistd.h])
26 # Checks for typedefs, structures, and compiler characteristics.
31 AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
32 #include <sys/socket.h>])
34 ## solaris needs -lsocket -lnsl
35 AC_SEARCH_LIBS([socket],[socket])
36 AC_SEARCH_LIBS([inet_addr],[nsl socket])
38 # Checks for library functions.
42 AC_FUNC_SELECT_ARGTYPES
44 AC_CHECK_FUNCS([dup2 memset putenv select socket strerror strtol issetugid inet_pton])
47 # Check for IPv6 support
50 AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
51 [case "${enableval}" in
54 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ipv6) ;;
57 if test x$ipv6 = xtrue; then
58 AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
59 [AC_TRY_LINK([ #include <sys/types.h>
60 #include <sys/socket.h>
61 #include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0; ],
62 [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
64 if test "$ac_cv_ipv6_support" = yes; then
65 AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
70 # check for extra compiler options (warning options)
71 if test "${GCC}" = "yes"; then
72 CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
75 AC_ARG_ENABLE(extra-warnings,
76 AC_HELP_STRING([--enable-extra-warnings],[enable extra warnings (gcc specific)]),
77 [case "${enableval}" in
78 yes) extrawarnings=true ;;
79 no) extrawarnings=false ;;
80 *) AC_MSG_ERROR(bad value ${enableval} for --enable-extra-warnings) ;;
81 esac],[extrawarnings=false])
83 if test x$extrawarnings = xtrue; then
84 CFLAGS="${CFLAGS} -g -O2 -g2 -Wall -Wmissing-declarations -Wdeclaration-after-statement -Wcast-align -Winline -Wsign-compare -Wnested-externs -Wpointer-arith -Wl,--as-needed -Wformat-security"
87 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])