From: David Bremner Date: Fri, 13 May 2016 10:38:03 +0000 (+2100) Subject: [Patch v5 01/11] configure: detect Xapian:FieldProcessor X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=41f4ff78418a5958f4bfd115144c9ad2688c9309;p=notmuch-archives.git [Patch v5 01/11] configure: detect Xapian:FieldProcessor --- diff --git a/4d/fa3cbf7ffab2b5f9ac2a2db97e16b8c919f462 b/4d/fa3cbf7ffab2b5f9ac2a2db97e16b8c919f462 new file mode 100644 index 000000000..3853279a0 --- /dev/null +++ b/4d/fa3cbf7ffab2b5f9ac2a2db97e16b8c919f462 @@ -0,0 +1,142 @@ +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 CE1DA6DE0318 + for ; Fri, 13 May 2016 03:39:02 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.013 +X-Spam-Level: +X-Spam-Status: No, score=-0.013 tagged_above=-999 required=5 + tests=[AWL=-0.002, 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 3OkzBWOG9fXC for ; + Fri, 13 May 2016 03:38:55 -0700 (PDT) +Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) + by arlo.cworth.org (Postfix) with ESMTPS id 9F6A26DE0350 + for ; Fri, 13 May 2016 03:38:29 -0700 (PDT) +Received: from remotemail by fethera.tethera.net with local (Exim 4.84) + (envelope-from ) + id 1b1AUA-0003PY-Kj; Fri, 13 May 2016 06:38:22 -0400 +Received: (nullmailer pid 7544 invoked by uid 1000); + Fri, 13 May 2016 10:38:16 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [Patch v5 01/11] configure: detect Xapian:FieldProcessor +Date: Fri, 13 May 2016 07:38:03 -0300 +Message-Id: <1463135893-7471-2-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.8.1 +In-Reply-To: <1463135893-7471-1-git-send-email-david@tethera.net> +References: <1463135893-7471-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: Fri, 13 May 2016 10:39:02 -0000 + +Rather than check versions, it seems more robust to do a test compile. +--- + configure | 31 +++++++++++++++++++++++++++---- + 1 file changed, 27 insertions(+), 4 deletions(-) + +diff --git a/configure b/configure +index c24a9c8..ba12c5a 100755 +--- a/configure ++++ b/configure +@@ -358,9 +358,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]) +@@ -371,10 +372,23 @@ if [ ${have_xapian} = "1" ]; then + *) + printf "Unknown version.\n" ;; + esac +-fi + +-default_xapian_backend="" +-if [ ${have_xapian} = "1" ]; then ++ printf "Checking for Xapian FieldProcessor API... " ++ cat>_field_processor.cc< ++class TitleFieldProcessor : public Xapian::FieldProcessor { }; ++EOF ++ if ${CXX} ${CXXFLAGS_for_sh} ${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 ++ ++ default_xapian_backend="" + printf "Testing default Xapian backend... " + cat >_default_backend.cc < +@@ -392,6 +406,7 @@ EOF + printf "%s\n" "${default_xapian_backend}"; + 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 +1016,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) +@@ -1075,6 +1093,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_FIELD_PROCESSOR) \\ + -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER) + + CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\ +@@ -1089,6 +1108,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) +@@ -1102,6 +1122,9 @@ cat > sh.config <