1 AC_INIT([ashd], [0.13])
2 AC_CONFIG_SRCDIR(src/htparser.c)
4 AM_CONFIG_HEADER(config.h)
17 AC_CHECK_LIB(magic, magic_open, [:], [HAS_MAGIC=no])
18 AC_CHECK_HEADER(magic.h, [], [HAS_MAGIC=no])
19 if test "$HAS_MAGIC" = no; then
20 AC_MSG_ERROR([*** cannot find libmagic on this system])
23 AH_TEMPLATE(HAVE_VALGRIND, [define to include debugging support for Valgrind])
24 AC_CHECK_HEADER(valgrind/memcheck.h, [AC_DEFINE(HAVE_VALGRIND)], [])
26 AH_TEMPLATE(HAVE_EPOLL, [define to enable epoll support])
27 AC_ARG_WITH(epoll, [ --with-epoll Enable epoll(2) support])
29 if test "$with_epoll" = no; then HAS_EPOLL=no; fi
30 if test -z "$HAS_EPOLL"; then
31 AC_CHECK_LIB(c, epoll_ctl, [:], [HAS_EPOLL=no])
33 if test -z "$HAS_EPOLL"; then
34 AC_CHECK_HEADER(sys/epoll.h, [], [HAS_EPOLL=no])
36 if test "$HAS_EPOLL" != no; then HAS_EPOLL=yes; fi
37 if test "$with_epoll" = yes -a "$HAS_EPOLL" = no; then
38 AC_MSG_ERROR([*** cannot find epoll support on this system])
40 if test "$HAS_EPOLL" = yes; then
43 AM_CONDITIONAL(USE_EPOLL, [test "$HAS_EPOLL" = yes ])
45 AH_TEMPLATE(HAVE_XATTR, [define to compile support for filesystem extended attributes])
46 AC_ARG_WITH(xattr, [ --with-xattr Enable XATTR support])
48 if test "$with_xattr" = no; then HAS_XATTR=no; fi
49 if test -z "$HAS_XATTR"; then
50 AC_CHECK_LIB(attr, getxattr, [:], [HAS_XATTR=no])
52 if test -z "$HAS_XATTR"; then
53 AC_CHECK_HEADER(attr/xattr.h, [], [HAS_XATTR=no])
55 if test "$HAS_XATTR" != no; then HAS_XATTR=yes; fi
56 if test "$with_xattr" = yes -a "$HAS_XATTR" = no; then
57 AC_MSG_ERROR([*** cannot find xattr support on this system])
59 if test "$HAS_XATTR" = yes; then
65 AH_TEMPLATE(HAVE_GNUTLS, [define to use the GnuTLS library for SSL support])
66 AC_ARG_WITH(gnutls, [ --with-gnutls Enable SSL support with the GnuTLS library])
68 if test "$with_gnutls" = no; then HAS_GNUTLS=no; fi
69 if test -z "$HAS_GNUTLS"; then
70 AC_CHECK_LIB(gnutls, gnutls_global_init, [:], [HAS_GNUTLS=no])
72 if test -z "$HAS_GNUTLS"; then
73 AC_CHECK_HEADER(gnutls/gnutls.h, [], [HAS_GNUTLS=no])
75 if test "$HAS_GNUTLS" != no; then HAS_GNUTLS=yes; fi
76 if test "$with_gnutls" = yes -a "$HAS_GNUTLS" = no; then
77 AC_MSG_ERROR([*** cannot find GnuTLS on this system])
79 if test "$HAS_GNUTLS" = yes; then
81 GNUTLS_CPPFLAGS=-D_GNU_SOURCE
82 AC_DEFINE(HAVE_GNUTLS)
84 AC_SUBST(GNUTLS_CPPFLAGS)