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.
15 # Checks for libraries.
16 AC_CHECK_LIB(pthread, pthread_create, LIBS="$LIBS -lpthread",
17 AC_CHECK_LIB(c_r, pthread_create, , CFLAGS="$CFLAGS -pthread"))
20 AC_CHECK_LIB(z, gzopen,,)
21 AC_CHECK_FUNCS(gzopen,,,)
23 # Checks for header files.
26 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])
27 AC_CHECK_HEADERS([zlib.h],,)
29 # Checks for typedefs, structures, and compiler characteristics.
33 # Check for proper networking libraries
34 AC_CHECK_FUNCS(gethostbyname_r, ,
35 AC_CHECK_LIB(nsl, gethostbyname_r, ,
36 AC_CHECK_LIB(resolv, gethostbyname_r)))
37 AC_CHECK_FUNCS(inet_aton, ,
38 AC_CHECK_LIB(resolv, inet_aton))
39 AC_CHECK_FUNCS(socket, ,
40 AC_CHECK_LIB(socket, socket))
42 # Checks for library functions.
43 AC_CHECK_FUNCS([vsnprintf strncasecmp poll setenv clearenv pthread_rwlock_init])
46 AC_CHECK_FUNCS([bcopy memmove strerror])
49 AC_CHECK_FUNCS([memset strchr strdup])