]> rtime.felk.cvut.cz Git - notmuch.git/blob - contrib/notmuch-deliver/maildrop/maildir/configure.in
dfdd22a379e253380fb0725691623972c016f2a2
[notmuch.git] / contrib / notmuch-deliver / maildrop / maildir / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 dnl Copyright 1998 - 2001 Double Precision, Inc.  See COPYING for
4 dnl distribution information.
5
6 AC_INIT(maildir, 0.11, [courier-maildrop@lists.sourceforge.net])
7
8 >confdefs.h  # Kill PACKAGE_ macros
9
10 AC_CONFIG_SRCDIR(maildirquota.c)
11 LPATH="$PATH:/usr/local/bin"
12 AC_CANONICAL_SYSTEM
13 AM_INIT_AUTOMAKE([foreign no-define])
14 AM_CONFIG_HEADER(config.h)
15
16 dnl Checks for programs.
17 AC_PROG_AWK
18 AC_USE_SYSTEM_EXTENSIONS
19 AC_PROG_CC
20 AC_PROG_INSTALL
21 AC_PROG_LN_S
22 AC_LIBTOOL_DLOPEN
23 AM_PROG_LIBTOOL
24
25 AC_PROG_CXX
26
27 AC_PATH_PROGS(PERL, perl5 perl, perl, $LPATH)
28
29 if test "$GCC" = "yes"
30 then
31         CFLAGS="$CFLAGS -Wall"
32 fi
33
34 if test "$GXX" = "yes"
35 then
36         CXXFLAGS="$CXXFLAGS -Wall"
37 fi
38
39 CFLAGS="$CFLAGS -I${srcdir}/.. -I.."
40
41 dnl Checks for libraries.
42
43 dnl Checks for header files.
44 AC_HEADER_DIRENT
45 AC_HEADER_STDC
46 AC_HEADER_TIME
47 AC_CHECK_HEADERS(sys/stat.h sys/wait.h fcntl.h unistd.h sysexits.h utime.h pcre.h pcre/pcre.h)
48
49 AC_CHECK_HEADER([pcre.h],
50                 [LIBPCRE=-lpcre])
51
52 AC_CHECK_HEADER([pcre/pcre.h],
53                 [LIBPCRE=-lpcre])
54
55 AC_SUBST(LIBPCRE)
56
57 AC_HEADER_SYS_WAIT
58
59 AC_LANG_CPLUSPLUS
60 AC_CHECK_HEADERS(vector vector.h)
61 AC_LANG_C
62
63 dnl Checks for typedefs, structures, and compiler characteristics.
64 AC_C_CONST
65 AC_TYPE_OFF_T
66 AC_TYPE_SIZE_T
67 AC_TYPE_UID_T
68 AC_STRUCT_TM
69 AC_SYS_LARGEFILE
70
71 dnl Checks for library functions.
72 AC_CHECK_HEADER(fam.h, :, :)
73 AC_CHECK_FUNCS(symlink readlink strcasecmp utime utimes)
74 AC_CHECK_LIB(fam, FAMOpen,  [
75                         LIBFAM=-lfam
76                         AC_DEFINE_UNQUOTED(HAVE_FAM,1,
77                         [ Whether libfam.a is available ])
78
79                         AC_CHECK_HEADER(fam.h, : , [
80 AC_MSG_WARN([[The development header files and libraries for fam,]])
81 AC_MSG_WARN([[the File Alteration Monitor, are not installed.]])
82 AC_MSG_WARN([[You appear to have the FAM runtime libraries installed,]])
83 AC_MSG_WARN([[so you need to simply install the additional development]])
84 AC_MSG_WARN([[package for your operating system.]])
85 AC_MSG_ERROR([[FAM development libraries not found.]]) ]
86                                         )
87                   ])
88
89 AC_SUBST(LIBFAM)
90
91 echo "$LIBFAM" >maildir.libdeps
92
93 AC_CACHE_CHECK([for missing gethostname prototype],maildir_cv_SYS_GETHOSTNAME,
94
95 AC_TRY_COMPILE([
96 #if HAVE_UNISTD_H
97 #include        <unistd.h>
98 #endif
99
100 extern "C" int gethostname(int,int);
101 ],[
102 ],maildir_cv_SYS_GETHOSTNAME=yes,maildir_cv_SYS_GETHOSTNAME=no
103 )
104
105 )
106
107 if test $maildir_cv_SYS_GETHOSTNAME = "no"
108 then
109         AC_DEFINE_UNQUOTED(HAS_GETHOSTNAME,1,
110         [ Whether gethostname() is prototyped ])
111 fi
112
113 AC_ARG_WITH(db, [  --with-db=gdbm          Use the GDBM library.
114   --with-db=db            Use the libdb.a library.],
115         db="$withval", db="")
116
117 if test "$db" = "no"
118 then
119         db=""
120 fi
121
122 if test "$db" != ""
123 then
124         AC_DEFINE_UNQUOTED(HAVE_DBOBJ,1,
125         [ Whether the top-level configure script defined dbobj ])
126 fi
127
128 AC_ARG_WITH(trashquota, [  --with-trashquota       Count deleted messages as part of the quota],
129         trashquota="$withval",
130         trashquota="no")
131
132 if test "$trashquota" = "yes"
133 then
134         AC_DEFINE_UNQUOTED(TRASHQUOTA,1,
135         [ Whether to count deleted messages towards the maildir quota ])
136 fi
137
138 test "x$prefix" = xNONE && prefix=$ac_default_prefix
139 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
140 eval "prefix=$prefix"
141 eval "exec_prefix=$exec_prefix"
142 eval "sysconfdir=$sysconfdir"
143
144 AC_PATH_PROGS(MAILBOT, mailbot, mailbot, $LPATH)
145
146 if test -d $srcdir/../courier
147 then
148         MAILBOT="$bindir/mailbot"
149         AC_DEFINE_UNQUOTED(HAVE_COURIER,1,
150                                 [ Whether building the full Courier suite. ])
151 fi
152
153 AC_SUBST(MAILBOT)
154 AM_CONDITIONAL(HAVE_SGML, test -d ${srcdir}/../docbook)
155
156 if test "$target_os" = "cygwin"
157 then
158         AC_DEFINE_UNQUOTED(MDIRSEP, "!",
159         [ Maildir target separator ])
160 else
161         AC_DEFINE_UNQUOTED(MDIRSEP, ":",
162         [ Maildir target separator ])
163 fi
164
165 AC_OUTPUT(Makefile sharedindexinstall sharedindexsplit)