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