Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 9d / 8effb09cbd8a4689a3629918f9f13bd92f69e0
1 Return-Path: <bremner@tethera.net>\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 85ECB6DE00C9\r
6  for <notmuch@notmuchmail.org>; Sat, 19 Mar 2016 18:38:55 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.03\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.03 tagged_above=-999 required=5 tests=[AWL=-0.019,\r
12   SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 AkCTQCxCgE39 for <notmuch@notmuchmail.org>;\r
16  Sat, 19 Mar 2016 18:38:47 -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 141FD6DE00B7\r
19  for <notmuch@notmuchmail.org>; Sat, 19 Mar 2016 18:38:38 -0700 (PDT)\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
21  (envelope-from <bremner@tethera.net>)\r
22  id 1ahSKn-0001WB-5L; Sat, 19 Mar 2016 21:39:13 -0400\r
23 Received: (nullmailer pid 17758 invoked by uid 1000);\r
24  Sun, 20 Mar 2016 01:38:32 -0000\r
25 From: David Bremner <david@tethera.net>\r
26 To: notmuch@notmuchmail.org\r
27 Subject: [PATCH 2/3] configure: detect Xapian:FieldProcessor\r
28 Date: Sat, 19 Mar 2016 22:38:23 -0300\r
29 Message-Id: <1458437904-17677-3-git-send-email-david@tethera.net>\r
30 X-Mailer: git-send-email 2.7.0\r
31 In-Reply-To: <1458437904-17677-1-git-send-email-david@tethera.net>\r
32 References: <1458437904-17677-1-git-send-email-david@tethera.net>\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.20\r
35 Precedence: list\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: Sun, 20 Mar 2016 01:38:55 -0000\r
46 \r
47 Rather than check versions, it seems more robust to do a test compile.\r
48 ---\r
49  configure | 30 +++++++++++++++++++++++++++++-\r
50  1 file changed, 29 insertions(+), 1 deletion(-)\r
51 \r
52 diff --git a/configure b/configure\r
53 index eb6dbac..8feb23f 100755\r
54 --- a/configure\r
55 +++ b/configure\r
56 @@ -356,9 +356,10 @@ if [ ${have_xapian} = "0" ]; then\r
57      errors=$((errors + 1))\r
58  fi\r
59  \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,25 @@ if [ ${have_xapian} = "1" ]; then\r
69         *)\r
70             printf "Unknown version.\n" ;;\r
71      esac\r
72 +\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
77 +    Xapian::Query operator()(const std::string & str) {\r
78 +        return Xapian::Query::MatchAll;\r
79 +    }\r
80 +};\r
81 +EOF\r
82 +    if ${CXX} ${CXXLAGS} ${xapian_cxxflags} -c _field_processor.cc -o _field_processor.o > /dev/null 2>&1\r
83 +    then\r
84 +       have_xapian_field_processor=1\r
85 +       printf "Yes.\n"\r
86 +    else\r
87 +       printf "No. (optional)\n"\r
88 +    fi\r
89 +\r
90 +    rm -f _field_processor.o _field_processor.cc\r
91  fi\r
92  \r
93  \r
94 @@ -979,6 +999,9 @@ HAVE_D_TYPE = ${have_d_type}\r
95  # Whether the Xapian version in use supports compaction\r
96  HAVE_XAPIAN_COMPACT = ${have_xapian_compact}\r
97  \r
98 +# Whether the Xapian version in use supports field processors\r
99 +HAVE_XAPIAN_FIELD_PROCESSOR = ${have_xapian_field_processor}\r
100 +\r
101  # Whether the getpwuid_r function is standards-compliant\r
102  # (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS\r
103  # to enable the standards-compliant version -- needed for Solaris)\r
104 @@ -1050,6 +1073,7 @@ CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)      \\\r
105                    -DSTD_GETPWUID=\$(STD_GETPWUID)                       \\\r
106                    -DSTD_ASCTIME=\$(STD_ASCTIME)                         \\\r
107                    -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT)         \\\r
108 +                  -DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_PROCESSOR) \\\r
109                    -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)\r
110  \r
111  CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)    \\\r
112 @@ -1064,6 +1088,7 @@ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)    \\\r
113                      -DSTD_GETPWUID=\$(STD_GETPWUID)                     \\\r
114                      -DSTD_ASCTIME=\$(STD_ASCTIME)                       \\\r
115                      -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT)       \\\r
116 +                    -DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_FIELD_PROCESSOR) \\\r
117                      -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)\r
118  \r
119  CONFIGURE_LDFLAGS =  \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(XAPIAN_LDFLAGS)\r
120 @@ -1077,6 +1102,9 @@ cat > sh.config <<EOF\r
121  # Whether the Xapian version in use supports compaction\r
122  NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact}\r
123  \r
124 +# Whether the Xapian version in use supports field processors\r
125 +NOTMUCH_HAVE_XAPIAN_FIELD_PROCESSOR=${have_xapian_field_processor}\r
126 +\r
127  # do we have man pages?\r
128  NOTMUCH_HAVE_MAN=$((have_sphinx))\r
129  \r
130 -- \r
131 2.7.0\r
132 \r