Version 0.2.
[pwmd.git] / configure.ac
bloba47bbcd8e5ee5c0695580aa09f79063014f497d1
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(pwmd, 0.2, [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 CFLAGS="$CFLAGS -D_GNU_SOURCE"
14 dnl Checks for programs.
15 AC_PROG_AWK
16 AC_PROG_LN_S
17 AC_PROG_CC
18 AC_PROG_INSTALL
19 AM_PATH_GLIB_2_0(,, AC_MSG_ERROR([glib2 not found]))
20 AM_PATH_LIBGCRYPT(,, AC_MSG_ERROR([libgcrypt not found]))
22 dnl Checks for library functions.
23 AC_CHECK_PROG([have_xmlconfig], [xml2-config], [yes], [no])
25 if test "x$have_xmlconfig" = "xno"; then
26     AC_MSG_ERROR([xml2-config not found])
29 XML_CFLAGS="`xml2-config --cflags`"
30 XML_LIBS="`xml2-config --libs`"
32 AC_SUBST(XML_CFLAGS)
33 AC_SUBST(XML_LIBS)
35 dnl Checks for header files.
36 AC_HEADER_STDC
37 AC_HEADER_SYS_WAIT
38 AC_CHECK_HEADERS([fcntl.h arpa/inet.h netdb.h netinet/in.h stdlib.h string.h \
39                   sys/socket.h sys/time.h unistd.h])
41 dnl Checks for typedefs, structures, and compiler characteristics.
42 AC_C_CONST
43 AC_TYPE_SSIZE_T
44 AC_HEADER_TIME
45 AC_TYPE_SIZE_T
46 AC_TYPE_SIGNAL
47 AC_STRUCT_TM
49 dnl Checks for library functions.
50 AC_FUNC_STAT
51 AC_FUNC_FORK
52 AC_FUNC_REALLOC
53 AC_FUNC_MEMCMP
54 AC_FUNC_MMAP
55 AC_FUNC_STRFTIME
56 AC_FUNC_SELECT_ARGTYPES
57 AC_CHECK_FUNCS([mkdir strerror gethostbyname memset select socket strcasecmp \
58                 strdup strncasecmp strchr setrlimit mlock mlockall ftruncate \
59                 getcwd memmove munmap strrchr strtol ])
61 AC_DEFUN([AC_DEBUG],
63     if test "$1"; then
64         ac_cv_sys_debug=$1
65     fi
67     AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
68         [ac_cv_sys_debug=no])
69     AM_CONDITIONAL([WITH_DEBUG], [test "$ac_cv_sys_debug" = "yes"])
72 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
73     AC_DEBUG([$enableval]), AC_DEBUG)
75 AM_WITH_DMALLOC
77 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile])
78 AC_OUTPUT