X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=configure;h=4fc31ccf8e79264b96ecb96d92794f295eb0205d;hp=a79f6bd5e2efb531a519b27ebbad75c622db7c09;hb=604d1e0977c2ede365f87492d6b9bf9a83c3e1d3;hpb=79856189a24ed2b78f30e55ccd5f7b5299659073 diff --git a/configure b/configure index a79f6bd5..4fc31ccf 100755 --- a/configure +++ b/configure @@ -51,7 +51,7 @@ CPPFLAGS=${CPPFLAGS:-} CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}} CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)} LDFLAGS=${LDFLAGS:-} -XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config} +XAPIAN_CONFIG=${XAPIAN_CONFIG:-} PYTHON=${PYTHON:-} # We don't allow the EMACS or GZIP Makefile variables inherit values @@ -341,7 +341,7 @@ fi printf "Checking for Xapian development files... " have_xapian=0 -for xapian_config in ${XAPIAN_CONFIG}; do +for xapian_config in ${XAPIAN_CONFIG} xapian-config xapian-config-1.3; do if ${xapian_config} --version > /dev/null 2>&1; then xapian_version=$(${xapian_config} --version | sed -e 's/.* //') printf "Yes (%s).\n" ${xapian_version} @@ -371,7 +371,25 @@ if [ ${have_xapian} = "1" ]; then esac fi - +default_xapian_backend="" +if [ ${have_xapian} = "1" ]; then + printf "Testing default Xapian backend... " + cat >_default_backend.cc < +int main(int argc, char** argv) { + Xapian::WritableDatabase db("test.db",Xapian::DB_CREATE_OR_OPEN); +} +EOF + ${CXX} ${CXXLAGS} ${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 "${default_xapian_backend}\n"; + rm -rf test.db _default_backend _default_backend.cc +fi # we need to have a version >= 2.6.5 to avoid a crypto bug. We need # 2.6.7 for permissive "From " header handling. GMIME_MINVER=2.6.7 @@ -1001,6 +1019,9 @@ LINKER_RESOLVES_LIBRARY_DEPENDENCIES = ${linker_resolves_library_dependencies} XAPIAN_CXXFLAGS = ${xapian_cxxflags} XAPIAN_LDFLAGS = ${xapian_ldflags} +# Which backend will Xapian use by default? +DEFAULT_XAPIAN_BACKEND = ${default_xapian_backend} + # Flags needed to compile and link against GMime GMIME_CFLAGS = ${gmime_cflags} GMIME_LDFLAGS = ${gmime_ldflags} @@ -1077,6 +1098,9 @@ cat > sh.config <