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