1 Return-Path: <bremner@tesseract.cs.unb.ca>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id 5C2336DE0360
\r
6 for <notmuch@notmuchmail.org>; Sat, 26 Mar 2016 11:23:39 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.021,
\r
12 HEADER_FROM_DIFFERENT_DOMAINS=0.001] autolearn=disabled
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 6G57FLj-42sF for <notmuch@notmuchmail.org>;
\r
16 Sat, 26 Mar 2016 11:23:31 -0700 (PDT)
\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])
\r
18 by arlo.cworth.org (Postfix) with ESMTPS id 466376DE02C4
\r
19 for <notmuch@notmuchmail.org>; Sat, 26 Mar 2016 11:23:18 -0700 (PDT)
\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)
\r
21 (envelope-from <bremner@tesseract.cs.unb.ca>)
\r
22 id 1ajsTZ-0000vm-GB; Sat, 26 Mar 2016 13:58:17 -0400
\r
23 Received: (nullmailer pid 8806 invoked by uid 1000);
\r
24 Sat, 26 Mar 2016 17:57:27 -0000
\r
25 From: David Bremner <david@tethera.net>
\r
26 To: notmuch@notmuchmail.org
\r
27 Subject: [Patch v2 02/13] configure: detect Xapian:FieldProcessor
\r
28 Date: Sat, 26 Mar 2016 14:57:12 -0300
\r
29 Message-Id: <1459015043-8460-3-git-send-email-david@tethera.net>
\r
30 X-Mailer: git-send-email 2.6.4
\r
31 In-Reply-To: <1459015043-8460-1-git-send-email-david@tethera.net>
\r
32 References: <1459015043-8460-1-git-send-email-david@tethera.net>
\r
33 X-BeenThere: notmuch@notmuchmail.org
\r
34 X-Mailman-Version: 2.1.20
\r
36 List-Id: "Use and development of the notmuch mail system."
\r
37 <notmuch.notmuchmail.org>
\r
38 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
39 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
41 List-Post: <mailto:notmuch@notmuchmail.org>
\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
43 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
45 X-List-Received-Date: Sat, 26 Mar 2016 18:23:39 -0000
\r
47 Rather than check versions, it seems more robust to do a test compile.
\r
49 configure | 26 +++++++++++++++++++++++++-
\r
50 1 file changed, 25 insertions(+), 1 deletion(-)
\r
52 diff --git a/configure b/configure
\r
53 index eb6dbac..c48f7ce 100755
\r
56 @@ -356,9 +356,10 @@ if [ ${have_xapian} = "0" ]; then
\r
57 errors=$((errors + 1))
\r
60 -# Compaction is only supported on Xapian > 1.2.6
\r
61 have_xapian_compact=0
\r
62 +have_xapian_field_processor=0
\r
63 if [ ${have_xapian} = "1" ]; then
\r
64 + # Compaction is only supported on Xapian > 1.2.6
\r
65 printf "Checking for Xapian compaction support... "
\r
66 case "${xapian_version}" in
\r
67 0.*|1.[01].*|1.2.[0-5])
\r
68 @@ -369,6 +370,21 @@ if [ ${have_xapian} = "1" ]; then
\r
70 printf "Unknown version.\n" ;;
\r
73 + printf "Checking for Xapian FieldProcessor API... "
\r
74 + cat>_field_processor.cc<<EOF
\r
75 +#include <xapian.h>
\r
76 +class TitleFieldProcessor : public Xapian::FieldProcessor { };
\r
78 + if ${CXX} ${CXXLAGS} ${xapian_cxxflags} -c _field_processor.cc -o _field_processor.o > /dev/null 2>&1
\r
80 + have_xapian_field_processor=1
\r
83 + printf "No. (optional)\n"
\r
86 + rm -f _field_processor.o _field_processor.cc
\r
90 @@ -979,6 +995,9 @@ HAVE_D_TYPE = ${have_d_type}
\r
91 # Whether the Xapian version in use supports compaction
\r
92 HAVE_XAPIAN_COMPACT = ${have_xapian_compact}
\r
94 +# Whether the Xapian version in use supports field processors
\r
95 +HAVE_XAPIAN_FIELD_PROCESSOR = ${have_xapian_field_processor}
\r
97 # Whether the getpwuid_r function is standards-compliant
\r
98 # (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS
\r
99 # to enable the standards-compliant version -- needed for Solaris)
\r
100 @@ -1050,6 +1069,7 @@ CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
\r
101 -DSTD_GETPWUID=\$(STD_GETPWUID) \\
\r
102 -DSTD_ASCTIME=\$(STD_ASCTIME) \\
\r
103 -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\
\r
104 + -DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_PROCESSOR) \\
\r
105 -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)
\r
107 CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
\r
108 @@ -1064,6 +1084,7 @@ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
\r
109 -DSTD_GETPWUID=\$(STD_GETPWUID) \\
\r
110 -DSTD_ASCTIME=\$(STD_ASCTIME) \\
\r
111 -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT) \\
\r
112 + -DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_FIELD_PROCESSOR) \\
\r
113 -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)
\r
115 CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS)
\r
116 @@ -1077,6 +1098,9 @@ cat > sh.config <<EOF
\r
117 # Whether the Xapian version in use supports compaction
\r
118 NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact}
\r
120 +# Whether the Xapian version in use supports field processors
\r
121 +NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR=${have_xapian_field_processor}
\r
123 # do we have man pages?
\r
124 NOTMUCH_HAVE_MAN=$((have_sphinx))
\r