Fix for protocol command lengths > 8196.
[pwmd.git] / configure.ac
blobb2ae2eabb8a9c71f5f82c44b4b7b21a4ec52e2b7
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(pwmd, 0.4, [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])
10 AC_CONFIG_SUBDIRS([libpwmd])
12 case "$target_os" in
13     *linux*)
14         kver=`uname -r 2>&1`
16         case "$kver" in
17             dnl Is this a bug? The [[ and ]] are needed. Shouldn't it just be
18             dnl [ and ]?
19             2.[[0-3]]* | 1.*)
20                 ;;
21             *)
22                 AC_DEFINE([MMAP_ANONYMOUS_SHARED],, \
23                           [Define if your mmap() supports MAP_ANONYMOUS with MAP_SHARED.])
24                 ;;
25         esac
26         ;;
27     *)
28         ;;
29 esac
31 CFLAGS="$CFLAGS -D_GNU_SOURCE"
33 dnl Checks for programs.
34 AC_PROG_AWK
35 AC_PROG_LN_S
36 AC_PROG_CC
37 AC_PROG_INSTALL
38 AM_PATH_GLIB_2_0(,, AC_MSG_ERROR([glib2 not found]))
39 AM_PATH_LIBGCRYPT(,, AC_MSG_ERROR([libgcrypt not found]))
41 dnl Checks for library functions.
42 AC_CHECK_PROG([have_xmlconfig], [xml2-config], [yes], [no])
44 if test "x$have_xmlconfig" = "xno"; then
45     AC_MSG_ERROR([xml2-config not found])
48 XML_CFLAGS="`xml2-config --cflags`"
49 XML_LIBS="`xml2-config --libs`"
51 AC_SUBST(XML_CFLAGS)
52 AC_SUBST(XML_LIBS)
54 dnl Checks for header files.
55 AC_HEADER_STDC
56 AC_HEADER_SYS_WAIT
57 AC_CHECK_HEADERS([fcntl.h arpa/inet.h netdb.h netinet/in.h stdlib.h string.h \
58                   sys/socket.h sys/time.h unistd.h termios.h])
60 dnl Checks for typedefs, structures, and compiler characteristics.
61 AC_C_CONST
62 AC_TYPE_SSIZE_T
63 AC_HEADER_TIME
64 AC_TYPE_SIZE_T
65 AC_TYPE_SIGNAL
66 AC_STRUCT_TM
68 dnl Checks for library functions.
69 AC_FUNC_STAT
70 AC_FUNC_FORK
71 AC_FUNC_REALLOC
72 AC_FUNC_MEMCMP
73 AC_FUNC_MMAP
74 AC_FUNC_STRFTIME
75 AC_FUNC_SELECT_ARGTYPES
76 AC_CHECK_FUNCS([mkdir strerror gethostbyname memset select socket strcasecmp \
77                 strdup strncasecmp strchr setrlimit mlock mlockall ftruncate \
78                 getcwd memmove munmap strrchr strtol strstr])
80 AC_DEFUN([AC_DEBUG],
82     if test "$1"; then
83         ac_cv_sys_debug=$1
84     fi
86     AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
87         [ac_cv_sys_debug=no])
88     AM_CONDITIONAL([WITH_DEBUG], [test "$ac_cv_sys_debug" = "yes"])
91 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
92     AC_DEBUG([$enableval]), AC_DEBUG)
94 AM_WITH_DMALLOC
96 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])
97 AC_OUTPUT