1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(middleman, 1.0, jasonmc@sympatico.ca)
3 AC_CONFIG_SRCDIR([src/mem.c])
4 AC_CONFIG_HEADER(config.h)
8 # Deal with compile-time options
9 AC_ARG_ENABLE(syslog, AC_HELP_STRING([--enable-syslog], [use syslog for logging]), [CFLAGS="$CFLAGS -DUSE_SYSLOG"])
10 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [compile with debugging symbols]), [[CFLAGS="$CFLAGS] -g" AC_CHECK_LIB(efence, malloc) [STRIP="touch"]], [STRIP="strip"])
12 # Checks for programs.
16 AC_CHECK_LIB(z, gzopen,,)
17 AC_CHECK_FUNCS(gzopen,,,)
19 # Checks for header files.
22 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h sys/socket.h sys/time.h], , [echo "Some header files required to build this program are not present"; exit])
23 AC_CHECK_HEADERS([zlib.h],,)
25 # Checks for typedefs, structures, and compiler characteristics.
29 # Check for proper networking libraries
30 AC_CHECK_FUNCS(gethostbyname_r, ,
31 AC_CHECK_LIB(nsl, gethostbyname_r, ,
32 AC_CHECK_LIB(resolv, gethostbyname_r)))
33 AC_CHECK_FUNCS(inet_aton, ,
34 AC_CHECK_LIB(resolv, inet_aton))
35 AC_CHECK_FUNCS(socket, ,
36 AC_CHECK_LIB(socket, socket))
38 # Checks for library functions.
39 AC_CHECK_FUNCS([vsnprintf strncasecmp poll setenv clearenv])
42 AC_CHECK_FUNCS([bcopy memmove strerror])
45 AC_CHECK_FUNCS([memset strchr strdup])
48 AC_CONFIG_SUBDIRS([pcre libntlm])