--- /dev/null
+Return-Path: <Vladimir.Marek@oracle.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id E6F98429E2E\r
+ for <notmuch@notmuchmail.org>; Fri, 16 Aug 2013 07:38:48 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.299\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.299 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3, UNPARSEABLE_RELAY=0.001]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 90JbGBETDi-3 for <notmuch@notmuchmail.org>;\r
+ Fri, 16 Aug 2013 07:38:43 -0700 (PDT)\r
+Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id EE49D431E82\r
+ for <notmuch@notmuchmail.org>; Fri, 16 Aug 2013 07:38:42 -0700 (PDT)\r
+Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])\r
+ by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with\r
+ ESMTP id r7GEceCg019364\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);\r
+ Fri, 16 Aug 2013 14:38:40 GMT\r
+Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85])\r
+ by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id\r
+ r7GEcdj6024145\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);\r
+ Fri, 16 Aug 2013 14:38:39 GMT\r
+Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])\r
+ by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id\r
+ r7GEcdhN025098; Fri, 16 Aug 2013 14:38:39 GMT\r
+Received: from tbd.cz.oracle.com (/10.163.101.124)\r
+ by default (Oracle Beehive Gateway v4.0)\r
+ with ESMTP ; Fri, 16 Aug 2013 07:38:38 -0700\r
+From: Vladimir.Marek@oracle.com\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/4] asctime: check for standards compliance (Solaris support)\r
+Date: Fri, 16 Aug 2013 16:38:15 +0200\r
+Message-Id: <1376663897-24385-3-git-send-email-Vladimir.Marek@oracle.com>\r
+X-Mailer: git-send-email 1.7.9.2\r
+In-Reply-To: <1376663897-24385-1-git-send-email-Vladimir.Marek@oracle.com>\r
+References: <1376663897-24385-1-git-send-email-Vladimir.Marek@oracle.com>\r
+X-Source-IP: ucsinet22.oracle.com [156.151.31.94]\r
+Cc: Vladimir Marek <vlmarek@volny.cz>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 16 Aug 2013 14:38:49 -0000\r
+\r
+From: Vladimir Marek <vlmarek@volny.cz>\r
+\r
+Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs\r
+to be defined to get the right number of arguments in the prototypes for\r
+asctime_r(). Solaris' default implementation conforms to POSIX.1c\r
+Draft 6, rather than the final POSIX.1c spec. The standards-compliant\r
+version can be used by defining _POSIX_PTHREAD_SEMANTICS.\r
+\r
+This change also adds the file "compat/check_asctime.c", which\r
+configure uses to perform its check, and modifies compat/compat.h to\r
+define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed.\r
+\r
+Signed-off-by: Vladimir Marek <vlmarek@volny.cz>\r
+---\r
+ compat/check_asctime.c | 11 +++++++++++\r
+ compat/compat.h | 3 +++\r
+ configure | 22 ++++++++++++++++++++--\r
+ 3 files changed, 34 insertions(+), 2 deletions(-)\r
+ create mode 100644 compat/check_asctime.c\r
+\r
+diff --git a/compat/check_asctime.c b/compat/check_asctime.c\r
+new file mode 100644\r
+index 0000000..b0e56f0\r
+--- /dev/null\r
++++ b/compat/check_asctime.c\r
+@@ -0,0 +1,11 @@\r
++#include <time.h>\r
++#include <stdio.h>\r
++\r
++int main()\r
++{\r
++ struct tm tm;\r
++\r
++ (void) asctime_r (&tm, NULL);\r
++\r
++ return (0);\r
++}\r
+diff --git a/compat/compat.h b/compat/compat.h\r
+index c1ee0f9..0c4ac66 100644\r
+--- a/compat/compat.h\r
++++ b/compat/compat.h\r
+@@ -33,6 +33,9 @@ extern "C" {\r
+ #if !STD_GETPWUID\r
+ #define _POSIX_PTHREAD_SEMANTICS 1\r
+ #endif\r
++#if !STD_ASCTIME\r
++#define _POSIX_PTHREAD_SEMANTICS 1\r
++#endif\r
+ \r
+ #if !HAVE_GETLINE\r
+ #include <stdio.h>\r
+diff --git a/configure b/configure\r
+index b5465e4..e3aa857 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -530,6 +530,17 @@ else\r
+ fi\r
+ rm -f compat/check_getpwuid\r
+ \r
++printf "Checking for standard version of asctime_r... "\r
++if ${CC} -o compat/check_asctime "$srcdir"/compat/check_asctime.c > /dev/null 2>&1\r
++then\r
++ printf "Yes.\n"\r
++ std_asctime=1\r
++else\r
++ printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"\r
++ std_asctime=0\r
++fi\r
++rm -f compat/check_asctime\r
++\r
+ printf "int main(void){return 0;}\n" > minimal.c\r
+ \r
+ printf "Checking for rpath support... "\r
+@@ -697,6 +708,11 @@ HAVE_STRCASESTR = ${have_strcasestr}\r
+ # to enable the standards-compliant version -- needed for Solaris)\r
+ STD_GETPWUID = ${std_getpwuid}\r
+ \r
++# Whether the asctime_r function is standards-compliant\r
++# (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS\r
++# to enable the standards-compliant version -- needed for Solaris)\r
++STD_ASCTIME = ${std_asctime}\r
++\r
+ # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD, OPENBSD\r
+ PLATFORM = ${platform}\r
+ \r
+@@ -743,11 +759,13 @@ CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\\r
+ \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\\r
+ \$(VALGRIND_CFLAGS) \\\r
+ -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\\r
+- -DSTD_GETPWUID=\$(STD_GETPWUID)\r
++ -DSTD_GETPWUID=\$(STD_GETPWUID) \\\r
++ -DSTD_ASCTIME=\$(STD_ASCTIME)\r
+ CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\\r
+ \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\\r
+ \$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS) \\\r
+ -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\\r
+- -DSTD_GETPWUID=\$(STD_GETPWUID)\r
++ -DSTD_GETPWUID=\$(STD_GETPWUID) \\\r
++ -DSTD_ASCTIME=\$(STD_ASCTIME)\r
+ CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(XAPIAN_LDFLAGS)\r
+ EOF\r
+-- \r
+1.7.9.2\r
+\r