[Patch v2 02/13] configure: detect Xapian:FieldProcessor
authorDavid Bremner <david@tethera.net>
Sat, 26 Mar 2016 17:57:12 +0000 (14:57 +2100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:24 +0000 (16:21 -0700)
1f/8ffb02712bc859a4469128729fba98ba461065 [new file with mode: 0644]

diff --git a/1f/8ffb02712bc859a4469128729fba98ba461065 b/1f/8ffb02712bc859a4469128729fba98ba461065
new file mode 100644 (file)
index 0000000..d68ae7f
--- /dev/null
@@ -0,0 +1,128 @@
+Return-Path: <bremner@tesseract.cs.unb.ca>\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 5C2336DE0360\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Mar 2016 11:23:39 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.02\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.021,\r
+  HEADER_FROM_DIFFERENT_DOMAINS=0.001] 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 6G57FLj-42sF for <notmuch@notmuchmail.org>;\r
+ Sat, 26 Mar 2016 11:23:31 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 466376DE02C4\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Mar 2016 11:23:18 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1ajsTZ-0000vm-GB; Sat, 26 Mar 2016 13:58:17 -0400\r
+Received: (nullmailer pid 8806 invoked by uid 1000);\r
+ Sat, 26 Mar 2016 17:57:27 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v2 02/13] configure: detect Xapian:FieldProcessor\r
+Date: Sat, 26 Mar 2016 14:57:12 -0300\r
+Message-Id: <1459015043-8460-3-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.6.4\r
+In-Reply-To: <1459015043-8460-1-git-send-email-david@tethera.net>\r
+References: <1459015043-8460-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: Sat, 26 Mar 2016 18:23:39 -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.6.4\r
+\r