]> git.notmuchmail.org Git - notmuch/blob - configure
configure: add help note about gmime version
[notmuch] / configure
1 #! /bin/sh
2
3 # Store original IFS value so it can be changed (and restored) in many places.
4 readonly DEFAULT_IFS=$IFS
5
6 srcdir=$(dirname "$0")
7
8 # For a non-srcdir configure invocation (such as ../configure), create
9 # the directory structure and copy Makefiles.
10 if [ "$srcdir" != "." ]; then
11
12     for dir in . $(grep "^subdirs *=" "$srcdir"/Makefile | sed -e "s/subdirs *= *//"); do
13         mkdir -p "$dir"
14         cp "$srcdir"/"$dir"/Makefile.local "$dir"
15         cp "$srcdir"/"$dir"/Makefile "$dir"
16     done
17
18     # Easiest way to get the test suite to work is to just copy the
19     # whole thing into the build directory.
20     cp -a "$srcdir"/test/* test
21
22     # Emacs only likes to generate compiled files next to the .el files
23     # by default so copy these as well (which is not ideal0.
24     cp -a "$srcdir"/emacs/*.el emacs
25 fi
26
27 # Set several defaults (optionally specified by the user in
28 # environment variables)
29 CC=${CC:-gcc}
30 CXX=${CXX:-g++}
31 CFLAGS=${CFLAGS:--O2}
32 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
33 LDFLAGS=${LDFLAGS:-}
34 XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}
35
36 # We don't allow the EMACS or GZIP Makefile variables inherit values
37 # from the environment as we do with CC and CXX above. The reason is
38 # that these names as environment variables have existing uses other
39 # than the program name that we want. (EMACS is set to 't' when a
40 # shell is running within emacs and GZIP specifies arguments to pass
41 # on the gzip command line).
42
43 # Set the defaults for values the user can specify with command-line
44 # options.
45 PREFIX=/usr/local
46 LIBDIR=
47 WITH_EMACS=1
48 WITH_BASH=1
49 WITH_ZSH=1
50
51 # Compatible GMime versions (with constraints).
52 # If using GMime 2.6, we need to have a version >= 2.6.5 to avoid a
53 # crypto bug. We need 2.6.7 for permissive "From " header handling.
54 GMIME_24_VERSION_CTR=''
55 GMIME_24_VERSION="gmime-2.4 $GMIME_24_VERSION_CTR"
56 GMIME_26_VERSION_CTR='>= 2.6.7'
57 GMIME_26_VERSION="gmime-2.6 $GMIME_26_VERSION_CTR"
58
59 WITH_GMIME_VERSIONS="$GMIME_26_VERSION;$GMIME_24_VERSION"
60
61 usage ()
62 {
63     cat <<EOF
64 Usage: ./configure [options]...
65
66 This script configures notmuch to build on your system.
67
68 It verifies that dependencies are available, determines flags needed
69 to compile and link against various required libraries, and identifies
70 whether various system functions can be used or if locally-provided
71 replacements will be built instead.
72
73 Finally, it allows you to control various aspects of the build and
74 installation process.
75
76 First, some common variables can specified via environment variables:
77
78         CC              The C compiler to use
79         CFLAGS          Flags to pass to the C compiler
80         CXX             The C++ compiler to use
81         CXXFLAGS        Flags to pass to the C compiler
82         LDFLAGS         Flags to pass when linking
83
84 Each of these values can further be controlled by specifying them
85 later on the "make" command line.
86
87 Other environment variables can be used to control configure itself,
88 (and for which there is no equivalent build-time control):
89
90         XAPIAN_CONFIG   The program to use to determine flags for
91                         compiling and linking against the Xapian
92                         library. [$XAPIAN_CONFIG]
93
94 Additionally, various options can be specified on the configure
95 command line.
96
97         --prefix=PREFIX Install files in PREFIX [$PREFIX]
98
99 By default, "make install" will install the resulting program to
100 $PREFIX/bin, documentation to $PREFIX/man, etc. You can
101 specify an installation prefix other than $PREFIX using
102 --prefix, for instance:
103
104         ./configure --prefix=\$HOME
105
106 Fine tuning of some installation directories is available:
107
108         --libdir=DIR            Install libraries to DIR [PREFIX/lib]
109         --includedir=DIR        Install header files to DIR [PREFIX/include]
110         --mandir=DIR            Install man pages to DIR [PREFIX/share/man]
111         --sysconfdir=DIR        Read-only single-machine data [PREFIX/etc]
112         --emacslispdir=DIR      Emacs code [PREFIX/share/emacs/site-lisp]
113         --emacsetcdir=DIR       Emacs miscellaneous files [PREFIX/share/emacs/site-lisp]
114         --bashcompletiondir=DIR Bash completions files [SYSCONFDIR/bash_completion.d]
115         --zshcompletiondir=DIR  Zsh completions files [PREFIX/share/zsh/functions/Completion/Unix]
116
117 Some specific library versions can be specified (auto-detected otherwise):
118
119         --with-gmime-version=VERS       Specify GMIME version (2.4 or 2.6)
120
121 Some features can be disabled (--with-feature=no is equivalent to
122 --without-feature) :
123
124         --without-emacs                 Do not install lisp file
125         --without-bash-completion       Do not install bash completions files
126         --without-zsh-completion        Do not install zsh completions files
127
128 Additional options are accepted for compatibility with other
129 configure-script calling conventions, but don't do anything yet:
130
131         --build=<cpu>-<vendor>-<os>     Currently ignored
132         --host=<cpu>-<vendor>-<os>      Currently ignored
133         --infodir=DIR                   Currently ignored
134         --datadir=DIR                   Currently ignored
135         --localstatedir=DIR             Currently ignored
136         --libexecdir=DIR                Currently ignored
137         --disable-maintainer-mode       Currently ignored
138         --disable-dependency-tracking   Currently ignored
139
140 EOF
141 }
142
143 # Parse command-line options
144 for option; do
145     if [ "${option}" = '--help' ] ; then
146         usage
147         exit 0
148     elif [ "${option%%=*}" = '--prefix' ] ; then
149         PREFIX="${option#*=}"
150     elif [ "${option%%=*}" = '--libdir' ] ; then
151         LIBDIR="${option#*=}"
152     elif [ "${option%%=*}" = '--includedir' ] ; then
153         INCLUDEDIR="${option#*=}"
154     elif [ "${option%%=*}" = '--mandir' ] ; then
155         MANDIR="${option#*=}"
156     elif [ "${option%%=*}" = '--sysconfdir' ] ; then
157         SYSCONFDIR="${option#*=}"
158     elif [ "${option%%=*}" = '--emacslispdir' ] ; then
159         EMACSLISPDIR="${option#*=}"
160     elif [ "${option%%=*}" = '--emacsetcdir' ] ; then
161         EMACSETCDIR="${option#*=}"
162     elif [ "${option%%=*}" = '--bashcompletiondir' ] ; then
163         BASHCOMPLETIONDIR="${option#*=}"
164     elif [ "${option%%=*}" = '--zshcompletiondir' ] ; then
165         ZSHCOMLETIONDIR="${option#*=}"
166     elif [ "${option%%=*}" = '--with-emacs' ]; then
167         if [ "${option#*=}" = 'no' ]; then
168             WITH_EMACS=0
169         else
170             WITH_EMACS=1
171         fi
172     elif [ "${option}" = '--without-emacs' ] ; then
173         WITH_EMACS=0
174     elif [ "${option%%=*}" = '--with-bash-completion' ]; then
175         if [ "${option#*=}" = 'no' ]; then
176             WITH_BASH=0
177         else
178             WITH_BASH=1
179         fi
180     elif [ "${option}" = '--without-bash-completion' ] ; then
181         WITH_BASH=0
182     elif [ "${option%%=*}" = '--with-zsh-completion' ]; then
183         if [ "${option#*=}" = 'no' ]; then
184             WITH_ZSH=0
185         else
186             WITH_ZSH=1
187         fi
188     elif [ "${option}" = '--without-zsh-completion' ] ; then
189         WITH_ZSH=0
190     elif [ "${option%%=*}" = '--with-gmime-version' ] ; then
191         if [ "${option#*=}" = '2.4' ]; then
192              WITH_GMIME_VERSIONS=$GMIME_24_VERSION
193          elif [ "${option#*=}" = '2.6' ]; then
194              WITH_GMIME_VERSIONS=$GMIME_26_VERSION
195         fi
196     elif [ "${option%%=*}" = '--build' ] ; then
197         true
198     elif [ "${option%%=*}" = '--host' ] ; then
199         true
200     elif [ "${option%%=*}" = '--infodir' ] ; then
201         true
202     elif [ "${option%%=*}" = '--datadir' ] ; then
203         true
204     elif [ "${option%%=*}" = '--localstatedir' ] ; then
205         true
206     elif [ "${option%%=*}" = '--libexecdir' ] ; then
207         true
208     elif [ "${option}" = '--disable-maintainer-mode' ] ; then
209         true
210     elif [ "${option}" = '--disable-dependency-tracking' ] ; then
211         true
212     else
213         echo "Unrecognized option: ${option}"
214         echo "See:"
215         echo "  $0 --help"
216         echo ""
217         exit 1
218     fi
219 done
220
221 # We set this value early, (rather than just while printing the
222 # Makefile.config file later like most values), because we need to
223 # actually investigate this value compared to the ldconfig_paths value
224 # below.
225 libdir_expanded=${LIBDIR:-${PREFIX}/lib}
226
227 cat <<EOF
228 Welcome to Notmuch, a system for indexing, searching and tagging your email.
229
230 We hope that the process of building and installing notmuch is quick
231 and smooth so that you can soon be reading and processing your email
232 more efficiently than ever.
233
234 If anything goes wrong in the configure process, you can override any
235 decisions it makes by manually editing the Makefile.config file that
236 it creates. Also please do as much as you can to figure out what could
237 be different on your machine compared to those of the notmuch
238 developers. Then, please email those details to the Notmuch list
239 (notmuch@notmuchmail.org) so that we can hopefully make future
240 versions of notmuch easier for you to use.
241
242 We'll now investigate your system to verify that all required
243 dependencies are available:
244
245 EOF
246
247 errors=0
248
249 if pkg-config --version > /dev/null 2>&1; then
250     have_pkg_config=1
251 else
252     have_pkg_config=0
253 fi
254
255 printf "Checking for Xapian development files... "
256 have_xapian=0
257 for xapian_config in ${XAPIAN_CONFIG}; do
258     if ${xapian_config} --version > /dev/null 2>&1; then
259         printf "Yes (%s).\n" $(${xapian_config} --version | sed -e 's/.* //')
260         have_xapian=1
261         xapian_cxxflags=$(${xapian_config} --cxxflags)
262         xapian_ldflags=$(${xapian_config} --libs)
263         break
264     fi
265 done
266 if [ ${have_xapian} = "0" ]; then
267     printf "No.\n"
268     errors=$((errors + 1))
269 fi
270
271 printf "Checking for GMime development files... "
272 have_gmime=0
273 IFS=';'
274 for gmimepc in $WITH_GMIME_VERSIONS; do
275     if pkg-config --exists $gmimepc; then
276         printf "Yes ($gmimepc).\n"
277         have_gmime=1
278         gmime_cflags=$(pkg-config --cflags $gmimepc)
279         gmime_ldflags=$(pkg-config --libs $gmimepc)
280         break
281     fi
282 done
283 IFS=$DEFAULT_IFS
284 if [ "$have_gmime" = "0" ]; then
285     printf "No.\n"
286     errors=$((errors + 1))
287 fi
288
289 # GMime already depends on Glib >= 2.12, but we use at least one Glib
290 # function that only exists as of 2.22, (g_array_unref)
291 printf "Checking for Glib development files (>= 2.22)... "
292 have_glib=0
293 if pkg-config --exists 'glib-2.0 >= 2.22'; then
294     printf "Yes.\n"
295     have_glib=1
296     glib_cflags=$(pkg-config --cflags glib-2.0)
297     glib_ldflags=$(pkg-config --libs glib-2.0)
298 else
299     printf "No.\n"
300     errors=$((errors + 1))
301 fi
302
303 printf "Checking for talloc development files... "
304 if pkg-config --exists talloc; then
305     printf "Yes.\n"
306     have_talloc=1
307     talloc_cflags=$(pkg-config --cflags talloc)
308     talloc_ldflags=$(pkg-config --libs talloc)
309 else
310     printf "No.\n"
311     have_talloc=0
312     talloc_cflags=
313     errors=$((errors + 1))
314 fi
315
316 printf "Checking for valgrind development files... "
317 if pkg-config --exists valgrind; then
318     printf "Yes.\n"
319     have_valgrind=1
320     valgrind_cflags=$(pkg-config --cflags valgrind)
321 else
322     printf "No (but that's fine).\n"
323     have_valgrind=0
324 fi
325
326 if [ -z "${EMACSLISPDIR}" ]; then
327     if pkg-config --exists emacs; then
328         EMACSLISPDIR=$(pkg-config emacs --variable sitepkglispdir)
329     else
330         EMACSLISPDIR='$(prefix)/share/emacs/site-lisp'
331     fi
332 fi
333
334 if [ -z "${EMACSETCDIR}" ]; then
335     if pkg-config --exists emacs; then
336         EMACSETCDIR=$(pkg-config emacs --variable sitepkglispdir)
337     else
338         EMACSETCDIR='$(prefix)/share/emacs/site-lisp'
339     fi
340 fi
341
342 printf "Checking if emacs is available... "
343 if emacs --quick --batch > /dev/null 2>&1; then
344     printf "Yes.\n"
345     have_emacs=1
346 else
347     printf "No (so will not byte-compile emacs code)\n"
348     have_emacs=0
349 fi
350
351 libdir_in_ldconfig=0
352
353 printf "Checking which platform we are on... "
354 uname=`uname`
355 if [ $uname = "Darwin" ] ; then
356     printf "Mac OS X.\n"
357     platform=MACOSX
358     linker_resolves_library_dependencies=0
359 elif [ $uname = "SunOS" ] ; then
360     printf "Solaris.\n"
361     platform=SOLARIS
362     linker_resolves_library_dependencies=0
363 elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
364     printf "$uname\n"
365     platform="$uname"
366     linker_resolves_library_dependencies=1
367
368     printf "Checking for $libdir_expanded in ldconfig... "
369     ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
370     # Separate ldconfig_paths only on newline (not on any potential
371     # embedded space characters in any filenames). Note, we use a
372     # literal newline in the source here rather than something like:
373     #
374     #   IFS=$(printf '\n')
375     #
376     # because the shell's command substitution deletes any trailing newlines.
377     IFS="
378 "
379     for path in $ldconfig_paths; do
380         if [ "$path" = "$libdir_expanded" ]; then
381             libdir_in_ldconfig=1
382         fi
383     done
384     IFS=$DEFAULT_IFS
385     if [ "$libdir_in_ldconfig" = '0' ]; then
386         printf "No (will set RPATH)\n"
387     else
388         printf "Yes\n"
389     fi
390 else
391     printf "Unknown.\n"
392     cat <<EOF
393
394 *** Warning: Unknown platform. Notmuch might or might not build correctly.
395
396 EOF
397 fi
398
399 if [ $errors -gt 0 ]; then
400     cat <<EOF
401
402 *** Error: The dependencies of notmuch could not be satisfied. You will
403 need to install the following packages before being able to compile
404 notmuch:
405
406 EOF
407     if [ $have_xapian -eq 0 ]; then
408         echo "  Xapian library (including development files such as headers)"
409         echo "  http://xapian.org/"
410     fi
411     if [ $have_gmime -eq 0 ]; then
412         echo "  Either GMime 2.4 library" $GMIME_24_VERSION_CTR "or GMime 2.6 library" $GMIME_26_VERSION_CTR
413         echo "  (including development files such as headers)"
414         echo "  http://spruce.sourceforge.net/gmime/"
415         echo
416     fi
417     if [ $have_glib -eq 0 ]; then
418         echo "  Glib library >= 2.22 (including development files such as headers)"
419         echo "  http://ftp.gnome.org/pub/gnome/sources/glib/"
420         echo
421     fi
422     if [ $have_talloc -eq 0 ]; then
423         echo "  The talloc library (including development files such as headers)"
424         echo "  http://talloc.samba.org/"
425         echo
426     fi
427     cat <<EOF
428 With any luck, you're using a modern, package-based operating system
429 that has all of these packages available in the distribution. In that
430 case a simple command will install everything you need. For example:
431
432 On Debian and similar systems:
433
434         sudo apt-get install libxapian-dev libgmime-2.6-dev libtalloc-dev
435
436 Or on Fedora and similar systems:
437
438         sudo yum install xapian-core-devel gmime-devel libtalloc-devel
439
440 On other systems, similar commands can be used, but the details of the
441 package names may be different.
442
443 EOF
444     if [ $have_pkg_config -eq 0 ]; then
445 cat <<EOF
446 Note: the pkg-config program is not available. This configure script
447 uses pkg-config to find the compilation flags required to link against
448 the various libraries needed by notmuch. It's possible you simply need
449 to install pkg-config with a command such as:
450
451         sudo apt-get install pkg-config
452 Or:
453         sudo yum install pkgconfig
454
455 But if pkg-config is not available for your system, then you will need
456 to modify the configure script to manually set the cflags and ldflags
457 variables to the correct values to link against each library in each
458 case that pkg-config could not be used to determine those values.
459
460 EOF
461     fi
462 cat <<EOF
463 When you have installed the necessary dependencies, you can run
464 configure again to ensure the packages can be found, or simply run
465 "make" to compile notmuch.
466
467 EOF
468     exit 1
469 fi
470
471 printf "Checking for getline... "
472 if ${CC} -o compat/have_getline "$srcdir"/compat/have_getline.c > /dev/null 2>&1
473 then
474     printf "Yes.\n"
475     have_getline=1
476 else
477     printf "No (will use our own instead).\n"
478     have_getline=0
479 fi
480 rm -f compat/have_getline
481
482 printf "Checking for strcasestr... "
483 if ${CC} -o compat/have_strcasestr "$srcdir"/compat/have_strcasestr.c > /dev/null 2>&1
484 then
485     printf "Yes.\n"
486     have_strcasestr=1
487 else
488     printf "No (will use our own instead).\n"
489     have_strcasestr=0
490 fi
491 rm -f compat/have_strcasestr
492
493 printf "int main(void){return 0;}\n" > minimal.c
494
495 printf "Checking for rpath support... "
496 if ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
497 then
498     printf "Yes.\n"
499     rpath_ldflags="-Wl,--enable-new-dtags -Wl,-rpath,\$(libdir)"
500 else
501     printf "No (nothing to worry about).\n"
502     rpath_ldflags=""
503 fi
504
505 printf "Checking for -Wl,--as-needed... "
506 if ${CC} -Wl,--as-needed -o minimal minimal.c >/dev/null 2>&1
507 then
508     printf "Yes.\n"
509     as_needed_ldflags="-Wl,--as-needed"
510 else
511     printf "No (nothing to worry about).\n"
512     as_needed_ldflags=""
513 fi
514
515 WARN_CXXFLAGS=""
516 printf "Checking for available C++ compiler warning flags... "
517 for flag in -Wall -Wextra -Wwrite-strings -Wswitch-enum; do
518     if ${CC} $flag -o minimal minimal.c > /dev/null 2>&1
519     then
520         WARN_CXXFLAGS="${WARN_CXXFLAGS}${WARN_CXXFLAGS:+ }${flag}"
521     fi
522 done
523 printf "\n\t${WARN_CXXFLAGS}\n"
524
525 WARN_CFLAGS="${WARN_CXXFLAGS}"
526 printf "Checking for available C compiler warning flags... "
527 for flag in -Wmissing-declarations; do
528     if ${CC} $flag -o minimal minimal.c > /dev/null 2>&1
529     then
530         WARN_CFLAGS="${WARN_CFLAGS}${WARN_CFLAGS:+ }${flag}"
531     fi
532 done
533 printf "\n\t${WARN_CFLAGS}\n"
534
535 rm -f minimal minimal.c
536
537 cat <<EOF
538
539 All required packages were found. You may now run the following
540 commands to compile and install notmuch:
541
542         make
543         sudo make install
544
545 EOF
546
547 # construct the Makefile.config
548 cat > Makefile.config <<EOF
549 # This Makefile.config was automatically generated by the ./configure
550 # script of notmuch. If the configure script identified anything
551 # incorrectly, then you can edit this file to try to correct things,
552 # but be warned that if configure is run again it will destroy your
553 # changes, (and this could happen by simply calling "make" if the
554 # configure script is updated).
555
556 # The top-level directory for the source, (the directory containing
557 # the configure script). This may be different than the build
558 # directory (the current directory at the time configure was run).
559 srcdir = ${srcdir}
560
561 configure_options = $@
562
563 # We use vpath directives (rather than the VPATH variable) since the
564 # VPATH variable matches targets as well as prerequisites, (which is
565 # not useful since then a target left-over from a srcdir build would
566 # cause a target to not be built in the non-srcdir build).
567 #
568 # Also, we don't use a single "vpath % \$(srcdir)" here because we
569 # don't want the vpath to trigger for our emacs lisp compilation,
570 # (unless we first find a way to convince emacs to build the .elc
571 # target in a directory other than the directory of the .el
572 # prerequisite). In the meantime, we're actually copying in the .el
573 # files, (which is quite ugly).
574 vpath %.c \$(srcdir)
575 vpath %.cc \$(srcdir)
576 vpath %.1 \$(srcdir)
577 vpath Makefile.% \$(srcdir)
578
579 # The C compiler to use
580 CC = ${CC}
581
582 # The C++ compiler to use
583 CXX = ${CXX}
584
585 # Command to execute emacs from Makefiles
586 EMACS = emacs --quick
587
588 # Default FLAGS for C compiler (can be overridden by user such as "make CFLAGS=-g")
589 CFLAGS = ${CFLAGS}
590
591 # Default FLAGS for C++ compiler (can be overridden by user such as "make CXXFLAGS=-g")
592 CXXFLAGS = ${CXXFLAGS}
593
594 # Default FLAGS for the linker (can be overridden by user such as "make LDFLAGS=-znow")
595 LDFLAGS = ${LDFLAGS}
596
597 # Flags to enable warnings when using the C++ compiler
598 WARN_CXXFLAGS=${WARN_CXXFLAGS}
599
600 # Flags to enable warnings when using the C compiler
601 WARN_CFLAGS=${WARN_CFLAGS}
602
603 # The prefix to which notmuch should be installed
604 # Note: If you change this value here, be sure to ensure that the
605 # LIBDIR_IN_LDCONFIG value below is still set correctly.
606 prefix = ${PREFIX}
607
608 # The directory to which libraries should be installed
609 # Note: If you change this value here, be sure to ensure that the
610 # LIBDIR_IN_LDCONFIG value below is still set correctly.
611 libdir = ${LIBDIR:=\$(prefix)/lib}
612
613 # Whether libdir is in a path configured into ldconfig
614 LIBDIR_IN_LDCONFIG = ${libdir_in_ldconfig}
615
616 # The directory to which header files should be installed
617 includedir = ${INCLUDEDIR:=\$(prefix)/include}
618
619 # The directory to which man pages should be installed
620 mandir = ${MANDIR:=\$(prefix)/share/man}
621
622 # The directory to which read-only (configuration) files should be installed
623 sysconfdir = ${SYSCONFDIR:=\$(prefix)/etc}
624
625 # The directory to which emacs lisp files should be installed
626 emacslispdir=${EMACSLISPDIR}
627
628 # The directory to which emacs miscellaneous (machine-independent) files should
629 # be installed
630 emacsetcdir=${EMACSETCDIR}
631
632 # Whether there's an emacs binary available for byte-compiling
633 HAVE_EMACS = ${have_emacs}
634
635 # The directory to which desktop files should be installed
636 desktop_dir = \$(prefix)/share/applications
637
638 # The directory to which bash completions files should be installed
639 bash_completion_dir = ${BASHCOMPLETIONDIR:=\$(sysconfdir)/bash_completion.d}
640
641 # The directory to which zsh completions files should be installed
642 zsh_completion_dir = ${ZSHCOMLETIONDIR:=\$(prefix)/share/zsh/functions/Completion/Unix}
643
644 # Whether the getline function is available (if not, then notmuch will
645 # build its own version)
646 HAVE_GETLINE = ${have_getline}
647
648 # Whether the strcasestr function is available (if not, then notmuch will
649 # build its own version)
650 HAVE_STRCASESTR = ${have_strcasestr}
651
652 # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS
653 PLATFORM = ${platform}
654
655 # Whether the linker will automatically resolve the dependency of one
656 # library on another (if not, then linking a binary requires linking
657 # directly against both)
658 LINKER_RESOLVES_LIBRARY_DEPENDENCIES = ${linker_resolves_library_dependencies}
659
660 # Flags needed to compile and link against Xapian
661 XAPIAN_CXXFLAGS = ${xapian_cxxflags}
662 XAPIAN_LDFLAGS = ${xapian_ldflags}
663
664 # Flags needed to compile and link against GMime-2.4
665 GMIME_CFLAGS = ${gmime_cflags}
666 GMIME_LDFLAGS = ${gmime_ldflags}
667
668 # Flags needed to compile and link against talloc
669 TALLOC_CFLAGS = ${talloc_cflags}
670 TALLOC_LDFLAGS = ${talloc_ldflags}
671
672 # Flags needed to have linker set rpath attribute
673 RPATH_LDFLAGS = ${rpath_ldflags}
674
675 # Flags needed to have linker link only to necessary libraries
676 AS_NEEDED_LDFLAGS = ${as_needed_ldflags}
677
678 # Whether valgrind header files are available
679 HAVE_VALGRIND = ${have_valgrind}
680
681 # And if so, flags needed at compile time for valgrind macros
682 VALGRIND_CFLAGS = ${valgrind_cflags}
683
684 # Support for emacs
685 WITH_EMACS = ${WITH_EMACS}
686
687 # Support for bash completion
688 WITH_BASH = ${WITH_BASH}
689
690 # Support for zsh completion
691 WITH_ZSH = ${WITH_ZSH}
692
693 # Combined flags for compiling and linking against all of the above
694 CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)      \\
695                    \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND)   \\
696                    \$(VALGRIND_CFLAGS) -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)
697 CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)    \\
698                      \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
699                      \$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS)             \\
700                      -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)
701 CONFIGURE_LDFLAGS =  \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(XAPIAN_LDFLAGS)
702 EOF