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