1 AC_INIT(src/htparser.c)
2 AM_INIT_AUTOMAKE([ashd], [0.11])
3 AM_CONFIG_HEADER(config.h)
16 AC_CHECK_LIB(magic, magic_open, [:], [HAS_MAGIC=no])
17 AC_CHECK_HEADER(magic.h, [], [HAS_MAGIC=no])
18 if test "$HAS_MAGIC" = no; then
19 AC_MSG_ERROR([*** cannot find libmagic on this system])
22 AH_TEMPLATE(HAVE_VALGRIND, [define to include debugging support for Valgrind])
23 AC_CHECK_HEADER(valgrind/memcheck.h, [AC_DEFINE(HAVE_VALGRIND)], [])
25 AH_TEMPLATE(HAVE_EPOLL, [define to enable epoll support])
26 AC_ARG_WITH(epoll, [ --with-epoll Enable epoll(2) support])
28 if test "$with_epoll" = no; then HAS_EPOLL=no; fi
29 if test -z "$HAS_EPOLL"; then
30 AC_CHECK_LIB(c, epoll_ctl, [:], [HAS_EPOLL=no])
32 if test -z "$HAS_EPOLL"; then
33 AC_CHECK_HEADER(sys/epoll.h, [], [HAS_EPOLL=no])
35 if test "$HAS_EPOLL" != no; then HAS_EPOLL=yes; fi
36 if test "$with_epoll" = yes -a "$HAS_EPOLL" = no; then
37 AC_MSG_ERROR([*** cannot find epoll support on this system])
39 if test "$HAS_EPOLL" = yes; then
42 AM_CONDITIONAL(USE_EPOLL, [test "$HAS_EPOLL" = yes ])
44 AH_TEMPLATE(HAVE_XATTR, [define to compile support for filesystem extended attributes])
45 AC_ARG_WITH(xattr, [ --with-xattr Enable XATTR support])
47 if test "$with_xattr" = no; then HAS_XATTR=no; fi
48 if test -z "$HAS_XATTR"; then
49 AC_CHECK_LIB(attr, getxattr, [:], [HAS_XATTR=no])
51 if test -z "$HAS_XATTR"; then
52 AC_CHECK_HEADER(attr/xattr.h, [], [HAS_XATTR=no])
54 if test "$HAS_XATTR" != no; then HAS_XATTR=yes; fi
55 if test "$with_xattr" = yes -a "$HAS_XATTR" = no; then
56 AC_MSG_ERROR([*** cannot find xattr support on this system])
58 if test "$HAS_XATTR" = yes; then
64 AH_TEMPLATE(HAVE_GNUTLS, [define to use the GnuTLS library for SSL support])
65 AC_ARG_WITH(gnutls, [ --with-gnutls Enable SSL support with the GnuTLS library])
67 if test "$with_gnutls" = no; then HAS_GNUTLS=no; fi
68 if test -z "$HAS_GNUTLS"; then
69 AC_CHECK_LIB(gnutls, gnutls_global_init, [:], [HAS_GNUTLS=no])
71 if test -z "$HAS_GNUTLS"; then
72 AC_CHECK_HEADER(gnutls/gnutls.h, [], [HAS_GNUTLS=no])
74 if test "$HAS_GNUTLS" != no; then HAS_GNUTLS=yes; fi
75 if test "$with_gnutls" = yes -a "$HAS_GNUTLS" = no; then
76 AC_MSG_ERROR([*** cannot find GnuTLS on this system])
78 if test "$HAS_GNUTLS" = yes; then
80 GNUTLS_CPPFLAGS=-D_GNU_SOURCE
81 AC_DEFINE(HAVE_GNUTLS)
83 AC_SUBST(GNUTLS_CPPFLAGS)