1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(pwmd, 1.0, [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])
20 mmap_anonymous_shared=no
23 mmap_anonymous_shared=yes
28 mmap_anonymous_shared=yes
32 if test "$mmap_anonymous_shared" = "yes"; then
33 AC_DEFINE([MMAP_ANONYMOUS_SHARED], 1, \
34 [Define if your mmap() supports MAP_ANONYMOUS with MAP_SHARED.])
37 CFLAGS="$CFLAGS -D_GNU_SOURCE"
39 dnl Checks for programs.
45 dnl Checks for library functions.
46 AM_PATH_GLIB_2_0(,, AC_MSG_ERROR([glib2 not found]))
47 AM_PATH_LIBGCRYPT(,, AC_MSG_ERROR([libgcrypt not found]))
48 AM_PATH_XML2(,, AC_MSG_ERROR([libxml2 not found]))
49 AM_PATH_LIBASSUAN(,, AC_MSG_ERROR([libassuan not found]))
50 AM_PATH_GPG_ERROR(,, AC_MSG_ERROR([libgpg-error not found]))
51 AC_CHECK_LIB(z, deflate)
53 dnl Checks for header files.
56 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h sys/time.h unistd.h \
59 dnl Checks for typedefs, structures, and compiler characteristics.
67 dnl Checks for library functions.
75 AC_FUNC_SELECT_ARGTYPES
76 AC_CHECK_FUNCS([mkdir strerror memset select socket strcasecmp strdup \
77 strncasecmp strchr setrlimit mlock mlockall ftruncate \
78 getcwd memmove munmap strrchr strtol strstr alarm])
82 #include <sys/mman.h>], [
85 void *p = mmap(NULL, 1024, PROT_READ,
86 MAP_SHARED|MAP_ANONYMOUS, 0, 0);
89 [have_mmap_anonymous=yes], [have_mmap_anonymous=no])
91 if test "$have_mmap_anonymous" = "yes"; then
92 AC_DEFINE([MMAP_ANONYMOUS], 1, \
93 [Define if your mmap() supports the MAP_ANONYMOUS flag.])
102 AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
103 [ac_cv_sys_debug=no])
104 AM_CONDITIONAL([WITH_DEBUG], [test "$ac_cv_sys_debug" = "yes"])
107 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
108 AC_DEBUG([$enableval]), AC_DEBUG)
110 AC_DEFUN([AC_MEM_DEBUG],
113 ac_cv_sys_mem_debug=$1
116 AC_CACHE_CHECK([if memory debugging is wanted], [ac_cv_sys_mem_debug],
117 [ac_cv_sys_mem_debug=no])
118 AM_CONDITIONAL([WITH_MEM_DEBUG], [test "$ac_cv_sys_mem_debug" = "yes"])
121 AC_ARG_ENABLE(mem_debug, AC_HELP_STRING([--enable-mem-debug], [Enable memory debugging.]),
122 AC_MEM_DEBUG([$enableval]), AC_MEM_DEBUG)
124 AC_DEFINE([DEFAULT_RECURSION_DEPTH], 20, \
125 [Default number of target recursions before returning an error.])
127 AC_DEFINE([DEFAULT_ZLIB_BUFSIZE], 4096, \
128 [Default input and output buffer chunk sizes. Affects status messages.])
130 AM_CONDITIONAL(MEM_DEBUG, test x"${ac_cv_sys_mem_debug}" != xno)
131 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile po/Makefile.in])