LIBDIR=
WITH_DOCS=1
WITH_API_DOCS=1
+WITH_PYTHON_DOCS=1
WITH_EMACS=1
WITH_DESKTOP=1
WITH_BASH=1
errors=$((errors + 1))
fi
-if [ ${have_xapian} = "1" ]; then
- default_xapian_backend=""
- printf "Testing default Xapian backend... "
- cat >_default_backend.cc <<EOF
-#include <xapian.h>
-int main(int argc, char** argv) {
- Xapian::WritableDatabase db("test.db",Xapian::DB_CREATE_OR_OPEN);
-}
-EOF
- ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} _default_backend.cc -o _default_backend ${xapian_ldflags}
- ./_default_backend
- if [ -f test.db/iamglass ]; then
- default_xapian_backend=glass
- else
- default_xapian_backend=chert
- fi
- printf "%s\n" "${default_xapian_backend}";
- rm -rf test.db _default_backend _default_backend.cc
-fi
-
GMIME_MINVER=3.0.3
printf "Checking for GMime development files (>= $GMIME_MINVER)... "
if "$python" -c 'import cffi,setuptools; cffi.FFI().verify()' >/dev/null 2>&1; then
printf "Yes.\n"
have_python3_cffi=1
+ WITH_PYTHON_DOCS=1
else
+ WITH_PYTHON_DOCS=0
printf "No (will not install CFFI-based python bindings).\n"
fi
rm -rf __pycache__ # cffi.FFI().verify() uses this space
printf "Checking for python3 pytest (>= 3.0)... "
conf=$(mktemp)
printf "[pytest]\nminversion=3.0\n" > $conf
- if pytest-3 -c $conf --version >/dev/null 2>&1; then
+ if "$python" -m pytest -c $conf --version >/dev/null 2>&1; then
printf "Yes.\n"
have_python3_pytest=1
else
WITH_BASH=0
fi
+printf "Checking for sfsexp... "
+if pkg-config --exists sfsexp; then
+ printf "Yes.\n"
+ have_sfsexp=1
+ sfsexp_cflags=$(pkg-config --cflags sfsexp)
+ sfsexp_ldflags=$(pkg-config --libs sfsexp)
+else
+ printf "No (will not enable s-expression queries).\n"
+ have_sfsexp=0
+ sfsexp_cflags=
+ sfsexp_ldflags=
+fi
+
if [ -z "${EMACSLISPDIR-}" ]; then
EMACSLISPDIR="\$(prefix)/share/emacs/site-lisp"
fi
fi
if [ $WITH_EMACS = "1" ]; then
- printf "Checking if emacs (>= 24) is available... "
- if emacs --quick --batch --eval '(if (< emacs-major-version 24) (kill-emacs 1))' > /dev/null 2>&1; then
+ printf "Checking if emacs (>= 25) is available... "
+ if emacs --quick --batch --eval '(if (< emacs-major-version 25) (kill-emacs 1))' > /dev/null 2>&1; then
printf "Yes.\n"
else
printf "No (disabling emacs related parts of build)\n"
# And if so, flags needed at compile time for valgrind macros
VALGRIND_CFLAGS = ${valgrind_cflags}
+# Whether the sfsexp library is available
+HAVE_SFSEXP = ${have_sfsexp}
+
+# And if so, flags needed at compile/link time for sfsexp
+SFSEXP_CFLAGS = ${sfsexp_cflags}
+SFSEXP_LDFLAGS = ${sfsexp_ldflags}
+
# Support for emacs
WITH_EMACS = ${WITH_EMACS}
COMMON_CONFIGURE_CFLAGS = \\
\$(GMIME_CFLAGS) \$(TALLOC_CFLAGS) \$(ZLIB_CFLAGS) \\
-DHAVE_VALGRIND=\$(HAVE_VALGRIND) \$(VALGRIND_CFLAGS) \\
+ -DHAVE_SFSEXP=\$(HAVE_SFSEXP) \$(SFSEXP_CFLAGS) \\
-DHAVE_GETLINE=\$(HAVE_GETLINE) \\
-DWITH_EMACS=\$(WITH_EMACS) \\
-DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
CONFIGURE_CXXFLAGS = \$(COMMON_CONFIGURE_CFLAGS) \$(XAPIAN_CXXFLAGS)
-CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS)
+CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS) \$(SFSEXP_LDFLAGS)
EOF
# construct the sh.config
# Whether to have Xapian retry lock
NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK=${WITH_RETRY_LOCK}
-# Which backend will Xapian use by default?
-NOTMUCH_DEFAULT_XAPIAN_BACKEND=${default_xapian_backend}
-
# Whether GMime can verify X.509 certificate validity
NOTMUCH_GMIME_X509_CERT_VALIDITY=${gmime_x509_cert_validity}
# Is the python pytest package available?
NOTMUCH_HAVE_PYTHON3_PYTEST=${have_python3_pytest}
+# Is the sfsexp library available?
+NOTMUCH_HAVE_SFSEXP=${have_sfsexp}
+
# Platform we are run on
PLATFORM=${platform}
EOF
+{
+ echo "# Generated by configure, run from doc/conf.py"
+ if [ $WITH_EMACS = "1" ]; then
+ echo "tags.add('WITH_EMACS')"
+ fi
+ if [ $WITH_PYTHON_DOCS = "1" ]; then
+ echo "tags.add('WITH_PYTHON')"
+ fi
+ printf "rsti_dir = '%s'\n" "$(cd emacs && pwd -P)"
+} > sphinx.config
+
# Finally, after everything configured, inform the user how to continue.
cat <<EOF