5 # Test whether this shell is capable of parameter substring processing.
6 ( option='a/b'; : ${option#*/} ) 2>/dev/null || {
8 The shell interpreting '$0' is lacking some required features.
10 To work around this problem you may try to execute:
19 # Store original IFS value so it can be changed (and restored) in many places.
20 readonly DEFAULT_IFS="$IFS"
22 # The top-level directory for the source. This ./configure and all Makefiles
23 # are good with ${srcdir} usually being relative. Some components (e.g. tests)
24 # are executed in subdirectories and for those it is simpler to use
25 # ${NOTMUCH_SRCDIR} which holds absolute path to the source.
26 srcdir=$(dirname "$0")
27 NOTMUCH_SRCDIR=$(cd "$srcdir" && pwd)
29 case $NOTMUCH_SRCDIR in ( *\'* | *['\"`$']* )
30 echo "Definitely unsafe characters in source path '$NOTMUCH_SRCDIR'".
34 case $PWD in ( *\'* | *['\"`$']* )
35 echo "Definitely unsafe characters in current directory '$PWD'".
39 # In case of whitespace, builds may work, tests definitely will not.
40 case $NOTMUCH_SRCDIR in ( *["$IFS"]* )
41 echo "Whitespace in source path '$NOTMUCH_SRCDIR' not supported".
45 case $PWD in ( *["$IFS"]* )
46 echo "Whitespace in current directory '$PWD' not supported".
50 subdirs="util compat lib parse-time-string completion doc emacs"
51 subdirs="${subdirs} performance-test test"
52 subdirs="${subdirs} bindings"
54 # For a non-srcdir configure invocation (such as ../configure), create
55 # the directory structure and copy Makefiles.
56 if [ "$srcdir" != "." ]; then
58 for dir in . ${subdirs}; do
60 cp "$srcdir"/"$dir"/Makefile.local "$dir"
61 cp "$srcdir"/"$dir"/Makefile "$dir"
64 # Emacs only likes to generate compiled files next to the .el files
65 # by default so copy these as well (which is not ideal).
66 cp -a "$srcdir"/emacs/*.el emacs
68 # We were not able to create fully working Makefile using ruby mkmf.rb
69 # so ruby bindings source files are copied as well (ditto -- not ideal).
71 cp -a "$srcdir"/bindings/ruby/*.[ch] bindings/ruby
72 cp -a "$srcdir"/bindings/ruby/extconf.rb bindings/ruby
74 # Use the same hack to replicate python-cffi source for
75 # out-of-tree builds (again, not ideal).
76 mkdir bindings/python-cffi
77 cp -a "$srcdir"/bindings/python-cffi/tests \
78 "$srcdir"/bindings/python-cffi/notmuch2 \
79 "$srcdir"/bindings/python-cffi/setup.py \
83 # Set several defaults (optionally specified by the user in
84 # environment variables)
85 BASHCMD=${BASHCMD:-bash}
89 CFLAGS=${CFLAGS:--g -O2}
90 CPPFLAGS=${CPPFLAGS:-}
91 CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}
92 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
94 XAPIAN_CONFIG=${XAPIAN_CONFIG:-}
98 # We don't allow the EMACS or GZIP Makefile variables inherit values
99 # from the environment as we do with CC and CXX above. The reason is
100 # that these names as environment variables have existing uses other
101 # than the program name that we want. (EMACS is set to 't' when a
102 # shell is running within emacs and GZIP specifies arguments to pass
103 # on the gzip command line).
105 # Set the defaults for values the user can specify with command-line
122 Usage: ./configure [options]...
124 This script configures notmuch to build on your system.
126 It verifies that dependencies are available, determines flags needed
127 to compile and link against various required libraries, and identifies
128 whether various system functions can be used or if locally-provided
129 replacements will be built instead.
131 Finally, it allows you to control various aspects of the build and
132 installation process.
134 First, some common variables can specified via environment variables:
136 CC The C compiler to use
137 CFLAGS Flags to pass to the C compiler
138 CPPFLAGS Flags to pass to the C preprocessor
139 CXX The C++ compiler to use
140 CXXFLAGS Flags to pass to the C compiler
141 LDFLAGS Flags to pass when linking
143 Each of these values can further be controlled by specifying them
144 later on the "make" command line.
146 Other environment variables can be used to control configure itself,
147 (and for which there is no equivalent build-time control):
149 XAPIAN_CONFIG The program to use to determine flags for
150 compiling and linking against the Xapian
151 library. [$XAPIAN_CONFIG]
152 PYTHON Name of python command to use in
153 configure and the test suite.
154 RUBY Name of ruby command to use in
155 configure and the test suite.
157 Additionally, various options can be specified on the configure
160 --prefix=PREFIX Install files in PREFIX [$PREFIX]
162 By default, "make install" will install the resulting program to
163 $PREFIX/bin, documentation to $PREFIX/man, etc. You can
164 specify an installation prefix other than $PREFIX using
165 --prefix, for instance:
167 ./configure --prefix=\$HOME
169 Fine tuning of some installation directories is available:
171 --libdir=DIR Install libraries to DIR [PREFIX/lib]
172 --includedir=DIR Install header files to DIR [PREFIX/include]
173 --mandir=DIR Install man pages to DIR [PREFIX/share/man]
174 --infodir=DIR Install man pages to DIR [PREFIX/share/man]
175 --sysconfdir=DIR Read-only single-machine data [PREFIX/etc]
176 --emacslispdir=DIR Emacs code [PREFIX/share/emacs/site-lisp]
177 --emacsetcdir=DIR Emacs miscellaneous files [PREFIX/share/emacs/site-lisp]
178 --bashcompletiondir=DIR Bash completions files [PREFIX/share/bash-completion/completions]
179 --zshcompletiondir=DIR Zsh completions files [PREFIX/share/zsh/site-functions]
181 Some features can be disabled (--with-feature=no is equivalent to
184 --without-bash-completion Do not install bash completions files
185 --without-docs Do not install documentation
186 --without-api-docs Do not install API man page
187 --without-emacs Do not install lisp file
188 --without-desktop Do not install desktop file
189 --without-ruby Do not install ruby bindings
190 --without-zsh-completion Do not install zsh completions files
191 --without-retry-lock Do not use blocking xapian opens, even if available
193 Additional options are accepted for compatibility with other
194 configure-script calling conventions, but don't do anything yet:
196 --build=<cpu>-<vendor>-<os> Currently ignored
197 --host=<cpu>-<vendor>-<os> Currently ignored
198 --datadir=DIR Currently ignored
199 --localstatedir=DIR Currently ignored
200 --libexecdir=DIR Currently ignored
201 --disable-maintainer-mode Currently ignored
202 --disable-dependency-tracking Currently ignored
207 # Parse command-line options
209 if [ "${option}" = '--help' ] ; then
212 elif [ "${option%%=*}" = '--prefix' ] ; then
213 PREFIX="${option#*=}"
214 elif [ "${option%%=*}" = '--libdir' ] ; then
215 LIBDIR="${option#*=}"
216 elif [ "${option%%=*}" = '--includedir' ] ; then
217 INCLUDEDIR="${option#*=}"
218 elif [ "${option%%=*}" = '--mandir' ] ; then
219 MANDIR="${option#*=}"
220 elif [ "${option%%=*}" = '--infodir' ] ; then
221 INFODIR="${option#*=}"
222 elif [ "${option%%=*}" = '--sysconfdir' ] ; then
223 SYSCONFDIR="${option#*=}"
224 elif [ "${option%%=*}" = '--emacslispdir' ] ; then
225 EMACSLISPDIR="${option#*=}"
226 elif [ "${option%%=*}" = '--emacsetcdir' ] ; then
227 EMACSETCDIR="${option#*=}"
228 elif [ "${option%%=*}" = '--bashcompletiondir' ] ; then
229 BASHCOMPLETIONDIR="${option#*=}"
230 elif [ "${option%%=*}" = '--zshcompletiondir' ] ; then
231 ZSHCOMLETIONDIR="${option#*=}"
232 elif [ "${option%%=*}" = '--with-docs' ]; then
233 if [ "${option#*=}" = 'no' ]; then
239 elif [ "${option}" = '--without-docs' ] ; then
242 elif [ "${option%%=*}" = '--with-api-docs' ]; then
243 if [ "${option#*=}" = 'no' ]; then
248 elif [ "${option}" = '--without-api-docs' ] ; then
250 elif [ "${option%%=*}" = '--with-emacs' ]; then
251 if [ "${option#*=}" = 'no' ]; then
256 elif [ "${option}" = '--without-emacs' ] ; then
258 elif [ "${option%%=*}" = '--with-desktop' ]; then
259 if [ "${option#*=}" = 'no' ]; then
264 elif [ "${option}" = '--without-desktop' ] ; then
266 elif [ "${option%%=*}" = '--with-bash-completion' ]; then
267 if [ "${option#*=}" = 'no' ]; then
272 elif [ "${option}" = '--without-bash-completion' ] ; then
274 elif [ "${option%%=*}" = '--with-rpath' ]; then
275 if [ "${option#*=}" = 'no' ]; then
280 elif [ "${option}" = '--without-rpath' ] ; then
282 elif [ "${option%%=*}" = '--with-ruby' ]; then
283 if [ "${option#*=}" = 'no' ]; then
288 elif [ "${option}" = '--without-ruby' ] ; then
290 elif [ "${option%%=*}" = '--with-retry-lock' ]; then
291 if [ "${option#*=}" = 'no' ]; then
296 elif [ "${option}" = '--without-retry-lock' ] ; then
298 elif [ "${option%%=*}" = '--with-zsh-completion' ]; then
299 if [ "${option#*=}" = 'no' ]; then
304 elif [ "${option}" = '--without-zsh-completion' ] ; then
306 elif [ "${option%%=*}" = '--build' ] ; then
308 elif [ "${option%%=*}" = '--host' ] ; then
310 elif [ "${option%%=*}" = '--datadir' ] ; then
312 elif [ "${option%%=*}" = '--localstatedir' ] ; then
314 elif [ "${option%%=*}" = '--libexecdir' ] ; then
316 elif [ "${option}" = '--disable-maintainer-mode' ] ; then
318 elif [ "${option}" = '--disable-dependency-tracking' ] ; then
321 echo "Unrecognized option: ${option}"
329 # We set this value early, (rather than just while printing the
330 # Makefile.config file later like most values), because we need to
331 # actually investigate this value compared to the ldconfig_paths value
333 if [ -z "$LIBDIR" ] ; then
334 libdir_expanded="${PREFIX}/lib"
336 # very non-general variable expansion
337 libdir_expanded=$(printf %s "$LIBDIR" | sed "s|\${prefix}|${PREFIX}|; s|\$prefix\>|${PREFIX}|; s|//*|/|g")
341 Welcome to Notmuch, a system for indexing, searching and tagging your email.
343 We hope that the process of building and installing notmuch is quick
344 and smooth so that you can soon be reading and processing your email
345 more efficiently than ever.
347 If anything goes wrong in the configure process, you can override any
348 decisions it makes by manually editing the Makefile.config file that
349 it creates. Also please do as much as you can to figure out what could
350 be different on your machine compared to those of the notmuch
351 developers. Then, please email those details to the Notmuch list
352 (notmuch@notmuchmail.org) so that we can hopefully make future
353 versions of notmuch easier for you to use.
355 We'll now investigate your system to verify that all required
356 dependencies are available:
361 printf "int main(void){return 0;}\n" > minimal.c
363 printf "Sanity checking C compilation environment... "
364 test_cmdline="${CC} ${CFLAGS} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal"
365 if ${test_cmdline} > /dev/null 2>&1
370 errors=$((errors + 1))
371 printf Executed:; printf ' %s' ${test_cmdline}; echo
375 printf "Sanity checking C++ compilation environment... "
376 test_cmdline="${CXX} ${CXXFLAGS_for_sh} ${CPPFLAGS} minimal.c ${LDFLAGS} -o minimal"
377 if ${test_cmdline} > /dev/null 2>&1
382 errors=$((errors + 1))
383 printf Executed:; printf ' %s' ${test_cmdline}; echo
388 if [ $errors -gt 0 ]; then
390 *** Error: Initial sanity checking of environment failed. Please try
391 running configure in a clean environment, and if the problem persists,
394 rm -f minimal minimal.c
398 printf "Reading libnotmuch version from source... "
399 cat > _libversion.c <<EOF
401 #include "lib/notmuch.h"
403 printf("libnotmuch_version_major=%d\n",
404 LIBNOTMUCH_MAJOR_VERSION);
405 printf("libnotmuch_version_minor=%d\n",
406 LIBNOTMUCH_MINOR_VERSION);
407 printf("libnotmuch_version_release=%d\n",
408 LIBNOTMUCH_MICRO_VERSION);
412 if ${CC} ${CFLAGS} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
413 && ./_libversion > _libversion.sh && . ./_libversion.sh
419 *** Error: Reading lib/notmuch.h failed.
420 Please try running configure again in a clean environment, and if the
421 problem persists, report a bug.
423 rm -f _libversion _libversion.c _libversion.sh
427 if pkg-config --version > /dev/null 2>&1; then
435 printf "Checking for Xapian development files (>= 1.4.0)... "
437 for xapian_config in ${XAPIAN_CONFIG} xapian-config; do
438 if ${xapian_config} --version > /dev/null 2>&1; then
439 xapian_version=$(${xapian_config} --version | sed -e 's/.* //')
440 case $xapian_version in
441 1.[4-9]* | 1.[1-9][0-9]* | [2-9]* | [1-9][0-9]*)
442 printf "Yes (%s).\n" ${xapian_version}
444 xapian_cxxflags=$(${xapian_config} --cxxflags)
445 xapian_ldflags=$(${xapian_config} --libs)
447 *) printf "Xapian $xapian_version not supported... "
452 if [ ${have_xapian} = "0" ]; then
454 errors=$((errors + 1))
457 if [ ${have_xapian} = "1" ]; then
458 default_xapian_backend=""
459 printf "Testing default Xapian backend... "
460 cat >_default_backend.cc <<EOF
462 int main(int argc, char** argv) {
463 Xapian::WritableDatabase db("test.db",Xapian::DB_CREATE_OR_OPEN);
466 ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} _default_backend.cc -o _default_backend ${xapian_ldflags}
468 if [ -f test.db/iamglass ]; then
469 default_xapian_backend=glass
471 default_xapian_backend=chert
473 printf "%s\n" "${default_xapian_backend}";
474 rm -rf test.db _default_backend _default_backend.cc
479 printf "Checking for GMime development files (>= $GMIME_MINVER)... "
480 if pkg-config --exists "gmime-3.0 >= $GMIME_MINVER"; then
483 gmime_cflags=$(pkg-config --cflags gmime-3.0)
484 gmime_ldflags=$(pkg-config --libs gmime-3.0)
486 printf "Checking for GMime session key extraction support... "
488 cat > _check_session_keys.c <<EOF
489 #include <gmime/gmime.h>
493 GError *error = NULL;
494 GMimeParser *parser = NULL;
495 GMimeMultipartEncrypted *body = NULL;
496 GMimeDecryptResult *decrypt_result = NULL;
497 GMimeObject *output = NULL;
500 parser = g_mime_parser_new ();
501 g_mime_parser_init_with_stream (parser, g_mime_stream_file_open("$srcdir/test/corpora/crypto/basic-encrypted.eml", "r", &error));
502 if (error) return !! fprintf (stderr, "failed to instantiate parser with test/corpora/crypto/basic-encrypted.eml\n");
504 body = GMIME_MULTIPART_ENCRYPTED(g_mime_message_get_mime_part (g_mime_parser_construct_message (parser, NULL)));
505 if (body == NULL) return !! fprintf (stderr, "did not find a multipart encrypted message\n");
507 output = g_mime_multipart_encrypted_decrypt (body, GMIME_DECRYPT_EXPORT_SESSION_KEY, NULL, &decrypt_result, &error);
508 if (error || output == NULL) return !! fprintf (stderr, "decryption failed\n");
510 if (decrypt_result == NULL) return !! fprintf (stderr, "no GMimeDecryptResult found\n");
511 if (decrypt_result->session_key == NULL) return !! fprintf (stderr, "GMimeDecryptResult has no session key\n");
513 printf ("%s\n", decrypt_result->session_key);
517 if ! TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX"); then
518 printf 'No.\nCould not make tempdir for testing session-key support.\n'
519 errors=$((errors + 1))
520 elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c ${gmime_ldflags} -o _check_session_keys \
521 && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < "$srcdir"/test/gnupg-secret-key.asc \
522 && SESSION_KEY=$(GNUPGHOME=${TEMP_GPG} ./_check_session_keys) \
523 && [ $SESSION_KEY = 9:0BACD64099D1468AB07C796F0C0AC4851948A658A15B34E803865E9FC635F2F5 ]
529 *** Error: Could not extract session keys from encrypted message.
531 This is likely due to your GMime having been built against a old
534 Please try to rebuild your version of GMime against a more recent
535 version of GPGME (at least GPGME 1.8.0).
537 if command -v gpgme-config >/dev/null; then
538 printf 'Your current GPGME development version is: %s\n' "$(gpgme-config --version)"
540 printf 'You do not have the GPGME development libraries installed.\n'
542 errors=$((errors + 1))
544 if [ -n "$TEMP_GPG" -a -d "$TEMP_GPG" ]; then
548 # see https://github.com/jstedfast/gmime/pull/90
549 # should be fixed in GMime in 3.2.7, but some distros might patch
550 printf "Checking for GMime X.509 certificate validity... "
552 cat > _check_x509_validity.c <<EOF
554 #include <gmime/gmime.h>
557 GError *error = NULL;
558 GMimeParser *parser = NULL;
559 GMimeApplicationPkcs7Mime *body = NULL;
560 GMimeSignatureList *sig_list = NULL;
561 GMimeSignature *sig = NULL;
562 GMimeCertificate *cert = NULL;
563 GMimeObject *output = NULL;
564 GMimeValidity validity = GMIME_VALIDITY_UNKNOWN;
568 parser = g_mime_parser_new ();
569 g_mime_parser_init_with_stream (parser, g_mime_stream_file_open("$srcdir/test/corpora/pkcs7/smime-onepart-signed.eml", "r", &error));
570 if (error) return !! fprintf (stderr, "failed to instantiate parser with test/corpora/pkcs7/smime-onepart-signed.eml\n");
572 body = GMIME_APPLICATION_PKCS7_MIME(g_mime_message_get_mime_part (g_mime_parser_construct_message (parser, NULL)));
573 if (body == NULL) return !! fprintf (stderr, "did not find a application/pkcs7 message\n");
575 sig_list = g_mime_application_pkcs7_mime_verify (body, GMIME_VERIFY_NONE, &output, &error);
576 if (error || output == NULL) return !! fprintf (stderr, "verify failed\n");
578 if (sig_list == NULL) return !! fprintf (stderr, "no GMimeSignatureList found\n");
579 len = g_mime_signature_list_length (sig_list);
580 if (len != 1) return !! fprintf (stderr, "expected 1 signature, got %d\n", len);
581 sig = g_mime_signature_list_get_signature (sig_list, 0);
582 if (sig == NULL) return !! fprintf (stderr, "no GMimeSignature found at position 0\n");
583 cert = g_mime_signature_get_certificate (sig);
584 if (cert == NULL) return !! fprintf (stderr, "no GMimeCertificate found\n");
585 validity = g_mime_certificate_get_id_validity (cert);
586 if (validity != GMIME_VALIDITY_FULL) return !! fprintf (stderr, "Got validity %d, expected %d\n", validity, GMIME_VALIDITY_FULL);
591 if ! TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX"); then
592 printf 'No.\nCould not make tempdir for testing X.509 certificate validity support.\n'
593 errors=$((errors + 1))
594 elif ${CC} ${CFLAGS} ${gmime_cflags} _check_x509_validity.c ${gmime_ldflags} -o _check_x509_validity \
595 && echo disable-crl-checks > "$TEMP_GPG/gpgsm.conf" \
596 && echo "4D:E0:FF:63:C0:E9:EC:01:29:11:C8:7A:EE:DA:3A:9A:7F:6E:C1:0D S" >> "$TEMP_GPG/trustlist.txt" \
597 && GNUPGHOME=${TEMP_GPG} gpgsm --batch --quiet --import < "$srcdir"/test/smime/ca.crt
599 if GNUPGHOME=${TEMP_GPG} ./_check_x509_validity; then
600 gmime_x509_cert_validity=1
603 gmime_x509_cert_validity=0
605 if pkg-config --exists "gmime-3.0 >= 3.2.7"; then
607 *** Error: GMime fails to calculate X.509 certificate validity, and
608 is later than 3.2.7, which should have fixed this issue.
610 Please follow up on https://github.com/jstedfast/gmime/pull/90 with
613 errors=$((errors + 1))
617 printf 'No.\nFailed to set up gpgsm for testing X.509 certificate validity support.\n'
618 errors=$((errors + 1))
620 if [ -n "$TEMP_GPG" -a -d "$TEMP_GPG" ]; then
624 # see https://dev.gnupg.org/T3464
625 # there are problems verifying signatures when decrypting with session keys with GPGME 1.13.0 and 1.13.1
626 printf "Checking signature verification when decrypting using session keys... "
628 cat > _verify_sig_with_session_key.c <<EOF
630 #include <gmime/gmime.h>
633 GError *error = NULL;
634 GMimeParser *parser = NULL;
635 GMimeMultipartEncrypted *body = NULL;
636 GMimeDecryptResult *result = NULL;
637 GMimeSignatureList *sig_list = NULL;
638 GMimeSignature *sig = NULL;
639 GMimeObject *output = NULL;
640 GMimeSignatureStatus status;
644 parser = g_mime_parser_new ();
645 g_mime_parser_init_with_stream (parser, g_mime_stream_file_open("$srcdir/test/corpora/crypto/encrypted-signed.eml", "r", &error));
646 if (error) return !! fprintf (stderr, "failed to instantiate parser with test/corpora/pkcs7/smime-onepart-signed.eml\n");
648 body = GMIME_MULTIPART_ENCRYPTED(g_mime_message_get_mime_part (g_mime_parser_construct_message (parser, NULL)));
649 if (body == NULL) return !! fprintf (stderr, "did not find a multipart/encrypted message\n");
651 output = g_mime_multipart_encrypted_decrypt (body, GMIME_DECRYPT_NONE, "9:13607E4217515A70EC8DF9DBC16C5327B94577561D98AD1246FA8756659C7899", &result, &error);
652 if (error || output == NULL) return !! fprintf (stderr, "decrypt failed\n");
654 sig_list = g_mime_decrypt_result_get_signatures (result);
655 if (sig_list == NULL) return !! fprintf (stderr, "sig_list is NULL\n");
657 if (sig_list == NULL) return !! fprintf (stderr, "no GMimeSignatureList found\n");
658 len = g_mime_signature_list_length (sig_list);
659 if (len != 1) return !! fprintf (stderr, "expected 1 signature, got %d\n", len);
660 sig = g_mime_signature_list_get_signature (sig_list, 0);
661 if (sig == NULL) return !! fprintf (stderr, "no GMimeSignature found at position 0\n");
662 status = g_mime_signature_get_status (sig);
663 if (status & GMIME_SIGNATURE_STATUS_KEY_MISSING) return !! fprintf (stderr, "signature status contains KEY_MISSING (see https://dev.gnupg.org/T3464)\n");
668 if ! TEMP_GPG=$(mktemp -d "${TMPDIR:-/tmp}/notmuch.XXXXXX"); then
669 printf 'No.\nCould not make tempdir for testing signature verification when decrypting with session keys.\n'
670 errors=$((errors + 1))
671 elif ${CC} ${CFLAGS} ${gmime_cflags} _verify_sig_with_session_key.c ${gmime_ldflags} -o _verify_sig_with_session_key \
672 && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < "$srcdir"/test/gnupg-secret-key.asc \
673 && rm -f ${TEMP_GPG}/private-keys-v1.d/*.key
675 if GNUPGHOME=${TEMP_GPG} ./_verify_sig_with_session_key; then
676 gmime_verify_with_session_key=1
679 gmime_verify_with_session_key=0
682 *** Error: GMime fails to verify signatures when decrypting with a session key.
684 This is most likely due to a buggy version of GPGME, which should be fixed in 1.13.2 or later.
685 See https://dev.gnupg.org/T3464 for more details.
689 printf 'No.\nFailed to set up gpg for testing signature verification while decrypting with a session key.\n'
690 errors=$((errors + 1))
692 if [ -n "$TEMP_GPG" -a -d "$TEMP_GPG" ]; then
698 errors=$((errors + 1))
701 # GMime already depends on Glib >= 2.12, but we use at least one Glib
702 # function that only exists as of 2.22, (g_array_unref)
703 printf "Checking for Glib development files (>= 2.22)... "
705 if pkg-config --exists 'glib-2.0 >= 2.22'; then
708 # these are included in gmime cflags and ldflags
709 # glib_cflags=$(pkg-config --cflags glib-2.0)
710 # glib_ldflags=$(pkg-config --libs glib-2.0)
713 errors=$((errors + 1))
716 if ! pkg-config --exists zlib; then
717 ${CC} -o compat/gen_zlib_pc "$srcdir"/compat/gen_zlib_pc.c >/dev/null 2>&1 &&
718 compat/gen_zlib_pc > compat/zlib.pc &&
719 PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+$PKG_CONFIG_PATH:}compat &&
720 export PKG_CONFIG_PATH
721 rm -f compat/gen_zlib_pc
724 printf "Checking for zlib (>= 1.2.5.2)... "
726 if pkg-config --atleast-version=1.2.5.2 zlib; then
729 zlib_cflags=$(pkg-config --cflags zlib)
730 zlib_ldflags=$(pkg-config --libs zlib)
733 errors=$((errors + 1))
736 printf "Checking for talloc development files... "
737 if pkg-config --exists talloc; then
740 talloc_cflags=$(pkg-config --cflags talloc)
741 talloc_ldflags=$(pkg-config --libs talloc)
746 errors=$((errors + 1))
749 printf "Checking for bash... "
750 if command -v ${BASHCMD} > /dev/null; then
752 bash_absolute=$(command -v ${BASHCMD})
753 printf "Yes (%s).\n" "$bash_absolute"
756 printf "No. (%s not found)\n" "${BASHCMD}"
759 printf "Checking for perl... "
760 if command -v ${PERL} > /dev/null; then
762 perl_absolute=$(command -v ${PERL})
763 printf "Yes (%s).\n" "$perl_absolute"
766 printf "No. (%s not found)\n" "${PERL}"
769 printf "Checking for python... "
772 for name in ${PYTHON} python3 python python2; do
773 if command -v $name > /dev/null; then
776 printf "Yes (%s).\n" "$name"
781 if [ $have_python -eq 0 ]; then
783 errors=$((errors + 1))
787 if [ $have_python -eq 1 ]; then
788 printf "Checking for python3 (>= 3.5)..."
789 if "$python" -c 'import sys, sysconfig; assert sys.version_info >= (3,5)'; >/dev/null 2>&1; then
793 printf "No (will not install CFFI-based python bindings).\n"
798 have_python3_pytest=0
799 if [ $have_python3 -eq 1 ]; then
800 printf "Checking for python3 cffi and setuptools... "
801 if "$python" -c 'import cffi,setuptools; cffi.FFI().verify()' >/dev/null 2>&1; then
806 printf "No (will not install CFFI-based python bindings).\n"
808 rm -rf __pycache__ # cffi.FFI().verify() uses this space
810 printf "Checking for python3 pytest (>= 3.0)... "
812 printf "[pytest]\nminversion=3.0\n" > $conf
813 if pytest-3 -c $conf --version >/dev/null 2>&1; then
815 have_python3_pytest=1
817 printf "No (will not test CFFI-based python bindings).\n"
822 printf "Checking for valgrind development files... "
823 if pkg-config --exists valgrind; then
826 valgrind_cflags=$(pkg-config --cflags valgrind)
828 printf "No (but that's fine).\n"
833 printf "Checking for bash-completion (>= 1.90)... "
834 if pkg-config --atleast-version=1.90 bash-completion; then
837 printf "No (will not install bash completion).\n"
841 if [ -z "${EMACSLISPDIR-}" ]; then
842 EMACSLISPDIR="\$(prefix)/share/emacs/site-lisp"
845 if [ -z "${EMACSETCDIR-}" ]; then
846 EMACSETCDIR="\$(prefix)/share/emacs/site-lisp"
849 if [ $WITH_EMACS = "1" ]; then
850 printf "Checking if emacs (>= 24) is available... "
851 if emacs --quick --batch --eval '(if (< emacs-major-version 24) (kill-emacs 1))' > /dev/null 2>&1; then
854 printf "No (disabling emacs related parts of build)\n"
860 if [ $WITH_API_DOCS = "1" ] ; then
861 printf "Checking if doxygen is available... "
862 if command -v doxygen > /dev/null; then
866 printf "No (so will not install api docs)\n"
871 if [ $WITH_RUBY = "1" ] ; then
872 printf "Checking for ruby development files... "
873 if ${RUBY} -e "require 'mkmf'"> /dev/null 2>&1; then
877 printf "No (skipping ruby bindings)\n"
884 if [ $WITH_DOCS = "1" ] ; then
885 printf "Checking if sphinx is available and supports nroff output... "
886 if command -v sphinx-build > /dev/null && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then
890 printf "No (so will not install man pages).\n"
892 printf "Checking if makeinfo is available... "
893 if command -v makeinfo > /dev/null; then
897 printf "No (so will not build info pages).\n"
899 printf "Checking if install-info is available... "
900 if command -v install-info > /dev/null; then
904 printf "No (so will not install info pages).\n"
908 if [ $WITH_DESKTOP = "1" ]; then
909 printf "Checking if desktop-file-install is available... "
910 if command -v desktop-file-install > /dev/null; then
913 printf "No (so will not install .desktop file).\n"
918 printf "Checking for cppcheck... "
919 if command -v cppcheck > /dev/null; then
929 printf "Checking which platform we are on... "
931 if [ $uname = "Darwin" ] ; then
934 linker_resolves_library_dependencies=0
935 elif [ $uname = "SunOS" ] ; then
938 linker_resolves_library_dependencies=0
939 elif [ $uname = "FreeBSD" ] ; then
942 linker_resolves_library_dependencies=0
943 elif [ $uname = "OpenBSD" ] ; then
946 linker_resolves_library_dependencies=0
947 elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
948 printf "%s\n" "$uname"
950 linker_resolves_library_dependencies=1
952 printf "Checking for %s in ldconfig... " "$libdir_expanded"
953 ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
954 # Separate ldconfig_paths only on newline (not on any potential
955 # embedded space characters in any filenames). Note, we use a
956 # literal newline in the source here rather than something like:
960 # because the shell's command substitution deletes any trailing newlines.
963 for path in $ldconfig_paths; do
964 if [ "$path" -ef "$libdir_expanded" ]; then
969 if [ "$libdir_in_ldconfig" = '0' ]; then
970 printf "No (will set RPATH)\n"
977 linker_resolves_library_dependencies=0
980 *** Warning: Unknown platform. Notmuch might or might not build correctly.
985 if [ $errors -gt 0 ]; then
988 *** Error: The dependencies of notmuch could not be satisfied. You will
989 need to install the following packages before being able to compile
993 if [ $have_python -eq 0 ]; then
994 echo " python interpreter"
996 if [ $have_xapian -eq 0 ]; then
997 echo " Xapian library (>= version 1.4.0, including development files such as headers)"
998 echo " https://xapian.org/"
1000 if [ $have_zlib -eq 0 ]; then
1001 echo " zlib library (>= version 1.2.5.2, including development files such as headers)"
1002 echo " https://zlib.net/"
1005 if [ $have_gmime -eq 0 ]; then
1006 echo " GMime library >= $GMIME_MINVER"
1007 echo " (including development files such as headers)"
1008 echo " https://github.com/jstedfast/gmime/"
1011 if [ $have_glib -eq 0 ]; then
1012 echo " Glib library >= 2.22 (including development files such as headers)"
1013 echo " https://ftp.gnome.org/pub/gnome/sources/glib/"
1016 if [ $have_talloc -eq 0 ]; then
1017 echo " The talloc library (including development files such as headers)"
1018 echo " https://talloc.samba.org/"
1022 With any luck, you're using a modern, package-based operating system
1023 that has all of these packages available in the distribution. In that
1024 case a simple command will install everything you need. For example:
1026 On Debian and similar systems:
1028 sudo apt-get install libxapian-dev libgmime-3.0-dev libtalloc-dev zlib1g-dev
1030 Or on Fedora and similar systems:
1032 sudo dnf install xapian-core-devel gmime30-devel libtalloc-devel zlib-devel
1034 On other systems, similar commands can be used, but the details of the
1035 package names may be different.
1038 if [ $have_pkg_config -eq 0 ]; then
1040 Note: the pkg-config program is not available. This configure script
1041 uses pkg-config to find the compilation flags required to link against
1042 the various libraries needed by notmuch. It's possible you simply need
1043 to install pkg-config with a command such as:
1045 sudo apt-get install pkg-config
1047 sudo dnf install pkgconfig
1049 But if pkg-config is not available for your system, then you will need
1050 to modify the configure script to manually set the cflags and ldflags
1051 variables to the correct values to link against each library in each
1052 case that pkg-config could not be used to determine those values.
1057 When you have installed the necessary dependencies, you can run
1058 configure again to ensure the packages can be found, or simply run
1059 "make" to compile notmuch.
1065 printf "Checking for canonicalize_file_name... "
1066 if ${CC} -o compat/have_canonicalize_file_name "$srcdir"/compat/have_canonicalize_file_name.c > /dev/null 2>&1
1069 have_canonicalize_file_name=1
1071 printf "No (will use our own instead).\n"
1072 have_canonicalize_file_name=0
1074 rm -f compat/have_canonicalize_file_name
1077 printf "Checking for getline... "
1078 if ${CC} -o compat/have_getline "$srcdir"/compat/have_getline.c > /dev/null 2>&1
1083 printf "No (will use our own instead).\n"
1086 rm -f compat/have_getline
1088 printf "Checking for strcasestr... "
1089 if ${CC} -o compat/have_strcasestr "$srcdir"/compat/have_strcasestr.c > /dev/null 2>&1
1094 printf "No (will use our own instead).\n"
1097 rm -f compat/have_strcasestr
1099 printf "Checking for strsep... "
1100 if ${CC} -o compat/have_strsep "$srcdir"/compat/have_strsep.c > /dev/null 2>&1
1105 printf "No (will use our own instead).\n"
1108 rm -f compat/have_strsep
1110 printf "Checking for timegm... "
1111 if ${CC} -o compat/have_timegm "$srcdir"/compat/have_timegm.c > /dev/null 2>&1
1116 printf "No (will use our own instead).\n"
1119 rm -f compat/have_timegm
1121 cat <<EOF > _time_t.c
1124 static_assert(sizeof(time_t) >= 8, "sizeof(time_t) < 8");
1127 printf "Checking for 64 bit time_t... "
1128 if ${CC} -c _time_t.c -o /dev/null
1137 printf "Checking for dirent.d_type... "
1138 if ${CC} -o compat/have_d_type "$srcdir"/compat/have_d_type.c > /dev/null 2>&1
1143 printf "No (will use stat instead).\n"
1146 rm -f compat/have_d_type
1148 printf "Checking for standard version of getpwuid_r... "
1149 if ${CC} -o compat/check_getpwuid "$srcdir"/compat/check_getpwuid.c > /dev/null 2>&1
1154 printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"
1157 rm -f compat/check_getpwuid
1159 printf "Checking for standard version of asctime_r... "
1160 if ${CC} -o compat/check_asctime "$srcdir"/compat/check_asctime.c > /dev/null 2>&1
1165 printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"
1168 rm -f compat/check_asctime
1170 printf "Checking for rpath support... "
1171 if [ $WITH_RPATH = "1" ] && ${CC} -Wl,--enable-new-dtags -Wl,-rpath,/tmp/ -o minimal minimal.c >/dev/null 2>&1
1174 rpath_ldflags="-Wl,--enable-new-dtags -Wl,-rpath,\$(libdir)"
1176 printf "No (nothing to worry about).\n"
1180 printf "Checking for -Wl,--as-needed... "
1181 if ${CC} -Wl,--as-needed -o minimal minimal.c >/dev/null 2>&1
1184 as_needed_ldflags="-Wl,--as-needed"
1186 printf "No (nothing to worry about).\n"
1187 as_needed_ldflags=""
1190 printf "Checking for -Wl,--no-undefined... "
1191 if ${CC} -Wl,--no-undefined -o minimal minimal.c >/dev/null 2>&1
1194 no_undefined_ldflags="-Wl,--no-undefined"
1196 printf "No (nothing to worry about).\n"
1197 no_undefined_ldflags=""
1201 printf "Checking for available C++ compiler warning flags... "
1202 for flag in -Wall -Wextra -Wwrite-strings; do
1203 if ${CC} $flag -o minimal minimal.c > /dev/null 2>&1
1205 WARN_CXXFLAGS="${WARN_CXXFLAGS}${WARN_CXXFLAGS:+ }${flag}"
1208 printf "\n\t%s\n" "${WARN_CXXFLAGS}"
1210 WARN_CFLAGS="${WARN_CXXFLAGS}"
1211 printf "Checking for available C compiler warning flags... "
1212 for flag in -Wmissing-declarations; do
1213 if ${CC} $flag -o minimal minimal.c > /dev/null 2>&1
1215 WARN_CFLAGS="${WARN_CFLAGS}${WARN_CFLAGS:+ }${flag}"
1218 printf "\n\t%s\n" "${WARN_CFLAGS}"
1220 rm -f minimal minimal.c _time_t.c _libversion.c _libversion _libversion.sh _check_session_keys.c _check_session_keys _check_x509_validity.c _check_x509_validity \
1221 _verify_sig_with_session_key.c _verify_sig_with_session_key
1223 # construct the Makefile.config
1224 cat > Makefile.config <<EOF
1225 # This Makefile.config was automatically generated by the ./configure
1226 # script of notmuch. If the configure script identified anything
1227 # incorrectly, then you can edit this file to try to correct things,
1228 # but be warned that if configure is run again it will destroy your
1229 # changes, (and this could happen by simply calling "make" if the
1230 # configure script is updated).
1232 # The top-level directory for the source, (the directory containing
1233 # the configure script). This may be different than the build
1234 # directory (the current directory at the time configure was run).
1236 NOTMUCH_SRCDIR = ${NOTMUCH_SRCDIR}
1238 # subdirectories to build
1239 subdirs = ${subdirs}
1241 configure_options = $@
1243 # We use vpath directives (rather than the VPATH variable) since the
1244 # VPATH variable matches targets as well as prerequisites, (which is
1245 # not useful since then a target left-over from a srcdir build would
1246 # cause a target to not be built in the non-srcdir build).
1248 # Also, we don't use a single "vpath % \$(srcdir)" here because we
1249 # don't want the vpath to trigger for our emacs lisp compilation,
1250 # (unless we first find a way to convince emacs to build the .elc
1251 # target in a directory other than the directory of the .el
1252 # prerequisite). In the meantime, we're actually copying in the .el
1253 # files, (which is quite ugly).
1254 vpath %.c \$(srcdir)
1255 vpath %.cc \$(srcdir)
1256 vpath Makefile.% \$(srcdir)
1257 vpath %.py \$(srcdir)
1258 vpath %.rst \$(srcdir)
1260 # Library versions (used to make SONAME)
1261 # The major version of the library interface. This will control the soname.
1262 # As such, this number must be incremented for any incompatible change to
1263 # the library interface, (such as the deletion of an API or a major
1264 # semantic change that breaks formerly functioning code).
1266 LIBNOTMUCH_VERSION_MAJOR = ${libnotmuch_version_major}
1268 # The minor version of the library interface. This should be incremented at
1269 # the time of release for any additions to the library interface,
1270 # (and when it is incremented, the release version of the library should
1272 LIBNOTMUCH_VERSION_MINOR = ${libnotmuch_version_minor}
1274 # The release version the library interface. This should be incremented at
1275 # the time of release if there have been no changes to the interface, (but
1276 # simply compatible changes to the implementation).
1277 LIBNOTMUCH_VERSION_RELEASE = ${libnotmuch_version_release}
1279 # These are derived from the VERSION macros in lib/notmuch.h so
1280 # if you have to change them, something is wrong.
1282 # The C compiler to use
1285 # The C++ compiler to use
1288 # Command to execute emacs from Makefiles
1289 EMACS = emacs --quick
1291 # Default FLAGS for C compiler (can be overridden by user such as "make CFLAGS=-g")
1294 # Default FLAGS for C preprocessor (can be overridden by user such as "make CPPFLAGS=-I/usr/local/include")
1295 CPPFLAGS = ${CPPFLAGS}
1297 # Default FLAGS for C++ compiler (can be overridden by user such as "make CXXFLAGS=-g")
1298 CXXFLAGS = ${CXXFLAGS}
1300 # Default FLAGS for the linker (can be overridden by user such as "make LDFLAGS=-znow")
1301 LDFLAGS = ${LDFLAGS}
1303 # Flags to enable warnings when using the C++ compiler
1304 WARN_CXXFLAGS=${WARN_CXXFLAGS}
1306 # Flags to enable warnings when using the C compiler
1307 WARN_CFLAGS=${WARN_CFLAGS}
1309 # Name of python interpreter
1312 # Name of ruby interpreter
1315 # The prefix to which notmuch should be installed
1316 # Note: If you change this value here, be sure to ensure that the
1317 # LIBDIR_IN_LDCONFIG value below is still set correctly.
1320 # The directory to which libraries should be installed
1321 # Note: If you change this value here, be sure to ensure that the
1322 # LIBDIR_IN_LDCONFIG value below is still set correctly.
1323 libdir = ${LIBDIR:=\$(prefix)/lib}
1325 # Whether libdir is in a path configured into ldconfig
1326 LIBDIR_IN_LDCONFIG = ${libdir_in_ldconfig}
1328 # The directory to which header files should be installed
1329 includedir = ${INCLUDEDIR:=\$(prefix)/include}
1331 # The directory to which man pages should be installed
1332 mandir = ${MANDIR:=\$(prefix)/share/man}
1334 # The directory to which man pages should be installed
1335 infodir = ${INFODIR:=\$(prefix)/share/info}
1337 # The directory to which read-only (configuration) files should be installed
1338 sysconfdir = ${SYSCONFDIR:=\$(prefix)/etc}
1340 # The directory to which emacs lisp files should be installed
1341 emacslispdir=${EMACSLISPDIR}
1343 # The directory to which emacs miscellaneous (machine-independent) files should
1345 emacsetcdir=${EMACSETCDIR}
1347 # Whether bash exists, and if so where
1348 HAVE_BASH = ${have_bash}
1349 BASH_ABSOLUTE = ${bash_absolute}
1351 # Whether perl exists, and if so where
1352 HAVE_PERL = ${have_perl}
1353 PERL_ABSOLUTE = ${perl_absolute}
1355 # Whether there's a sphinx-build binary available for building documentation
1356 HAVE_SPHINX=${have_sphinx}
1358 # Whether there's a makeinfo binary available for building info format documentation
1359 HAVE_MAKEINFO=${have_makeinfo}
1361 # Whether there's an install-info binary available for installing info format documentation
1362 HAVE_INSTALL_INFO=${have_install_info}
1364 # Whether there's a doxygen binary available for building api documentation
1365 HAVE_DOXYGEN=${have_doxygen}
1367 # The directory to which desktop files should be installed
1368 desktop_dir = \$(prefix)/share/applications
1370 # The directory to which bash completions files should be installed
1371 bash_completion_dir = ${BASHCOMPLETIONDIR:=\$(prefix)/share/bash-completion/completions}
1373 # The directory to which zsh completions files should be installed
1374 zsh_completion_dir = ${ZSHCOMLETIONDIR:=\$(prefix)/share/zsh/site-functions}
1376 # Whether the canonicalize_file_name function is available (if not, then notmuch will
1377 # build its own version)
1378 HAVE_CANONICALIZE_FILE_NAME = ${have_canonicalize_file_name}
1380 # Whether the cppcheck static checker is available
1381 HAVE_CPPCHECK = ${have_cppcheck}
1383 # Whether the getline function is available (if not, then notmuch will
1384 # build its own version)
1385 HAVE_GETLINE = ${have_getline}
1387 # Are the ruby development files (and ruby) available? If not skip
1388 # building/testing ruby bindings.
1389 HAVE_RUBY_DEV = ${have_ruby_dev}
1391 # Is the python cffi package available?
1392 HAVE_PYTHON3_CFFI = ${have_python3_cffi}
1394 # Is the python pytest package available?
1395 HAVE_PYTHON3_PYTEST = ${have_python3_pytest}
1397 # Whether the strcasestr function is available (if not, then notmuch will
1398 # build its own version)
1399 HAVE_STRCASESTR = ${have_strcasestr}
1401 # Whether the strsep function is available (if not, then notmuch will
1402 # build its own version)
1403 HAVE_STRSEP = ${have_strsep}
1405 # Whether the timegm function is available (if not, then notmuch will
1406 # build its own version)
1407 HAVE_TIMEGM = ${have_timegm}
1409 # Whether struct dirent has d_type (if not, then notmuch will use stat)
1410 HAVE_D_TYPE = ${have_d_type}
1412 # Whether to have Xapian retry lock
1413 HAVE_XAPIAN_DB_RETRY_LOCK = ${WITH_RETRY_LOCK}
1415 # Whether the getpwuid_r function is standards-compliant
1416 # (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS
1417 # to enable the standards-compliant version -- needed for Solaris)
1418 STD_GETPWUID = ${std_getpwuid}
1420 # Whether the asctime_r function is standards-compliant
1421 # (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS
1422 # to enable the standards-compliant version -- needed for Solaris)
1423 STD_ASCTIME = ${std_asctime}
1425 # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD, OPENBSD
1426 PLATFORM = ${platform}
1428 # Whether the linker will automatically resolve the dependency of one
1429 # library on another (if not, then linking a binary requires linking
1430 # directly against both)
1431 LINKER_RESOLVES_LIBRARY_DEPENDENCIES = ${linker_resolves_library_dependencies}
1433 # Flags needed to compile and link against Xapian
1434 XAPIAN_CXXFLAGS = ${xapian_cxxflags}
1435 XAPIAN_LDFLAGS = ${xapian_ldflags}
1437 # Flags needed to compile and link against GMime
1438 GMIME_CFLAGS = ${gmime_cflags}
1439 GMIME_LDFLAGS = ${gmime_ldflags}
1441 # Flags needed to compile and link against zlib
1442 ZLIB_CFLAGS = ${zlib_cflags}
1443 ZLIB_LDFLAGS = ${zlib_ldflags}
1445 # Flags needed to compile and link against talloc
1446 TALLOC_CFLAGS = ${talloc_cflags}
1447 TALLOC_LDFLAGS = ${talloc_ldflags}
1449 # Flags needed to have linker set rpath attribute
1450 RPATH_LDFLAGS = ${rpath_ldflags}
1452 # Flags needed to have linker link only to necessary libraries
1453 AS_NEEDED_LDFLAGS = ${as_needed_ldflags}
1455 # Flags to have the linker flag undefined symbols in object files
1456 NO_UNDEFINED_LDFLAGS = ${no_undefined_ldflags}
1458 # Whether valgrind header files are available
1459 HAVE_VALGRIND = ${have_valgrind}
1461 # And if so, flags needed at compile time for valgrind macros
1462 VALGRIND_CFLAGS = ${valgrind_cflags}
1465 WITH_EMACS = ${WITH_EMACS}
1467 # Support for desktop file
1468 WITH_DESKTOP = ${WITH_DESKTOP}
1470 # Support for bash completion
1471 WITH_BASH = ${WITH_BASH}
1473 # Support for zsh completion
1474 WITH_ZSH = ${WITH_ZSH}
1476 # Combined flags for compiling and linking against all of the above
1477 COMMON_CONFIGURE_CFLAGS = \\
1478 \$(GMIME_CFLAGS) \$(TALLOC_CFLAGS) \$(ZLIB_CFLAGS) \\
1479 -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \$(VALGRIND_CFLAGS) \\
1480 -DHAVE_GETLINE=\$(HAVE_GETLINE) \\
1481 -DWITH_EMACS=\$(WITH_EMACS) \\
1482 -DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
1483 -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
1484 -DHAVE_STRSEP=\$(HAVE_STRSEP) \\
1485 -DHAVE_TIMEGM=\$(HAVE_TIMEGM) \\
1486 -DHAVE_D_TYPE=\$(HAVE_D_TYPE) \\
1487 -DSTD_GETPWUID=\$(STD_GETPWUID) \\
1488 -DSTD_ASCTIME=\$(STD_ASCTIME) \\
1489 -DSILENCE_XAPIAN_DEPRECATION_WARNINGS \\
1490 -DHAVE_XAPIAN_DB_RETRY_LOCK=\$(HAVE_XAPIAN_DB_RETRY_LOCK)
1492 CONFIGURE_CFLAGS = \$(COMMON_CONFIGURE_CFLAGS)
1494 CONFIGURE_CXXFLAGS = \$(COMMON_CONFIGURE_CFLAGS) \$(XAPIAN_CXXFLAGS)
1496 CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS)
1499 # construct the sh.config
1500 cat > sh.config <<EOF
1501 # This sh.config was automatically generated by the ./configure
1502 # script of notmuch.
1504 NOTMUCH_SRCDIR='${NOTMUCH_SRCDIR}'
1506 # Whether to have Xapian retry lock
1507 NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK=${WITH_RETRY_LOCK}
1509 # Which backend will Xapian use by default?
1510 NOTMUCH_DEFAULT_XAPIAN_BACKEND=${default_xapian_backend}
1512 # Whether GMime can verify X.509 certificate validity
1513 NOTMUCH_GMIME_X509_CERT_VALIDITY=${gmime_x509_cert_validity}
1515 # Whether GMime can verify signatures when decrypting with a session key:
1516 NOTMUCH_GMIME_VERIFY_WITH_SESSION_KEY=${gmime_verify_with_session_key}
1518 # do we have man pages?
1519 NOTMUCH_HAVE_MAN=$((have_sphinx))
1521 # Whether bash exists, and if so where
1522 NOTMUCH_HAVE_BASH=${have_bash}
1523 NOTMUCH_BASH_ABSOLUTE=${bash_absolute}
1525 # Whether time_t is 64 bits (or more)
1526 NOTMUCH_HAVE_64BIT_TIME_T=${have_64bit_time_t}
1528 # Whether perl exists, and if so where
1529 NOTMUCH_HAVE_PERL=${have_perl}
1530 NOTMUCH_PERL_ABSOLUTE=${perl_absolute}
1532 # Name of python interpreter
1533 NOTMUCH_PYTHON=${python}
1535 # Name of ruby interpreter
1536 NOTMUCH_RUBY=${RUBY}
1538 # Are the ruby development files (and ruby) available? If not skip
1539 # building/testing ruby bindings.
1540 NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev}
1542 # Is the python cffi package available?
1543 NOTMUCH_HAVE_PYTHON3_CFFI=${have_python3_cffi}
1545 # Is the python pytest package available?
1546 NOTMUCH_HAVE_PYTHON3_PYTEST=${have_python3_pytest}
1548 # Platform we are run on
1549 PLATFORM=${platform}
1552 cat > sphinx.config <<EOF
1553 # Generated by configure, run from doc/conf.py
1555 if [ $WITH_EMACS = "1" ]; then
1556 printf "tags.add('WITH_EMACS')\n" >> sphinx.config
1558 if [ $WITH_PYTHON_DOCS = "1" ]; then
1559 printf "tags.add('WITH_PYTHON')\n" >> sphinx.config
1561 printf "rsti_dir = '%s'\n" $(realpath emacs) >> sphinx.config
1563 # Finally, after everything configured, inform the user how to continue.
1566 All required packages were found. You may now run the following
1567 commands to compile and install notmuch: