--- /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 67CB16DE02B0\r
+ for <notmuch@notmuchmail.org>; Tue, 22 Mar 2016 03:55:24 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.029\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.029 tagged_above=-999 required=5\r
+ tests=[AWL=-0.018, 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 2aft2MenZusK for <notmuch@notmuchmail.org>;\r
+ Tue, 22 Mar 2016 03:55:16 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 7CFC56DE0297\r
+ for <notmuch@notmuchmail.org>; Tue, 22 Mar 2016 03:55:16 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1aiJyZ-000147-78; Tue, 22 Mar 2016 06:55:51 -0400\r
+Received: (nullmailer pid 14069 invoked by uid 1000);\r
+ Tue, 22 Mar 2016 10:55:11 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 02/13] configure: detect Xapian:FieldProcessor\r
+Date: Tue, 22 Mar 2016 07:54:43 -0300\r
+Message-Id: <1458644094-13951-3-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.7.0\r
+In-Reply-To: <1458644094-13951-1-git-send-email-david@tethera.net>\r
+References: <1458644094-13951-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: Tue, 22 Mar 2016 10:55:24 -0000\r
+\r
+Rather than check versions, it seems more robust to do a test compile.\r
+---\r
+ configure | 26 +++++++++++++++++++++++++-\r
+ 1 file changed, 25 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/configure b/configure\r
+index eb6dbac..c48f7ce 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -356,9 +356,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
+@@ -369,6 +370,21 @@ if [ ${have_xapian} = "1" ]; then\r
+ *)\r
+ printf "Unknown version.\n" ;;\r
+ esac\r
++\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} ${CXXLAGS} ${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
+ fi\r
+ \r
+ \r
+@@ -979,6 +995,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
+@@ -1050,6 +1069,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_PROCESSOR) \\\r
+ -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)\r
+ \r
+ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\\r
+@@ -1064,6 +1084,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
+@@ -1077,6 +1098,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
+ # do we have man pages?\r
+ NOTMUCH_HAVE_MAN=$((have_sphinx))\r
+ \r
+-- \r
+2.7.0\r
+\r