Version 0.9.
[pwmd.git] / configure.ac
blobd94a32198621ac4065f5ca9ccd1b5ddf55201962
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(pwmd, 0.9, [Ben Kibbey bjk@luxsci.net])
4 AC_CONFIG_AUX_DIR(build)
5 AC_CANONICAL_TARGET
6 AM_INIT_AUTOMAKE([foreign])
7 AC_PROG_MAKE_SET
8 AC_CONFIG_SRCDIR([src/pwmd.c])
9 AM_CONFIG_HEADER([config.h])
11 case "$target_os" in
12     *linux*)
13         kver=`uname -r 2>&1`
15         case "$kver" in
16             dnl Is this a bug? The [[ and ]] are needed. Shouldn't it just be
17             dnl [ and ]?
18             2.[[0-3]]* | 1.*)
19                 ;;
20             *)
21                 AC_DEFINE([MMAP_ANONYMOUS_SHARED],, \
22                           [Define if your mmap() supports MAP_ANONYMOUS with MAP_SHARED.])
23                 ;;
24         esac
25         ;;
26     *)
27         ;;
28 esac
30 CFLAGS="$CFLAGS -D_GNU_SOURCE"
32 dnl Checks for programs.
33 AC_PROG_AWK
34 AC_PROG_LN_S
35 AC_PROG_CC
36 AC_PROG_INSTALL
38 dnl Checks for library functions.
39 AM_PATH_GLIB_2_0(,, AC_MSG_ERROR([glib2 not found]))
40 AM_PATH_LIBGCRYPT(,, AC_MSG_ERROR([libgcrypt not found]))
41 AM_PATH_XML2(,, AC_MSG_ERROR([libxml2 not found]))
42 AM_PATH_LIBASSUAN(,, AC_MSG_ERROR([libassuan not found]))
43 AM_PATH_GPG_ERROR(,, AC_MSG_ERROR([libgpg-error not found]))
45 dnl Checks for header files.
46 AC_HEADER_STDC
47 AC_HEADER_SYS_WAIT
48 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h sys/time.h unistd.h \
49                   termios.h])
51 dnl Checks for typedefs, structures, and compiler characteristics.
52 AC_C_CONST
53 AC_TYPE_SSIZE_T
54 AC_HEADER_TIME
55 AC_TYPE_SIZE_T
56 AC_TYPE_SIGNAL
57 AC_STRUCT_TM
59 dnl Checks for library functions.
60 AC_FUNC_STAT
61 AC_FUNC_FORK
62 AC_FUNC_MALLOC
63 AC_FUNC_REALLOC
64 AC_FUNC_MEMCMP
65 AC_FUNC_MMAP
66 AC_FUNC_STRFTIME
67 AC_FUNC_SELECT_ARGTYPES
68 AC_CHECK_FUNCS([mkdir strerror memset select socket strcasecmp strdup \
69                 strncasecmp strchr setrlimit mlock mlockall ftruncate \
70                 getcwd memmove munmap strrchr strtol strstr alarm])
72 AC_DEFUN([AC_DEBUG],
74     if test "$1"; then
75         ac_cv_sys_debug=$1
76     fi
78     AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
79         [ac_cv_sys_debug=no])
80     AM_CONDITIONAL([WITH_DEBUG], [test "$ac_cv_sys_debug" = "yes"])
83 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
84     AC_DEBUG([$enableval]), AC_DEBUG)
86 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])
87 AC_OUTPUT