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