3 # Test whether this shell is capable of parameter substring processing.
4 ( option='a/b'; : ${option#*/} ) 2>/dev/null || {
6 The shell interpreting '$0' is lacking some required features.
8 To work around this problem you may try to execute:
17 # Store original IFS value so it can be changed (and restored) in many places.
18 readonly DEFAULT_IFS="$IFS"
20 srcdir=$(dirname "$0")
22 subdirs="util compat lib parse-time-string completion doc emacs"
23 subdirs="${subdirs} performance-test test test/test-databases"
25 # For a non-srcdir configure invocation (such as ../configure), create
26 # the directory structure and copy Makefiles.
27 if [ "$srcdir" != "." ]; then
29 for dir in . ${subdirs}; do
31 cp "$srcdir"/"$dir"/Makefile.local "$dir"
32 cp "$srcdir"/"$dir"/Makefile "$dir"
35 # Easiest way to get the test suite to work is to just copy the
36 # whole thing into the build directory.
37 cp -a "$srcdir"/test/* test
39 # Emacs only likes to generate compiled files next to the .el files
40 # by default so copy these as well (which is not ideal0.
41 cp -a "$srcdir"/emacs/*.el emacs
44 # Set several defaults (optionally specified by the user in
45 # environment variables)
48 CFLAGS=${CFLAGS:--g -O2}
49 CPPFLAGS=${CPPFLAGS:-}
50 CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}
51 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
53 XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}
56 # We don't allow the EMACS or GZIP Makefile variables inherit values
57 # from the environment as we do with CC and CXX above. The reason is
58 # that these names as environment variables have existing uses other
59 # than the program name that we want. (EMACS is set to 't' when a
60 # shell is running within emacs and GZIP specifies arguments to pass
61 # on the gzip command line).
63 # Set the defaults for values the user can specify with command-line
71 # Compatible GMime versions (with constraints).
72 # If using GMime 2.6, we need to have a version >= 2.6.5 to avoid a
73 # crypto bug. We need 2.6.7 for permissive "From " header handling.
74 GMIME_24_VERSION_CTR=''
75 GMIME_24_VERSION="gmime-2.4 $GMIME_24_VERSION_CTR"
76 GMIME_26_VERSION_CTR='>= 2.6.7'
77 GMIME_26_VERSION="gmime-2.6 $GMIME_26_VERSION_CTR"
79 WITH_GMIME_VERSIONS="$GMIME_26_VERSION;$GMIME_24_VERSION"
84 Usage: ./configure [options]...
86 This script configures notmuch to build on your system.
88 It verifies that dependencies are available, determines flags needed
89 to compile and link against various required libraries, and identifies
90 whether various system functions can be used or if locally-provided
91 replacements will be built instead.
93 Finally, it allows you to control various aspects of the build and
96 First, some common variables can specified via environment variables:
98 CC The C compiler to use
99 CFLAGS Flags to pass to the C compiler
100 CPPFLAGS Flags to pass to the C preprocessor
101 CXX The C++ compiler to use
102 CXXFLAGS Flags to pass to the C compiler
103 LDFLAGS Flags to pass when linking
105 Each of these values can further be controlled by specifying them
106 later on the "make" command line.
108 Other environment variables can be used to control configure itself,
109 (and for which there is no equivalent build-time control):
111 XAPIAN_CONFIG The program to use to determine flags for
112 compiling and linking against the Xapian
113 library. [$XAPIAN_CONFIG]
115 Additionally, various options can be specified on the configure
118 --prefix=PREFIX Install files in PREFIX [$PREFIX]
120 By default, "make install" will install the resulting program to
121 $PREFIX/bin, documentation to $PREFIX/man, etc. You can
122 specify an installation prefix other than $PREFIX using
123 --prefix, for instance:
125 ./configure --prefix=\$HOME
127 Fine tuning of some installation directories is available:
129 --libdir=DIR Install libraries to DIR [PREFIX/lib]
130 --includedir=DIR Install header files to DIR [PREFIX/include]
131 --mandir=DIR Install man pages to DIR [PREFIX/share/man]
132 --sysconfdir=DIR Read-only single-machine data [PREFIX/etc]
133 --emacslispdir=DIR Emacs code [PREFIX/share/emacs/site-lisp]
134 --emacsetcdir=DIR Emacs miscellaneous files [PREFIX/share/emacs/site-lisp]
135 --bashcompletiondir=DIR Bash completions files [SYSCONFDIR/bash_completion.d]
136 --zshcompletiondir=DIR Zsh completions files [PREFIX/share/zsh/functions/Completion/Unix]
138 Some specific library versions can be specified (auto-detected otherwise):
140 --with-gmime-version=VERS Specify GMIME version (2.4 or 2.6)
142 Some features can be disabled (--with-feature=no is equivalent to
145 --without-emacs Do not install lisp file
146 --without-bash-completion Do not install bash completions files
147 --without-zsh-completion Do not install zsh completions files
149 Additional options are accepted for compatibility with other
150 configure-script calling conventions, but don't do anything yet:
152 --build=<cpu>-<vendor>-<os> Currently ignored
153 --host=<cpu>-<vendor>-<os> Currently ignored
154 --infodir=DIR Currently ignored
155 --datadir=DIR Currently ignored
156 --localstatedir=DIR Currently ignored
157 --libexecdir=DIR Currently ignored
158 --disable-maintainer-mode Currently ignored
159 --disable-dependency-tracking Currently ignored
164 # Parse command-line options
166 if [ "${option}" = '--help' ] ; then
169 elif [ "${option%%=*}" = '--prefix' ] ; then
170 PREFIX="${option#*=}"
171 elif [ "${option%%=*}" = '--libdir' ] ; then
172 LIBDIR="${option#*=}"
173 elif [ "${option%%=*}" = '--includedir' ] ; then
174 INCLUDEDIR="${option#*=}"
175 elif [ "${option%%=*}" = '--mandir' ] ; then
176 MANDIR="${option#*=}"
177 elif [ "${option%%=*}" = '--sysconfdir' ] ; then
178 SYSCONFDIR="${option#*=}"
179 elif [ "${option%%=*}" = '--emacslispdir' ] ; then
180 EMACSLISPDIR="${option#*=}"
181 elif [ "${option%%=*}" = '--emacsetcdir' ] ; then
182 EMACSETCDIR="${option#*=}"
183 elif [ "${option%%=*}" = '--bashcompletiondir' ] ; then
184 BASHCOMPLETIONDIR="${option#*=}"
185 elif [ "${option%%=*}" = '--zshcompletiondir' ] ; then
186 ZSHCOMLETIONDIR="${option#*=}"
187 elif [ "${option%%=*}" = '--with-emacs' ]; then
188 if [ "${option#*=}" = 'no' ]; then
193 elif [ "${option}" = '--without-emacs' ] ; then
195 elif [ "${option%%=*}" = '--with-bash-completion' ]; then
196 if [ "${option#*=}" = 'no' ]; then
201 elif [ "${option}" = '--without-bash-completion' ] ; then
203 elif [ "${option%%=*}" = '--with-zsh-completion' ]; then
204 if [ "${option#*=}" = 'no' ]; then
209 elif [ "${option}" = '--without-zsh-completion' ] ; then
211 elif [ "${option%%=*}" = '--with-gmime-version' ] ; then
212 if [ "${option#*=}" = '2.4' ]; then
213 WITH_GMIME_VERSIONS=$GMIME_24_VERSION
214 elif [ "${option#*=}" = '2.6' ]; then
215 WITH_GMIME_VERSIONS=$GMIME_26_VERSION
217 elif [ "${option%%=*}" = '--build' ] ; then
219 elif [ "${option%%=*}" = '--host' ] ; then
221 elif [ "${option%%=*}" = '--infodir' ] ; then
223 elif [ "${option%%=*}" = '--datadir' ] ; then
225 elif [ "${option%%=*}" = '--localstatedir' ] ; then
227 elif [ "${option%%=*}" = '--libexecdir' ] ; then
229 elif [ "${option}" = '--disable-maintainer-mode' ] ; then
231 elif [ "${option}" = '--disable-dependency-tracking' ] ; then
234 echo "Unrecognized option: ${option}"
242 # We set this value early, (rather than just while printing the
243 # Makefile.config file later like most values), because we need to
244 # actually investigate this value compared to the ldconfig_paths value
246 if [ -z "$LIBDIR" ] ; then
247 libdir_expanded="${PREFIX}/lib"
249 # very non-general variable expansion
250 libdir_expanded=`echo "$LIBDIR" | sed "s|\\${prefix}|${PREFIX}|g; s|\\$prefix/|${PREFIX}/|; s|//*|/|g"`
254 Welcome to Notmuch, a system for indexing, searching and tagging your email.
256 We hope that the process of building and installing notmuch is quick
257 and smooth so that you can soon be reading and processing your email
258 more efficiently than ever.
260 If anything goes wrong in the configure process, you can override any
261 decisions it makes by manually editing the Makefile.config file that
262 it creates. Also please do as much as you can to figure out what could
263 be different on your machine compared to those of the notmuch
264 developers. Then, please email those details to the Notmuch list
265 (notmuch@notmuchmail.org) so that we can hopefully make future
266 versions of notmuch easier for you to use.
268 We'll now investigate your system to verify that all required
269 dependencies are available:
274 printf "int main(void){return 0;}\n" > minimal.c
276 printf "Sanity checking C compilation environment... "
277 if ${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
282 errors=$((errors + 1))
285 printf "Sanity checking C++ compilation environment... "
286 if ${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal > /dev/null 2>&1
291 errors=$((errors + 1))
294 if [ $errors -gt 0 ]; then
296 *** Error: Initial sanity checking of environment failed. Please try
297 running configure in a clean environment, and if the problem persists,
300 rm -f minimal minimal.c
304 if pkg-config --version > /dev/null 2>&1; then
310 printf "Checking for Xapian development files... "
312 for xapian_config in ${XAPIAN_CONFIG}; do
313 if ${xapian_config} --version > /dev/null 2>&1; then
314 xapian_version=$(${xapian_config} --version | sed -e 's/.* //')
315 printf "Yes (%s).\n" ${xapian_version}
317 xapian_cxxflags=$(${xapian_config} --cxxflags)
318 xapian_ldflags=$(${xapian_config} --libs)
322 if [ ${have_xapian} = "0" ]; then
324 errors=$((errors + 1))
327 # Compaction is only supported on Xapian > 1.2.6
328 have_xapian_compact=0
329 if [ ${have_xapian} = "1" ]; then
330 printf "Checking for Xapian compaction support... "
331 case "${xapian_version}" in
332 0.*|1.[01].*|1.2.[0-5])
333 printf "No (only available with Xapian > 1.2.6).\n" ;;
334 [1-9]*.[0-9]*.[0-9]*)
335 have_xapian_compact=1
338 printf "Unknown version.\n" ;;
342 printf "Checking for GMime development files... "
345 for gmimepc in $WITH_GMIME_VERSIONS; do
346 if pkg-config --exists $gmimepc; then
347 printf "Yes ($gmimepc).\n"
349 gmime_cflags=$(pkg-config --cflags $gmimepc)
350 gmime_ldflags=$(pkg-config --libs $gmimepc)
355 if [ "$have_gmime" = "0" ]; then
357 errors=$((errors + 1))
360 # GMime already depends on Glib >= 2.12, but we use at least one Glib
361 # function that only exists as of 2.22, (g_array_unref)
362 printf "Checking for Glib development files (>= 2.22)... "
364 if pkg-config --exists 'glib-2.0 >= 2.22'; then
367 glib_cflags=$(pkg-config --cflags glib-2.0)
368 glib_ldflags=$(pkg-config --libs glib-2.0)
371 errors=$((errors + 1))
374 if ! pkg-config --exists zlib; then
375 ${CC} ${zlib_cflags} -o compat/gen_zlib_pc \
376 "$srcdir"/compat/gen_zlib_pc.c ${zlib_ldflags} > /dev/null 2>&1 &&
377 compat/gen_zlib_pc > compat/zlib.pc &&
378 PKG_CONFIG_PATH="$PKG_CONFIG_PATH":compat &&
379 export PKG_CONFIG_PATH
380 rm -f compat/gen_zlib_pc
383 printf "Checking for zlib (>= 1.2.5.2)... "
385 if pkg-config --atleast-version=1.2.5.2 zlib; then
388 zlib_cflags=$(pkg-config --cflags zlib)
389 zlib_ldflags=$(pkg-config --libs zlib)
392 errors=$((errors + 1))
395 printf "Checking for talloc development files... "
396 if pkg-config --exists talloc; then
399 talloc_cflags=$(pkg-config --cflags talloc)
400 talloc_ldflags=$(pkg-config --libs talloc)
405 errors=$((errors + 1))
408 printf "Checking for python... "
411 for name in ${PYTHON} python python2 python3; do
412 if command -v $name > /dev/null; then
415 printf "Yes ($name).\n"
420 if [ $have_python -eq 0 ]; then
422 errors=$((errors + 1))
425 printf "Checking for valgrind development files... "
426 if pkg-config --exists valgrind; then
429 valgrind_cflags=$(pkg-config --cflags valgrind)
431 printf "No (but that's fine).\n"
435 printf "Checking for bash-completion (>= 1.90)... "
436 if pkg-config --atleast-version=1.90 bash-completion; then
439 printf "No (will not install bash completion).\n"
443 if [ -z "${EMACSLISPDIR}" ]; then
444 if pkg-config --exists emacs; then
445 EMACSLISPDIR=$(pkg-config emacs --variable sitepkglispdir)
447 EMACSLISPDIR='$(prefix)/share/emacs/site-lisp'
451 if [ -z "${EMACSETCDIR}" ]; then
452 if pkg-config --exists emacs; then
453 EMACSETCDIR=$(pkg-config emacs --variable sitepkglispdir)
455 EMACSETCDIR='$(prefix)/share/emacs/site-lisp'
459 printf "Checking if emacs is available... "
460 if emacs --quick --batch > /dev/null 2>&1; then
464 printf "No (so will not byte-compile emacs code)\n"
468 printf "Checking if doxygen is available... "
469 if command -v doxygen > /dev/null; then
473 printf "No (so will not install api docs)\n"
477 printf "Checking if sphinx is available and supports nroff output... "
478 if command -v sphinx-build > /dev/null && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then
482 printf "No (so will not install man pages).\n"
488 printf "Checking which platform we are on... "
490 if [ $uname = "Darwin" ] ; then
493 linker_resolves_library_dependencies=0
494 elif [ $uname = "SunOS" ] ; then
497 linker_resolves_library_dependencies=0
498 elif [ $uname = "FreeBSD" ] ; then
501 linker_resolves_library_dependencies=0
502 elif [ $uname = "OpenBSD" ] ; then
505 linker_resolves_library_dependencies=0
506 elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
509 linker_resolves_library_dependencies=1
511 printf "Checking for $libdir_expanded in ldconfig... "
512 ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
513 # Separate ldconfig_paths only on newline (not on any potential
514 # embedded space characters in any filenames). Note, we use a
515 # literal newline in the source here rather than something like:
519 # because the shell's command substitution deletes any trailing newlines.
522 for path in $ldconfig_paths; do
523 if [ "$path" = "$libdir_expanded" ]; then
528 if [ "$libdir_in_ldconfig" = '0' ]; then
529 printf "No (will set RPATH)\n"
537 *** Warning: Unknown platform. Notmuch might or might not build correctly.
542 printf "Checking byte order... "
543 cat> _byteorder.c <<EOF
546 uint32_t test = 0x34333231;
547 int main() { printf("%.4s\n", (const char*)&test); return 0; }
549 ${CC} ${CFLAGS} _byteorder.c -o _byteorder > /dev/null 2>&1
550 util_byte_order=$(./_byteorder)
551 echo $util_byte_order
553 rm -f _byteorder _byteorder.c
555 if [ $errors -gt 0 ]; then
558 *** Error: The dependencies of notmuch could not be satisfied. You will
559 need to install the following packages before being able to compile
563 if [ $have_python -eq 0 ]; then
564 echo " python interpreter"
566 if [ $have_xapian -eq 0 ]; then
567 echo " Xapian library (including development files such as headers)"
568 echo " http://xapian.org/"
570 if [ $have_zlib -eq 0 ]; then
571 echo " zlib library (>= version 1.2.5.2, including development files such as headers)"
572 echo " http://zlib.net/"
575 if [ $have_gmime -eq 0 ]; then
576 echo " Either GMime 2.4 library" $GMIME_24_VERSION_CTR "or GMime 2.6 library" $GMIME_26_VERSION_CTR
577 echo " (including development files such as headers)"
578 echo " http://spruce.sourceforge.net/gmime/"
581 if [ $have_glib -eq 0 ]; then
582 echo " Glib library >= 2.22 (including development files such as headers)"
583 echo " http://ftp.gnome.org/pub/gnome/sources/glib/"
586 if [ $have_talloc -eq 0 ]; then
587 echo " The talloc library (including development files such as headers)"
588 echo " http://talloc.samba.org/"
592 With any luck, you're using a modern, package-based operating system
593 that has all of these packages available in the distribution. In that
594 case a simple command will install everything you need. For example:
596 On Debian and similar systems:
598 sudo apt-get install libxapian-dev libgmime-2.6-dev libtalloc-dev zlib1g-dev
600 Or on Fedora and similar systems:
602 sudo yum install xapian-core-devel gmime-devel libtalloc-devel zlib-devel
604 On other systems, similar commands can be used, but the details of the
605 package names may be different.
608 if [ $have_pkg_config -eq 0 ]; then
610 Note: the pkg-config program is not available. This configure script
611 uses pkg-config to find the compilation flags required to link against
612 the various libraries needed by notmuch. It's possible you simply need
613 to install pkg-config with a command such as:
615 sudo apt-get install pkg-config
617 sudo yum install pkgconfig
619 But if pkg-config is not available for your system, then you will need
620 to modify the configure script to manually set the cflags and ldflags
621 variables to the correct values to link against each library in each
622 case that pkg-config could not be used to determine those values.
627 When you have installed the necessary dependencies, you can run
628 configure again to ensure the packages can be found, or simply run
629 "make" to compile notmuch.
635 printf "Checking for canonicalize_file_name... "
636 if ${CC} -o compat/have_canonicalize_file_name "$srcdir"/compat/have_canonicalize_file_name.c > /dev/null 2>&1
639 have_canonicalize_file_name=1
641 printf "No (will use our own instead).\n"
642 have_canonicalize_file_name=0
644 rm -f compat/have_canonicalize_file_name
647 printf "Checking for getline... "
648 if ${CC} -o compat/have_getline "$srcdir"/compat/have_getline.c > /dev/null 2>&1
653 printf "No (will use our own instead).\n"
656 rm -f compat/have_getline
658 printf "Checking for strcasestr... "
659 if ${CC} -o compat/have_strcasestr "$srcdir"/compat/have_strcasestr.c > /dev/null 2>&1
664 printf "No (will use our own instead).\n"
667 rm -f compat/have_strcasestr
669 printf "Checking for strsep... "
670 if ${CC} -o compat/have_strsep "$srcdir"/compat/have_strsep.c > /dev/null 2>&1
675 printf "No (will use our own instead).\n"
678 rm -f compat/have_strsep
680 printf "Checking for timegm... "
681 if ${CC} -o compat/have_timegm "$srcdir"/compat/have_timegm.c > /dev/null 2>&1
686 printf "No (will use our own instead).\n"
689 rm -f compat/have_timegm
691 printf "Checking for dirent.d_type... "
692 if ${CC} -o compat/have_d_type "$srcdir"/compat/have_d_type.c > /dev/null 2>&1
697 printf "No (will use stat instead).\n"
700 rm -f compat/have_d_type
702 printf "Checking for standard version of getpwuid_r... "
703 if ${CC} -o compat/check_getpwuid "$srcdir"/compat/check_getpwuid.c > /dev/null 2>&1
708 printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"
711 rm -f compat/check_getpwuid
713 printf "Checking for standard version of asctime_r... "
714 if ${CC} -o compat/check_asctime "$srcdir"/compat/check_asctime.c > /dev/null 2>&1
719 printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"
722 rm -f compat/check_asctime
724 printf "Checking for rpath support... "
725 if ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
728 rpath_ldflags="-Wl,--enable-new-dtags -Wl,-rpath,\$(libdir)"
730 printf "No (nothing to worry about).\n"
734 printf "Checking for -Wl,--as-needed... "
735 if ${CC} -Wl,--as-needed -o minimal minimal.c >/dev/null 2>&1
738 as_needed_ldflags="-Wl,--as-needed"
740 printf "No (nothing to worry about).\n"
745 printf "Checking for available C++ compiler warning flags... "
746 for flag in -Wall -Wextra -Wwrite-strings; do
747 if ${CC} $flag -o minimal minimal.c > /dev/null 2>&1
749 WARN_CXXFLAGS="${WARN_CXXFLAGS}${WARN_CXXFLAGS:+ }${flag}"
752 printf "\n\t${WARN_CXXFLAGS}\n"
754 WARN_CFLAGS="${WARN_CXXFLAGS}"
755 printf "Checking for available C compiler warning flags... "
756 for flag in -Wmissing-declarations; do
757 if ${CC} $flag -o minimal minimal.c > /dev/null 2>&1
759 WARN_CFLAGS="${WARN_CFLAGS}${WARN_CFLAGS:+ }${flag}"
762 printf "\n\t${WARN_CFLAGS}\n"
764 rm -f minimal minimal.c
766 # construct the Makefile.config
767 cat > Makefile.config <<EOF
768 # This Makefile.config was automatically generated by the ./configure
769 # script of notmuch. If the configure script identified anything
770 # incorrectly, then you can edit this file to try to correct things,
771 # but be warned that if configure is run again it will destroy your
772 # changes, (and this could happen by simply calling "make" if the
773 # configure script is updated).
775 # The top-level directory for the source, (the directory containing
776 # the configure script). This may be different than the build
777 # directory (the current directory at the time configure was run).
780 # subdirectories to build
783 configure_options = $@
785 # We use vpath directives (rather than the VPATH variable) since the
786 # VPATH variable matches targets as well as prerequisites, (which is
787 # not useful since then a target left-over from a srcdir build would
788 # cause a target to not be built in the non-srcdir build).
790 # Also, we don't use a single "vpath % \$(srcdir)" here because we
791 # don't want the vpath to trigger for our emacs lisp compilation,
792 # (unless we first find a way to convince emacs to build the .elc
793 # target in a directory other than the directory of the .el
794 # prerequisite). In the meantime, we're actually copying in the .el
795 # files, (which is quite ugly).
797 vpath %.cc \$(srcdir)
798 vpath Makefile.% \$(srcdir)
799 vpath %.py \$(srcdir)
800 vpath %.rst \$(srcdir)
802 # The C compiler to use
805 # The C++ compiler to use
808 # Command to execute emacs from Makefiles
809 EMACS = emacs --quick
811 # Default FLAGS for C compiler (can be overridden by user such as "make CFLAGS=-g")
814 # Default FLAGS for C preprocessor (can be overridden by user such as "make CPPFLAGS=-I/usr/local/include")
815 CPPFLAGS = ${CPPFLAGS}
817 # Default FLAGS for C++ compiler (can be overridden by user such as "make CXXFLAGS=-g")
818 CXXFLAGS = ${CXXFLAGS}
820 # Default FLAGS for the linker (can be overridden by user such as "make LDFLAGS=-znow")
823 # Flags to enable warnings when using the C++ compiler
824 WARN_CXXFLAGS=${WARN_CXXFLAGS}
826 # Flags to enable warnings when using the C compiler
827 WARN_CFLAGS=${WARN_CFLAGS}
829 # Name of python interpreter
832 # The prefix to which notmuch should be installed
833 # Note: If you change this value here, be sure to ensure that the
834 # LIBDIR_IN_LDCONFIG value below is still set correctly.
837 # The directory to which libraries should be installed
838 # Note: If you change this value here, be sure to ensure that the
839 # LIBDIR_IN_LDCONFIG value below is still set correctly.
840 libdir = ${LIBDIR:=\$(prefix)/lib}
842 # byte order within a 32 bit word. 1234 = little, 4321 = big, 0 = guess
843 UTIL_BYTE_ORDER = ${util_byte_order}
845 # Whether libdir is in a path configured into ldconfig
846 LIBDIR_IN_LDCONFIG = ${libdir_in_ldconfig}
848 # The directory to which header files should be installed
849 includedir = ${INCLUDEDIR:=\$(prefix)/include}
851 # The directory to which man pages should be installed
852 mandir = ${MANDIR:=\$(prefix)/share/man}
854 # The directory to which read-only (configuration) files should be installed
855 sysconfdir = ${SYSCONFDIR:=\$(prefix)/etc}
857 # The directory to which emacs lisp files should be installed
858 emacslispdir=${EMACSLISPDIR}
860 # The directory to which emacs miscellaneous (machine-independent) files should
862 emacsetcdir=${EMACSETCDIR}
864 # Whether there's an emacs binary available for byte-compiling
865 HAVE_EMACS = ${have_emacs}
867 # Whether there's a sphinx-build binary available for building documentation
868 HAVE_SPHINX=${have_sphinx}
870 # Whether there's a doxygen binary available for building api documentation
871 HAVE_DOXYGEN=${have_doxygen}
873 # The directory to which desktop files should be installed
874 desktop_dir = \$(prefix)/share/applications
876 # The directory to which bash completions files should be installed
877 bash_completion_dir = ${BASHCOMPLETIONDIR:=\$(sysconfdir)/bash_completion.d}
879 # The directory to which zsh completions files should be installed
880 zsh_completion_dir = ${ZSHCOMLETIONDIR:=\$(prefix)/share/zsh/functions/Completion/Unix}
882 # Whether the canonicalize_file_name function is available (if not, then notmuch will
883 # build its own version)
884 HAVE_CANONICALIZE_FILE_NAME = ${have_canonicalize_file_name}
886 # Whether the getline function is available (if not, then notmuch will
887 # build its own version)
888 HAVE_GETLINE = ${have_getline}
890 # Whether the strcasestr function is available (if not, then notmuch will
891 # build its own version)
892 HAVE_STRCASESTR = ${have_strcasestr}
894 # Whether the strsep function is available (if not, then notmuch will
895 # build its own version)
896 HAVE_STRSEP = ${have_strsep}
898 # Whether struct dirent has d_type (if not, then notmuch will use stat)
899 HAVE_D_TYPE = ${have_d_type}
901 # Whether the Xapian version in use supports compaction
902 HAVE_XAPIAN_COMPACT = ${have_xapian_compact}
904 # Whether the getpwuid_r function is standards-compliant
905 # (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS
906 # to enable the standards-compliant version -- needed for Solaris)
907 STD_GETPWUID = ${std_getpwuid}
909 # Whether the asctime_r function is standards-compliant
910 # (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS
911 # to enable the standards-compliant version -- needed for Solaris)
912 STD_ASCTIME = ${std_asctime}
914 # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD, OPENBSD
915 PLATFORM = ${platform}
917 # Whether the linker will automatically resolve the dependency of one
918 # library on another (if not, then linking a binary requires linking
919 # directly against both)
920 LINKER_RESOLVES_LIBRARY_DEPENDENCIES = ${linker_resolves_library_dependencies}
922 # Flags needed to compile and link against Xapian
923 XAPIAN_CXXFLAGS = ${xapian_cxxflags}
924 XAPIAN_LDFLAGS = ${xapian_ldflags}
926 # Flags needed to compile and link against GMime-2.4
927 GMIME_CFLAGS = ${gmime_cflags}
928 GMIME_LDFLAGS = ${gmime_ldflags}
930 # Flags needed to compile and link against zlib
931 ZLIB_CFLAGS = ${zlib_cflags}
932 ZLIB_LDFLAGS = ${zlib_ldflags}
934 # Flags needed to compile and link against talloc
935 TALLOC_CFLAGS = ${talloc_cflags}
936 TALLOC_LDFLAGS = ${talloc_ldflags}
938 # Flags needed to have linker set rpath attribute
939 RPATH_LDFLAGS = ${rpath_ldflags}
941 # Flags needed to have linker link only to necessary libraries
942 AS_NEEDED_LDFLAGS = ${as_needed_ldflags}
944 # Whether valgrind header files are available
945 HAVE_VALGRIND = ${have_valgrind}
947 # And if so, flags needed at compile time for valgrind macros
948 VALGRIND_CFLAGS = ${valgrind_cflags}
951 WITH_EMACS = ${WITH_EMACS}
953 # Support for bash completion
954 WITH_BASH = ${WITH_BASH}
956 # Support for zsh completion
957 WITH_ZSH = ${WITH_ZSH}
959 # Combined flags for compiling and linking against all of the above
960 CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
961 -DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
963 \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
964 \$(VALGRIND_CFLAGS) \\
965 -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
966 -DHAVE_STRSEP=\$(HAVE_STRSEP) \\
967 -DHAVE_D_TYPE=\$(HAVE_D_TYPE) \\
968 -DSTD_GETPWUID=\$(STD_GETPWUID) \\
969 -DSTD_ASCTIME=\$(STD_ASCTIME) \\
970 -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\
971 -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)
973 CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
974 -DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
976 \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
977 \$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS) \\
978 -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
979 -DHAVE_STRSEP=\$(HAVE_STRSEP) \\
980 -DHAVE_D_TYPE=\$(HAVE_D_TYPE) \\
981 -DSTD_GETPWUID=\$(STD_GETPWUID) \\
982 -DSTD_ASCTIME=\$(STD_ASCTIME) \\
983 -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\
984 -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)
986 CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS)
989 # construct the sh.config
990 cat > sh.config <<EOF
991 # This sh.config was automatically generated by the ./configure
994 # Whether the Xapian version in use supports compaction
995 NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact}
997 # do we have man pages?
998 NOTMUCH_HAVE_MAN=$((have_sphinx))
1000 # Name of python interpreter
1001 NOTMUCH_PYTHON=${python}
1004 # Finally, after everything configured, inform the user how to continue.
1007 All required packages were found. You may now run the following
1008 commands to compile and install notmuch: