From 800d8e49a0addf1c75e57243d96113ca55e0c24e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 20 Mar 2016 22:38:23 +2100 Subject: [PATCH] [PATCH 2/3] configure: detect Xapian:FieldProcessor --- 9d/8effb09cbd8a4689a3629918f9f13bd92f69e0 | 132 ++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 9d/8effb09cbd8a4689a3629918f9f13bd92f69e0 diff --git a/9d/8effb09cbd8a4689a3629918f9f13bd92f69e0 b/9d/8effb09cbd8a4689a3629918f9f13bd92f69e0 new file mode 100644 index 000000000..fa2787cbb --- /dev/null +++ b/9d/8effb09cbd8a4689a3629918f9f13bd92f69e0 @@ -0,0 +1,132 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 85ECB6DE00C9 + for ; Sat, 19 Mar 2016 18:38:55 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.03 +X-Spam-Level: +X-Spam-Status: No, score=-0.03 tagged_above=-999 required=5 tests=[AWL=-0.019, + SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id AkCTQCxCgE39 for ; + Sat, 19 Mar 2016 18:38:47 -0700 (PDT) +Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) + by arlo.cworth.org (Postfix) with ESMTPS id 141FD6DE00B7 + for ; Sat, 19 Mar 2016 18:38:38 -0700 (PDT) +Received: from remotemail by fethera.tethera.net with local (Exim 4.84) + (envelope-from ) + id 1ahSKn-0001WB-5L; Sat, 19 Mar 2016 21:39:13 -0400 +Received: (nullmailer pid 17758 invoked by uid 1000); + Sun, 20 Mar 2016 01:38:32 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH 2/3] configure: detect Xapian:FieldProcessor +Date: Sat, 19 Mar 2016 22:38:23 -0300 +Message-Id: <1458437904-17677-3-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.7.0 +In-Reply-To: <1458437904-17677-1-git-send-email-david@tethera.net> +References: <1458437904-17677-1-git-send-email-david@tethera.net> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 20 Mar 2016 01:38:55 -0000 + +Rather than check versions, it seems more robust to do a test compile. +--- + configure | 30 +++++++++++++++++++++++++++++- + 1 file changed, 29 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index eb6dbac..8feb23f 100755 +--- a/configure ++++ b/configure +@@ -356,9 +356,10 @@ if [ ${have_xapian} = "0" ]; then + errors=$((errors + 1)) + fi + +-# Compaction is only supported on Xapian > 1.2.6 + have_xapian_compact=0 ++have_xapian_field_processor=0 + if [ ${have_xapian} = "1" ]; then ++ # Compaction is only supported on Xapian > 1.2.6 + printf "Checking for Xapian compaction support... " + case "${xapian_version}" in + 0.*|1.[01].*|1.2.[0-5]) +@@ -369,6 +370,25 @@ if [ ${have_xapian} = "1" ]; then + *) + printf "Unknown version.\n" ;; + esac ++ ++ printf "Checking for Xapian FieldProcessor API... " ++ cat>_field_processor.cc< ++class TitleFieldProcessor : public Xapian::FieldProcessor { ++ Xapian::Query operator()(const std::string & str) { ++ return Xapian::Query::MatchAll; ++ } ++}; ++EOF ++ if ${CXX} ${CXXLAGS} ${xapian_cxxflags} -c _field_processor.cc -o _field_processor.o > /dev/null 2>&1 ++ then ++ have_xapian_field_processor=1 ++ printf "Yes.\n" ++ else ++ printf "No. (optional)\n" ++ fi ++ ++ rm -f _field_processor.o _field_processor.cc + fi + + +@@ -979,6 +999,9 @@ HAVE_D_TYPE = ${have_d_type} + # Whether the Xapian version in use supports compaction + HAVE_XAPIAN_COMPACT = ${have_xapian_compact} + ++# Whether the Xapian version in use supports field processors ++HAVE_XAPIAN_FIELD_PROCESSOR = ${have_xapian_field_processor} ++ + # Whether the getpwuid_r function is standards-compliant + # (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS + # to enable the standards-compliant version -- needed for Solaris) +@@ -1050,6 +1073,7 @@ CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\ + -DSTD_GETPWUID=\$(STD_GETPWUID) \\ + -DSTD_ASCTIME=\$(STD_ASCTIME) \\ + -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\ ++ -DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_PROCESSOR) \\ + -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER) + + CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\ +@@ -1064,6 +1088,7 @@ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\ + -DSTD_GETPWUID=\$(STD_GETPWUID) \\ + -DSTD_ASCTIME=\$(STD_ASCTIME) \\ + -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\ ++ -DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_FIELD_PROCESSOR) \\ + -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER) + + CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS) +@@ -1077,6 +1102,9 @@ cat > sh.config <