1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(pwmd, 0.10, [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])
18 mmap_anonymous_shared=no
21 mmap_anonymous_shared=yes
26 mmap_anonymous_shared=yes
30 if test "$mmap_anonymous_shared" = "yes"; then
31 AC_DEFINE([MMAP_ANONYMOUS_SHARED], 1, \
32 [Define if your mmap() supports MAP_ANONYMOUS with MAP_SHARED.])
35 CFLAGS="$CFLAGS -D_GNU_SOURCE"
37 dnl Checks for programs.
43 dnl Checks for library functions.
44 AM_PATH_GLIB_2_0(,, AC_MSG_ERROR([glib2 not found]))
45 AM_PATH_LIBGCRYPT(,, AC_MSG_ERROR([libgcrypt not found]))
46 AM_PATH_XML2(,, AC_MSG_ERROR([libxml2 not found]))
47 AM_PATH_LIBASSUAN(,, AC_MSG_ERROR([libassuan not found]))
48 AM_PATH_GPG_ERROR(,, AC_MSG_ERROR([libgpg-error not found]))
50 dnl Checks for header files.
53 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h sys/time.h unistd.h \
56 dnl Checks for typedefs, structures, and compiler characteristics.
64 dnl Checks for library functions.
72 AC_FUNC_SELECT_ARGTYPES
73 AC_CHECK_FUNCS([mkdir strerror memset select socket strcasecmp strdup \
74 strncasecmp strchr setrlimit mlock mlockall ftruncate \
75 getcwd memmove munmap strrchr strtol strstr alarm])
79 #include <sys/mman.h>], [
82 void *p = mmap(NULL, 1024, PROT_READ,
83 MAP_SHARED|MAP_ANONYMOUS, 0, 0);
86 [have_mmap_anonymous=yes], [have_mmap_anonymous=no])
88 if test "$have_mmap_anonymous" = "yes"; then
89 AC_DEFINE([MMAP_ANONYMOUS], 1, \
90 [Define if your mmap() supports the MAP_ANONYMOUS flag.])
99 AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
100 [ac_cv_sys_debug=no])
101 AM_CONDITIONAL([WITH_DEBUG], [test "$ac_cv_sys_debug" = "yes"])
104 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
105 AC_DEBUG([$enableval]), AC_DEBUG)
107 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])