-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
391 lines (323 loc) · 13 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
c## Copyright (C) 2008-2017 Dirk-Jan C. Binnema <[email protected]>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
AC_PREREQ([2.68])
AC_INIT([mu],[0.9.19],[https://github.com/djcb/mu/issues],[mu])
AC_COPYRIGHT([Copyright (C) 2008-2016 Dirk-Jan C. Binnema])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([mu/mu.cc])
# libtoolize wants to put some stuff in here; if you have an old
# autotools/libtool setup. you can try to comment this out
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
m4_ifndef([AX_COMPILER_FLAGS],[
AC_MSG_ERROR([
*** autoconf-archive >= 20150925 required for the build setup.
*** Please install it, or get an official release from
*** https://github.com/djcb/mu/releases
])
])
AX_IS_RELEASE([git-directory])
AX_CHECK_ENABLE_DEBUG([yes])
AM_INIT_AUTOMAKE([1.14 foreign no-dist-gzip tar-ustar dist-xz])
# silent build if we have a new enough automake
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AS_IF([test x$prefix = xNONE],[prefix=/usr/local])
AC_SUBST(prefix)
# AC_PROG_CXX *before* AC_PROG_CC, otherwise configure won't error out
# when a c++ compiler is not found. Weird, huh?
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_CC_C99
AC_PROG_INSTALL
AC_HEADER_STDC
AX_COMPILER_FLAGS(,,[yes])
# for now, use AM_PROG_LIBTOOL, as we don't want to require
# a too new setup for autotools/libtool
AM_PROG_LIBTOOL
#LT_INIT([disable-shared])
AC_PROG_AWK
AC_CHECK_PROG(SORT,sort,sort)
AC_CHECK_HEADERS([wordexp.h])
# use the 64-bit versions
AC_SYS_LARGEFILE
# check for makeinfo
AC_CHECK_PROG(have_makeinfo,makeinfo,yes,no)
AM_CONDITIONAL(HAVE_MAKEINFO,test "x$have_makeinfo" = "xyes")
# we need emacs for byte-compiling mu4e
build_mu4e=no
AC_ARG_ENABLE([mu4e],
AS_HELP_STRING([--disable-mu4e],[Disable building mu4e]))
AS_IF([test "x$enable_mu4e" != "xno"], [
AM_PATH_LISPDIR
AS_IF([test "x$lispdir" != "xno"], [
emacs_version="`$EMACS --version | head -1`"
lispdir="${lispdir}/mu4e/"
])
AS_CASE([$emacs_version],[*23*|*24*|*25*|*26*],[build_mu4e=yes],
[AC_WARN([emacs is too old to build mu4e (need emacs >= 23.x)])])
])
AM_CONDITIONAL(BUILD_MU4E, test "x$build_mu4e" = "xyes")
# Perl interface requires Data::SExpression
build_perl=no
AC_ARG_ENABLE([perl],
AS_HELP_STRING([--enable-perl],[Enable building the Perl interface]))
AC_ARG_VAR([PERL], [the Perl interpreter command])
AC_CHECK_PROGS([PERL], [perl], [no])
AS_IF([test x"$enable_perl" = "xyes" -a x"$PERL" != "xno"], [
AM_PERL_MODULE([Data::SExpression],[build_perl=yes])
if test x"$build_perl" = "xyes"; then
perl_version=`$PERL -Iperl/lib -Mmup -e 'print "$mup::VERSION\n";'`
fi
])
AM_CONDITIONAL(BUILD_PERL, test "x$build_perl" = "xyes")
# we need some special tricks for filesystems that don't have d_type;
# e.g. Solaris. See mu-maildir.c. Explicitly disabling it is for
# testing purposes only
AC_ARG_ENABLE([dirent-d-type],
AC_HELP_STRING([--disable-dirent-d-type],
[Don't use dirent->d_type, even if you have it]),
[], [AC_STRUCT_DIRENT_D_TYPE]
)
AS_IF([test "x$ac_cv_member_struct_dirent_d_type" != "xyes"],
[use_dirent_d_type="no"], [use_dirent_d_type="yes"])
# support for d_ino (inode) in struct dirent is optional; if it's
# available we can sort direntries by inode and access them in that
# order; this is much faster on some file systems (such as extfs3).
# Explicity disabling it is for testing purposes only.
AC_ARG_ENABLE([dirent-d-ino],
AC_HELP_STRING([--disable-dirent-d-ino],
[Don't use dirent->d_ino, even if you have it]),
[], [AC_STRUCT_DIRENT_D_INO]
)
AS_IF([test "x$ac_cv_member_struct_dirent_d_ino" != "xyes"],
[use_dirent_d_ino="no"], [use_dirent_d_ino="yes"])
# we need these
AC_CHECK_FUNCS([memset memcpy realpath setlocale strerror getpass setsid])
AC_CHECK_FUNC(timegm,[],[AC_MSG_ERROR([missing required function timegm])])
# require pkg-config
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
AS_IF([test "x$PKG_CONFIG" = "xno"],[
AC_MSG_ERROR([
*** The pkg-config script could not be found. Make sure it is
*** in your path, or set the PKG_CONFIG environment variable
*** to the full path to pkg-config.])
])
# glib2?
# we pick some late-2012 version
PKG_CHECK_MODULES(GLIB,glib-2.0 >= 2.32 gobject-2.0 gio-2.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
glib_version="`$PKG_CONFIG --modversion glib-2.0`"
# gmime, some late-2012 version
PKG_CHECK_MODULES(GMIME,gmime-2.6 >= 2.6.7)
AC_SUBST(GMIME_CFLAGS)
AC_SUBST(GMIME_LIBS)
gmime_version="`$PKG_CONFIG --modversion gmime-2.6`"
# xapian checking - we need 1.2.x at least
AC_CHECK_PROG(XAPIAN_CONFIG,xapian-config,xapian-config,no)
AM_CONDITIONAL(HAVE_XAPIAN,test "x$XAPIAN_CONFIG" != "xno")
AS_IF([test "x$XAPIAN_CONFIG" = "xno"],[
AC_MSG_ERROR([
*** xapian could not be found; please install it
*** e.g., in debian/ubuntu the package would be 'libxapian-dev'
*** If you compiled it yourself, you should ensure that xapian-config
*** is in your PATH.])],
[xapian_version=$($XAPIAN_CONFIG --version | sed -e 's/.* //')])
AS_CASE([$xapian_version],
[1.[[2-9]].[[0-9]]*], [],
[AC_MSG_ERROR([*** xapian version >= 1.2 needed,
but version $xapian_version found.])])
XAPIAN_CXXFLAGS="`$XAPIAN_CONFIG --cxxflags`"
XAPIAN_LIBS="`$XAPIAN_CONFIG --libs`"
have_xapian="yes"
AC_SUBST(XAPIAN_CXXFLAGS)
AC_SUBST(XAPIAN_LIBS)
###############################################################################
# we set the set the version of the MuStore (Xapian database) layout
# here; it will become part of the db name, so we can automatically
# recreate the database when we have incompatible changes.
#
# note that MU_STORE_SCHEMA_VERSION does not necessarily follow MU
# versioning, as we hopefully don't have updates for each version;
# also, this has nothing to do with Xapian's software version
AC_DEFINE(MU_STORE_SCHEMA_VERSION,["9.9"], ['Schema' version of the database])
###############################################################################
###############################################################################
# we need GTK+3 for some of the graphical tools
# use --without-gtk to disable it
AC_ARG_ENABLE([gtk],AS_HELP_STRING([--disable-gtk],[Disable GTK+]))
AS_IF([test "x$enable_gtk" != "xno"],[
PKG_CHECK_MODULES(GTK,gtk+-3.0,[have_gtk=yes],[have_gtk=no])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
gtk_version="`$PKG_CONFIG --modversion gtk+-3.0`"])
AM_CONDITIONAL(HAVE_GTK,[test "x$have_gtk" = "xyes"])
# webkit? needed for the fancy web widget
# use --disable-webkit to disable it, even if you have it
AC_ARG_ENABLE([webkit],AS_HELP_STRING([--disable-webkit],[Disable webkit]))
AS_IF([test "x$enable_webkit" != "xno"],[
PKG_CHECK_MODULES(WEBKIT,webkitgtk-3.0 >= 1.8.0,[have_webkit=yes],[have_webkit=no])
AS_IF([test "x$have_webkit" = "xyes"],[
webkit_version="`$PKG_CONFIG --modversion webkitgtk-3.0`"])
AC_SUBST(WEBKIT_CFLAGS)
AC_SUBST(WEBKIT_LIBS)
])
AM_CONDITIONAL(HAVE_WEBKIT, [test "x$have_webkit" = "xyes"])
AM_CONDITIONAL(BUILD_GUI,[test "x$have_webkit" = "xyes" -a "x$have_gtk" = "xyes"])
###############################################################################
###############################################################################
# check for guile 2.0 & guile-snarf
build_guile=no
AC_ARG_ENABLE([guile],
AS_HELP_STRING([--disable-guile],[Disable guile]))
AS_IF([test "x$enable_guile" != "xno"], [
PKG_CHECK_MODULES(GUILE,guile-2.0,[build_guile=yes],[build_guile=no])
AC_SUBST(GUILE_CFLAGS)
AC_SUBST(GUILE_LIBS)
GUILE_EXECDIR="`${PKG_CONFIG} guile-2.0 --variable=exec_prefix`/bin"
AS_IF([test "x$build_guile" = "xyes"],[
AC_PATH_PROG(GUILE_BINARY, [guile], [], [$GUILE_EXECDIR])
AS_IF([test "x$GUILE_BINARY" != "x"],
[AC_DEFINE_UNQUOTED([GUILE_BINARY],["$GUILE_BINARY"],[Path to the guile binary])],
[AC_MSG_WARN([cannot find guile-snarf])])])
AS_IF([test "x$build_guile" = "xyes"],[
AC_PATH_PROG(GUILE_SNARF, [guile-snarf], [], [$GUILE_EXECDIR])
AS_IF([test "x$GUILE_SNARF" != "x"],
[AC_DEFINE_UNQUOTED([GUILE_SNARF],["$GUILE_SNARF"],[Path to guile-snarf])
GUILE_SITEDIR="`${PKG_CONFIG} guile-2.0 --variable=sitedir`"],
[AC_MSG_WARN([cannot find guile-snarf])])])
AC_SUBST(GUILE_SITEDIR)])
AS_IF([test "x$build_guile" = "xyes" -a "x$GUILE_SNARF" != "x"],
[guile_version="`${PKG_CONFIG} --modversion guile-2.0`"
AC_DEFINE_UNQUOTED([BUILD_GUILE],1,[Whether we build with guile 2.0 support])])
AM_CONDITIONAL(BUILD_GUILE, [test "x$build_guile" = "xyes"])
###############################################################################
###############################################################################
# check for makeinfo
AC_CHECK_PROG(have_makeinfo,makeinfo,yes,no)
AM_CONDITIONAL(HAVE_MAKEINFO, [test "x$have_makeinfo" = "xyes"])
###############################################################################
###############################################################################
# docdir, so we can use it in mu4e-meta.el.in
AC_SUBST(MU_DOC_DIR, "${prefix}/share/doc/mu")
###############################################################################
###############################################################################
# check for pmccabe
AC_PATH_PROG([PMCCABE],[pmccabe],[no])
AS_IF([test "x$PMCCABE" = "xno"],[
have_pmccabe="no"
AC_MSG_WARN([
*** Developers: you do not seem to have the pmccabe tool installed.
*** Please install it if you want to run the automated code checks])
],[have_pmccabe="yes"])
###############################################################################
AC_CONFIG_FILES([
Makefile
mu/Makefile
mu/tests/Makefile
lib/Makefile
lib/doxyfile
lib/tests/Makefile
mu4e/Makefile
mu4e/mu4e-meta.el
mu4e/texi.texi
guile/Makefile
guile/texi.texi
guile/mu/Makefile
guile/examples/Makefile
guile/tests/Makefile
guile/scripts/Makefile
toys/Makefile
toys/mug/Makefile
toys/msg2pdf/Makefile
man/Makefile
m4/Makefile
contrib/Makefile
])
AC_OUTPUT
if test x"$build_perl" != "xno"; then
echo "Configuring Perl interface..."
cd perl
$PERL Makefile.PL
cd ..
fi
echo
echo "mu configuration is complete."
echo "------------------------------------------------"
if test -e ~/.mu/xapian-0.6; then
echo "Note: since version 0.7, the Xapian database is no longer stored as "
echo "~/.mu/xapian-0.6 but instead simply as ~/.mu/xapian. You can "
echo "remove the old <muhome>/xapian-0.6 directory to save some disk space"
fi
echo "mu version : $VERSION"
echo
echo "Xapian version : $xapian_version"
echo "GLib version : $glib_version"
echo "GMime version : $gmime_version"
AM_COND_IF([BUILD_GUI],[
echo "GTK+ version : $gtk_version"
echo "Webkit version : $webkit_version"
])
AM_COND_IF([BUILD_GUILE],[
echo "Guile version : $guile_version"
])
if test "x$build_mu4e" = "xyes"; then
echo "Emacs version : $emacs_version"
fi
#AM_COND_IF([BUILD_PERL],[
#echo "Perl interface version : $perl_version"
#])
echo
echo "Have wordexp : $ac_cv_header_wordexp_h"
echo "Build mu4e emacs frontend : $build_mu4e"
AM_COND_IF([BUILD_GUI],[
echo "Build 'mug' toy-ui (gtk+/webkit) : yes"],[
echo "Build 'mug' toy-ui (gtk+/webkit) : no"
])
echo "McCabe's Cyclomatic Complexity tool : $have_pmccabe"
echo
echo "Have direntry->d_ino : $use_dirent_d_ino"
echo "Have direntry->d_type : $use_dirent_d_type"
echo "------------------------------------------------"
echo
#
# Warnings / notes
#
# makeinfo
if test "x$have_makeinfo" != "xyes"; then
echo "* You do not seem to have the makeinfo program; if you are building from git"
echo " you need that to create documentation for guile and emacs. It is in the"
echo " texinfo package in debian/ubuntu/fedora/... "
echo
fi
# gui
if test "x$buildgui" = "xyes"; then
echo "* The demo UI will be built in toys/mug"
echo
fi
# wordexp
if test "x$ac_cv_header_wordexp_h" != "xyes"; then
echo "* Your system does not seem to have the 'wordexp' function."
echo " This means that you cannot use shell-like expansion in options and "
echo " some other places. So, for example, instead of"
echo " --maildir=~/Maildir"
echo " you should use the complete path, something like:"
echo " --maildir=/home/user/Maildir"
fi
echo
echo "Now, type 'gmake' to build mu (or 'gmake check' to run the unit tests, too)"
echo