Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 9d / 063ea7497fefa709d56db9ba7899d293bf28e1
1 Return-Path: <blakej@foo.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 olra.theworths.org (Postfix) with ESMTP id 7EB6A431FC3\r
6         for <notmuch@notmuchmail.org>; Mon,  5 Nov 2012 11:02:24 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id cp8auGpSukQw for <notmuch@notmuchmail.org>;\r
16         Mon,  5 Nov 2012 11:02:23 -0800 (PST)\r
17 Received: from foo.net (70-36-235-136.dsl.static.sonic.net [70.36.235.136])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 65EFC431FCB\r
21         for <notmuch@notmuchmail.org>; Mon,  5 Nov 2012 11:02:21 -0800 (PST)\r
22 Received: from foo.net (localhost [127.0.0.1])\r
23         by foo.net (8.14.5+Sun/8.14.5) with ESMTP id qA5J2I4C019080;\r
24         Mon, 5 Nov 2012 11:02:18 -0800 (PST)\r
25 Received: (from blakej@localhost)\r
26         by foo.net (8.14.5+Sun/8.14.5/Submit) id qA5J2IfV019079;\r
27         Mon, 5 Nov 2012 11:02:18 -0800 (PST)\r
28 From: Blake Jones <blakej@foo.net>\r
29 To: notmuch@notmuchmail.org\r
30 Subject: [PATCH v2 01/10] getpwuid: check for standards compliance (Solaris\r
31         support)\r
32 Date: Mon,  5 Nov 2012 11:01:54 -0800\r
33 Message-Id: <1352142123-18286-2-git-send-email-blakej@foo.net>\r
34 X-Mailer: git-send-email 1.7.3.2\r
35 In-Reply-To: <1352142123-18286-1-git-send-email-blakej@foo.net>\r
36 References: <1352142123-18286-1-git-send-email-blakej@foo.net>\r
37 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2\r
38         (foo.net [127.0.0.1]); Mon, 05 Nov 2012 11:02:18 -0800 (PST)\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Mon, 05 Nov 2012 19:02:25 -0000\r
52 \r
53 Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs\r
54 to be defined to get the right number of arguments in the prototypes for\r
55 getpwuid_r().  Solaris' default implementation conforms to POSIX.1c\r
56 Draft 6, rather than the final POSIX.1c spec.  The standards-compliant\r
57 version can be used by defining _POSIX_PTHREAD_SEMANTICS.\r
58 \r
59 This change also adds the file "compat/check_getpwuid.c", which\r
60 configure uses to perform its check, and modifies compat/compat.h to\r
61 define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed.\r
62 ---\r
63  compat/check_getpwuid.c |   11 +++++++++++\r
64  compat/compat.h         |    4 ++++\r
65  configure               |   23 +++++++++++++++++++++--\r
66  3 files changed, 36 insertions(+), 2 deletions(-)\r
67  create mode 100644 compat/check_getpwuid.c\r
68 \r
69 diff --git a/compat/check_getpwuid.c b/compat/check_getpwuid.c\r
70 new file mode 100644\r
71 index 0000000..c435eb8\r
72 --- /dev/null\r
73 +++ b/compat/check_getpwuid.c\r
74 @@ -0,0 +1,11 @@\r
75 +#include <stdio.h>\r
76 +#include <pwd.h>\r
77 +\r
78 +int main()\r
79 +{\r
80 +    struct passwd passwd, *ignored;\r
81 +\r
82 +    (void) getpwuid_r (0, &passwd, NULL, 0, &ignored);\r
83 +\r
84 +    return (0);\r
85 +}\r
86 diff --git a/compat/compat.h b/compat/compat.h\r
87 index b2e2736..efea023 100644\r
88 --- a/compat/compat.h\r
89 +++ b/compat/compat.h\r
90 @@ -54,6 +54,10 @@ char* strcasestr(const char *haystack, const char *needle);\r
91  #define IGNORE_RESULT(x) x\r
92  #endif /* __GNUC__ */\r
93  \r
94 +#if !STD_GETPWUID\r
95 +#define _POSIX_PTHREAD_SEMANTICS 1\r
96 +#endif\r
97 +\r
98  #ifdef __cplusplus\r
99  }\r
100  #endif\r
101 diff --git a/configure b/configure\r
102 index ea8a1ad..bb5031e 100755\r
103 --- a/configure\r
104 +++ b/configure\r
105 @@ -512,6 +512,17 @@ else\r
106  fi\r
107  rm -f compat/have_strcasestr\r
108  \r
109 +printf "Checking for standard version of getpwuid_r... "\r
110 +if ${CC} -o compat/check_getpwuid "$srcdir"/compat/check_getpwuid.c > /dev/null 2>&1\r
111 +then\r
112 +    printf "Yes.\n"\r
113 +    std_getpwuid=1\r
114 +else\r
115 +    printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"\r
116 +    std_getpwuid=0\r
117 +fi\r
118 +rm -f compat/check_getpwuid\r
119 +\r
120  printf "int main(void){return 0;}\n" > minimal.c\r
121  \r
122  printf "Checking for rpath support... "\r
123 @@ -671,6 +682,11 @@ HAVE_GETLINE = ${have_getline}\r
124  # build its own version)\r
125  HAVE_STRCASESTR = ${have_strcasestr}\r
126  \r
127 +# Whether the getpwuid_r function is standards-compliant\r
128 +# (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS\r
129 +# to enable the standards-compliant version -- needed for Solaris)\r
130 +STD_GETPWUID = ${std_getpwuid}\r
131 +\r
132  # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD, OPENBSD\r
133  PLATFORM = ${platform}\r
134  \r
135 @@ -715,10 +731,13 @@ WITH_ZSH = ${WITH_ZSH}\r
136  # Combined flags for compiling and linking against all of the above\r
137  CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)      \\\r
138                    \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND)   \\\r
139 -                  \$(VALGRIND_CFLAGS) -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)\r
140 +                  \$(VALGRIND_CFLAGS)                                   \\\r
141 +                  -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)                 \\\r
142 +                  -DSTD_GETPWUID=\$(STD_GETPWUID)\r
143  CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)    \\\r
144                      \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\\r
145                      \$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS)             \\\r
146 -                     -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)\r
147 +                    -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)               \\\r
148 +                    -DSTD_GETPWUID=\$(STD_GETPWUID)\r
149  CONFIGURE_LDFLAGS =  \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(XAPIAN_LDFLAGS)\r
150  EOF\r
151 -- \r
152 1.7.3.2\r
153 \r