1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(pwmd, 1.3, [Ben Kibbey bjk@luxsci.net])
4 AC_CONFIG_AUX_DIR(build)
6 AM_INIT_AUTOMAKE([foreign])
8 AC_CONFIG_SRCDIR([src/pwmd.c])
9 AM_CONFIG_HEADER([config.h])
10 AM_GNU_GETTEXT([external])
11 AM_GNU_GETTEXT_VERSION([0.16.1])
13 CFLAGS="$CFLAGS -D_GNU_SOURCE"
15 dnl Checks for programs.
21 dnl Checks for library functions.
22 AM_PATH_GLIB_2_0(,, AC_MSG_ERROR([glib2 not found]))
23 AM_PATH_LIBGCRYPT(,, AC_MSG_ERROR([libgcrypt not found]))
24 AM_PATH_XML2(,, AC_MSG_ERROR([libxml2 not found]))
25 AM_PATH_LIBASSUAN_PTH(,, AC_MSG_ERROR([libassuan-pth not found]))
26 AM_PATH_GPG_ERROR(,, AC_MSG_ERROR([libgpg-error not found]))
27 AC_CHECK_PTH(,,,,, AC_MSG_ERROR([libpth not found]))
28 AC_CHECK_LIB(z, deflate,,
29 AC_MSG_ERROR([Version 1.2.2.1 or later of zlib is required]))
37 if (ZLIB_VERNUM < 0x1221)
42 AC_MSG_ERROR([Version 1.2.2.1 or later of zlib is required]))
44 dnl Checks for header files.
47 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h sys/time.h unistd.h \
50 dnl Checks for typedefs, structures, and compiler characteristics.
58 dnl Checks for library functions.
66 AC_FUNC_SELECT_ARGTYPES
67 AC_CHECK_FUNCS([mkdir strerror memset select socket strcasecmp strdup \
68 strncasecmp strchr setrlimit mlock mlockall ftruncate \
69 getcwd memmove munmap strrchr strtol strstr alarm])
73 #include <sys/mman.h>], [
76 void *p = mmap(NULL, 1024, PROT_READ,
77 MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
80 [have_mmap_anonymous=yes], [have_mmap_anonymous=no])
82 if test "$have_mmap_anonymous" = "yes"; then
83 AC_DEFINE([MMAP_ANONYMOUS], 1, \
84 [Define if your mmap() supports the MAP_ANONYMOUS flag.])
93 AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
95 AM_CONDITIONAL([WITH_DEBUG], [test "$ac_cv_sys_debug" = "yes"])
98 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
99 AC_DEBUG([$enableval]), AC_DEBUG)
101 AC_DEFUN([AC_MEM_DEBUG],
104 ac_cv_sys_mem_debug=$1
107 AC_CACHE_CHECK([if memory debugging is wanted], [ac_cv_sys_mem_debug],
108 [ac_cv_sys_mem_debug=no])
109 AM_CONDITIONAL([WITH_MEM_DEBUG], [test "$ac_cv_sys_mem_debug" = "yes"])
112 AC_ARG_ENABLE(mem_debug, AC_HELP_STRING([--enable-mem-debug], [Enable memory debugging.]),
113 AC_MEM_DEBUG([$enableval]), AC_MEM_DEBUG)
115 AC_DEFINE([DEFAULT_RECURSION_DEPTH], 20, \
116 [Default number of target recursions before returning an error.])
118 AC_DEFINE([DEFAULT_ZLIB_BUFSIZE], 4096, \
119 [Default input and output buffer chunk sizes. Affects status messages.])
121 AM_CONDITIONAL(MEM_DEBUG, test x"${ac_cv_sys_mem_debug}" != xno)
122 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in])