--- /dev/null
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id CE1DA6DE0318\r
+ for <notmuch@notmuchmail.org>; Fri, 13 May 2016 03:39:02 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.013\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.013 tagged_above=-999 required=5\r
+ tests=[AWL=-0.002, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 3OkzBWOG9fXC for <notmuch@notmuchmail.org>;\r
+ Fri, 13 May 2016 03:38:55 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 9F6A26DE0350\r
+ for <notmuch@notmuchmail.org>; Fri, 13 May 2016 03:38:29 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1b1AUA-0003PY-Kj; Fri, 13 May 2016 06:38:22 -0400\r
+Received: (nullmailer pid 7544 invoked by uid 1000);\r
+ Fri, 13 May 2016 10:38:16 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v5 01/11] configure: detect Xapian:FieldProcessor\r
+Date: Fri, 13 May 2016 07:38:03 -0300\r
+Message-Id: <1463135893-7471-2-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.8.1\r
+In-Reply-To: <1463135893-7471-1-git-send-email-david@tethera.net>\r
+References: <1463135893-7471-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 13 May 2016 10:39:02 -0000\r
+\r
+Rather than check versions, it seems more robust to do a test compile.\r
+---\r
+ configure | 31 +++++++++++++++++++++++++++----\r
+ 1 file changed, 27 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/configure b/configure\r
+index c24a9c8..ba12c5a 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -358,9 +358,10 @@ if [ ${have_xapian} = "0" ]; then\r
+ errors=$((errors + 1))\r
+ fi\r
+ \r
+-# Compaction is only supported on Xapian > 1.2.6\r
+ have_xapian_compact=0\r
++have_xapian_field_processor=0\r
+ if [ ${have_xapian} = "1" ]; then\r
++ # Compaction is only supported on Xapian > 1.2.6\r
+ printf "Checking for Xapian compaction support... "\r
+ case "${xapian_version}" in\r
+ 0.*|1.[01].*|1.2.[0-5])\r
+@@ -371,10 +372,23 @@ if [ ${have_xapian} = "1" ]; then\r
+ *)\r
+ printf "Unknown version.\n" ;;\r
+ esac\r
+-fi\r
+ \r
+-default_xapian_backend=""\r
+-if [ ${have_xapian} = "1" ]; then\r
++ printf "Checking for Xapian FieldProcessor API... "\r
++ cat>_field_processor.cc<<EOF\r
++#include <xapian.h>\r
++class TitleFieldProcessor : public Xapian::FieldProcessor { };\r
++EOF\r
++ if ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} -c _field_processor.cc -o _field_processor.o > /dev/null 2>&1\r
++ then\r
++ have_xapian_field_processor=1\r
++ printf "Yes.\n"\r
++ else\r
++ printf "No. (optional)\n"\r
++ fi\r
++\r
++ rm -f _field_processor.o _field_processor.cc\r
++\r
++ default_xapian_backend=""\r
+ printf "Testing default Xapian backend... "\r
+ cat >_default_backend.cc <<EOF\r
+ #include <xapian.h>\r
+@@ -392,6 +406,7 @@ EOF\r
+ printf "%s\n" "${default_xapian_backend}";\r
+ rm -rf test.db _default_backend _default_backend.cc\r
+ fi\r
++\r
+ # we need to have a version >= 2.6.5 to avoid a crypto bug. We need\r
+ # 2.6.7 for permissive "From " header handling.\r
+ GMIME_MINVER=2.6.7\r
+@@ -1001,6 +1016,9 @@ HAVE_D_TYPE = ${have_d_type}\r
+ # Whether the Xapian version in use supports compaction\r
+ HAVE_XAPIAN_COMPACT = ${have_xapian_compact}\r
+ \r
++# Whether the Xapian version in use supports field processors\r
++HAVE_XAPIAN_FIELD_PROCESSOR = ${have_xapian_field_processor}\r
++\r
+ # Whether the getpwuid_r function is standards-compliant\r
+ # (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS\r
+ # to enable the standards-compliant version -- needed for Solaris)\r
+@@ -1075,6 +1093,7 @@ CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\\r
+ -DSTD_GETPWUID=\$(STD_GETPWUID) \\\r
+ -DSTD_ASCTIME=\$(STD_ASCTIME) \\\r
+ -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\\r
++ -DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_FIELD_PROCESSOR) \\\r
+ -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)\r
+ \r
+ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\\r
+@@ -1089,6 +1108,7 @@ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\\r
+ -DSTD_GETPWUID=\$(STD_GETPWUID) \\\r
+ -DSTD_ASCTIME=\$(STD_ASCTIME) \\\r
+ -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\\r
++ -DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_FIELD_PROCESSOR) \\\r
+ -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)\r
+ \r
+ CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS)\r
+@@ -1102,6 +1122,9 @@ cat > sh.config <<EOF\r
+ # Whether the Xapian version in use supports compaction\r
+ NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact}\r
+ \r
++# Whether the Xapian version in use supports field processors\r
++NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR=${have_xapian_field_processor}\r
++\r
+ # Which backend will Xapian use by default?\r
+ NOTMUCH_DEFAULT_XAPIAN_BACKEND=${default_xapian_backend}\r
+ \r
+-- \r
+2.8.1\r
+\r