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 8631F431FD8
\r
6 for <notmuch@notmuchmail.org>; Sat, 3 Nov 2012 20:24:23 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 dfbYinEmaS26 for <notmuch@notmuchmail.org>;
\r
16 Sat, 3 Nov 2012 20:24:22 -0700 (PDT)
\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 9C7FF431FB6
\r
21 for <notmuch@notmuchmail.org>; Sat, 3 Nov 2012 20:24:20 -0700 (PDT)
\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 qA43GEAC025659;
\r
24 Sat, 3 Nov 2012 20:16:14 -0700 (PDT)
\r
25 Received: (from blakej@localhost)
\r
26 by foo.net (8.14.5+Sun/8.14.5/Submit) id qA43GEpI025658;
\r
27 Sat, 3 Nov 2012 20:16:14 -0700 (PDT)
\r
28 From: Blake Jones <blakej@foo.net>
\r
29 To: notmuch@notmuchmail.org
\r
30 Subject: [PATCH 02/10] asctime: check for standards compliance (Solaris
\r
32 Date: Sat, 3 Nov 2012 20:15:54 -0700
\r
33 Message-Id: <1351998962-25135-3-git-send-email-blakej@foo.net>
\r
34 X-Mailer: git-send-email 1.7.3.2
\r
35 In-Reply-To: <1351998962-25135-1-git-send-email-blakej@foo.net>
\r
36 References: <1351998962-25135-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]); Sat, 03 Nov 2012 20:16:14 -0700 (PDT)
\r
39 X-Mailman-Approved-At: Sun, 04 Nov 2012 01:30:19 -0800
\r
40 Cc: Blake Jones <blakej@foo.net>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Sun, 04 Nov 2012 03:24:24 -0000
\r
55 Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs
\r
56 to be defined to get the right number of arguments in the prototypes for
\r
57 asctime_r(). Solaris' default implementation conforms to POSIX.1c
\r
58 Draft 6, rather than the final POSIX.1c spec. The standards-compliant
\r
59 version can be used by defining _POSIX_PTHREAD_SEMANTICS.
\r
61 This change also adds the file "compat/check_asctime.c", which
\r
62 configure uses to perform its check, and modifies compat/compat.h to
\r
63 define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed.
\r
65 compat/check_asctime.c | 17 +++++++++++++++++
\r
66 compat/compat.h | 3 +++
\r
67 configure | 22 ++++++++++++++++++++--
\r
68 3 files changed, 40 insertions(+), 2 deletions(-)
\r
69 create mode 100644 compat/check_asctime.c
\r
71 diff --git a/compat/check_asctime.c b/compat/check_asctime.c
\r
72 new file mode 100644
\r
73 index 0000000..a595110
\r
75 +++ b/compat/check_asctime.c
\r
78 + * This compatibility check actually succeeds (on Solaris) if
\r
79 + * _POSIX_PTHREAD_SEMANTICS is not defined. But we need to define that to get
\r
80 + * the right version of getpwuid_r(), so we define it here to ensure that the
\r
81 + * compatibility check ends up doing the same thing as the rest of the code.
\r
83 +#define _POSIX_PTHREAD_SEMANTICS
\r
90 + (void) asctime_r (&tm, NULL, 0);
\r
94 diff --git a/compat/compat.h b/compat/compat.h
\r
95 index 8374d2f..b750501 100644
\r
96 --- a/compat/compat.h
\r
97 +++ b/compat/compat.h
\r
98 @@ -57,6 +57,9 @@ char* strcasestr(const char *haystack, const char *needle);
\r
100 #define _POSIX_PTHREAD_SEMANTICS
\r
103 +#define _POSIX_PTHREAD_SEMANTICS
\r
108 diff --git a/configure b/configure
\r
109 index 3c18a45..047c011 100755
\r
112 @@ -523,6 +523,17 @@ else
\r
114 rm -f compat/check_getpwuid
\r
116 +printf "Checking for standard version of asctime_r... "
\r
117 +if ${CC} -o compat/check_asctime "$srcdir"/compat/check_asctime.c > /dev/null 2>&1
\r
122 + printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"
\r
125 +rm -f compat/check_asctime
\r
127 printf "int main(void){return 0;}\n" > minimal.c
\r
129 printf "Checking for rpath support... "
\r
130 @@ -687,6 +698,11 @@ HAVE_STRCASESTR = ${have_strcasestr}
\r
131 # to enable the standards-compliant version -- needed for Solaris)
\r
132 STD_GETPWUID = ${std_getpwuid}
\r
134 +# Whether the asctime_r function is standards-compliant
\r
135 +# (if not, then notmuch will compile with -D_POSIX_PTHREAD_SEMANTICS
\r
136 +# to enable the standards-compliant version -- needed for Solaris)
\r
137 +STD_ASCTIME = ${std_asctime}
\r
139 # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD, OPENBSD
\r
140 PLATFORM = ${platform}
\r
142 @@ -733,11 +749,13 @@ CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
\r
143 \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
\r
144 \$(VALGRIND_CFLAGS) \\
\r
145 -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
\r
146 - -DSTD_GETPWUID=\$(STD_GETPWUID)
\r
147 + -DSTD_GETPWUID=\$(STD_GETPWUID) \\
\r
148 + -DSTD_ASCTIME=\$(STD_ASCTIME)
\r
149 CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
\r
150 \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
\r
151 \$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS) \\
\r
152 -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
\r
153 - -DSTD_GETPWUID=\$(STD_GETPWUID)
\r
154 + -DSTD_GETPWUID=\$(STD_GETPWUID) \\
\r
155 + -DSTD_ASCTIME=\$(STD_ASCTIME)
\r
156 CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(XAPIAN_LDFLAGS)
\r