Commit | Line | Data |
---|---|---|
3d76922f FT |
1 | AC_INIT([ashd], [0.13]) |
2 | AC_CONFIG_SRCDIR(src/htparser.c) | |
3 | AM_INIT_AUTOMAKE | |
0b26618e | 4 | AM_CONFIG_HEADER(config.h) |
945d02f5 | 5 | AC_USE_SYSTEM_EXTENSIONS |
0b26618e FT |
6 | |
7 | AC_PROG_CC | |
f0bbedf7 | 8 | AM_PROG_CC_C_O |
0b26618e | 9 | AC_PROG_INSTALL |
f0bbedf7 | 10 | AC_PROG_RANLIB |
0b26618e FT |
11 | |
12 | dnl Add for libtool: | |
13 | dnl AM_PROG_LIBTOOL | |
14 | ||
15 | AC_HEADER_STDC | |
16 | ||
5518f5b5 FT |
17 | HAS_MAGIC=yes |
18 | AC_CHECK_LIB(magic, magic_open, [:], [HAS_MAGIC=no]) | |
19 | AC_CHECK_HEADER(magic.h, [], [HAS_MAGIC=no]) | |
20 | if test "$HAS_MAGIC" = no; then | |
21 | AC_MSG_ERROR([*** cannot find libmagic on this system]) | |
22 | fi | |
23 | ||
945d02f5 | 24 | AH_TEMPLATE(HAVE_GLIBC_STDIO, [define to indicate system support for glibc cookie streams]) |
2a619a21 | 25 | AH_TEMPLATE(HAVE_BSD_STDIO, [define to indicate system support for BSD-style funopen streams]) |
945d02f5 FT |
26 | |
27 | HAS_FOPENCOOKIE=yes | |
28 | AC_CHECK_FUNC(fopencookie, [], [HAS_FOPENCOOKIE=no]) | |
29 | AC_CHECK_MEMBER([cookie_io_functions_t.read], [], [HAS_FOPENCOOKIE=no]) | |
30 | ||
2a619a21 FT |
31 | HAS_FUNOPEN=yes |
32 | AC_CHECK_FUNC(funopen, [], [HAS_FUNOPEN=no]) | |
33 | ||
945d02f5 | 34 | if test "$HAS_FOPENCOOKIE" = yes; then |
2a619a21 FT |
35 | AC_DEFINE(HAVE_GLIBC_STDIO) |
36 | elif test "$HAS_FUNOPEN" = yes; then | |
37 | AC_DEFINE(HAVE_BSD_STDIO) | |
945d02f5 | 38 | else |
2a619a21 | 39 | AC_MSG_ERROR([*** libc support for custom stdio streams is required]) |
945d02f5 FT |
40 | fi |
41 | ||
28260620 FT |
42 | AH_TEMPLATE(HAVE_VALGRIND, [define to include debugging support for Valgrind]) |
43 | AC_CHECK_HEADER(valgrind/memcheck.h, [AC_DEFINE(HAVE_VALGRIND)], []) | |
44 | ||
16accb88 | 45 | AH_TEMPLATE(HAVE_EPOLL, [define to enable epoll support]) |
695e99c8 | 46 | AC_ARG_WITH(epoll, AS_HELP_STRING([--with-epoll], [enable epoll(2) support])) |
16accb88 FT |
47 | HAS_EPOLL="" |
48 | if test "$with_epoll" = no; then HAS_EPOLL=no; fi | |
49 | if test -z "$HAS_EPOLL"; then | |
50 | AC_CHECK_LIB(c, epoll_ctl, [:], [HAS_EPOLL=no]) | |
51 | fi | |
52 | if test -z "$HAS_EPOLL"; then | |
53 | AC_CHECK_HEADER(sys/epoll.h, [], [HAS_EPOLL=no]) | |
54 | fi | |
55 | if test "$HAS_EPOLL" != no; then HAS_EPOLL=yes; fi | |
56 | if test "$with_epoll" = yes -a "$HAS_EPOLL" = no; then | |
57 | AC_MSG_ERROR([*** cannot find epoll support on this system]) | |
58 | fi | |
59 | if test "$HAS_EPOLL" = yes; then | |
60 | AC_DEFINE(HAVE_EPOLL) | |
61 | fi | |
ac612570 FT |
62 | |
63 | AH_TEMPLATE(HAVE_KQUEUE, [define to enable kqueue support]) | |
64 | AC_ARG_WITH(kqueue, AS_HELP_STRING([--with-kqueue], [enable kqueue(2) support])) | |
65 | HAS_KQUEUE="" | |
66 | if test "$with_kqueue" = no; then HAS_QUEUE=no; fi | |
67 | if test -z "$HAS_KQUEUE"; then | |
68 | AC_CHECK_FUNC(kqueue, [], [HAS_KQUEUE=no]) | |
69 | fi | |
70 | if test -z "$HAS_KQUEUE"; then | |
71 | AC_CHECK_HEADER(sys/event.h, [], [HAS_KQUEUE=no]) | |
72 | fi | |
73 | if test "$HAS_KQUEUE" != no; then HAS_KQUEUE=yes; fi | |
74 | if test "$with_kqueue" = yes -a "$HAS_KQUEUE" = no; then | |
75 | AC_MSG_ERROR([*** cannot find kqueue support on this system]) | |
76 | fi | |
77 | if test "$HAS_KQUEUE" = yes; then | |
78 | AC_DEFINE(HAVE_KQUEUE) | |
79 | fi | |
80 | ||
81 | AM_CONDITIONAL(USE_EPOLL, [test "$HAS_EPOLL" = yes]) | |
82 | AM_CONDITIONAL(USE_KQUEUE, [test "$HAS_KQUEUE" = yes]) | |
16accb88 | 83 | |
0328ac04 | 84 | AH_TEMPLATE(HAVE_XATTR, [define to compile support for filesystem extended attributes]) |
695e99c8 | 85 | AC_ARG_WITH(xattr, AS_HELP_STRING([--with-xattr], [enable XATTR support])) |
0328ac04 FT |
86 | HAS_XATTR="" |
87 | if test "$with_xattr" = no; then HAS_XATTR=no; fi | |
88 | if test -z "$HAS_XATTR"; then | |
89 | AC_CHECK_LIB(attr, getxattr, [:], [HAS_XATTR=no]) | |
90 | fi | |
91 | if test -z "$HAS_XATTR"; then | |
92 | AC_CHECK_HEADER(attr/xattr.h, [], [HAS_XATTR=no]) | |
93 | fi | |
94 | if test "$HAS_XATTR" != no; then HAS_XATTR=yes; fi | |
95 | if test "$with_xattr" = yes -a "$HAS_XATTR" = no; then | |
96 | AC_MSG_ERROR([*** cannot find xattr support on this system]) | |
97 | fi | |
98 | if test "$HAS_XATTR" = yes; then | |
99 | XATTR_LIBS=-lattr | |
100 | AC_DEFINE(HAVE_XATTR) | |
101 | fi | |
102 | AC_SUBST(XATTR_LIBS) | |
103 | ||
6ca53b2e | 104 | AH_TEMPLATE(HAVE_GNUTLS, [define to use the GnuTLS library for SSL support]) |
695e99c8 | 105 | AC_ARG_WITH(gnutls, AS_HELP_STRING([--with-gnutls], [enable SSL support with the GnuTLS library])) |
6ca53b2e FT |
106 | HAS_GNUTLS="" |
107 | if test "$with_gnutls" = no; then HAS_GNUTLS=no; fi | |
108 | if test -z "$HAS_GNUTLS"; then | |
109 | AC_CHECK_LIB(gnutls, gnutls_global_init, [:], [HAS_GNUTLS=no]) | |
110 | fi | |
111 | if test -z "$HAS_GNUTLS"; then | |
112 | AC_CHECK_HEADER(gnutls/gnutls.h, [], [HAS_GNUTLS=no]) | |
113 | fi | |
114 | if test "$HAS_GNUTLS" != no; then HAS_GNUTLS=yes; fi | |
115 | if test "$with_gnutls" = yes -a "$HAS_GNUTLS" = no; then | |
116 | AC_MSG_ERROR([*** cannot find GnuTLS on this system]) | |
117 | fi | |
118 | if test "$HAS_GNUTLS" = yes; then | |
119 | GNUTLS_LIBS=-lgnutls | |
120 | GNUTLS_CPPFLAGS=-D_GNU_SOURCE | |
121 | AC_DEFINE(HAVE_GNUTLS) | |
122 | fi | |
123 | AC_SUBST(GNUTLS_CPPFLAGS) | |
124 | AC_SUBST(GNUTLS_LIBS) | |
125 | ||
0b26618e FT |
126 | AC_OUTPUT([ |
127 | Makefile | |
128 | src/Makefile | |
600a1ce7 | 129 | src/dirplex/Makefile |
f0bbedf7 | 130 | lib/Makefile |
5c9badda | 131 | doc/Makefile |
0b26618e | 132 | ]) |