pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@postgresql.org
Subject: pgsql: Use AS_IF rather than plain shell "if" in pthread-check.
Date: Thu, 09 Jul 2015 08:42:23 +0000
Message-ID: <E1ZD7PT-0007TJ-7s@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Use AS_IF rather than plain shell "if" in pthread-check.

Autoconf generates additional code for the first AC_CHECK_HEADERS call in
the script. If the first call is within an if-block, the additional code is
put inside the if-block too, even though it is needed by subsequent
AC_CHECK_HEADERS checks and should always be executed. When I moved the
pthread-related checks earlier in the script, the pthread.h test inside
the block became the very first AC_CHECK_HEADERS call in the script,
triggering that problem.

To fix, use AS_IF instead of plain shell if. AS_IF knows about that issue,
and makes sure the additional code is always executed. To be completely
safe from this issue (and others), we should always be using AS_IF instead
of plain if, but that seems like excessive caution given that this is the
first time we have trouble like this. Plain if-then is more readable than
AS_IF.

This should fix compilation with --disable-thread-safety, and hopefully the
buildfarm failure on forgmouth, related to mingw standard headers, too.
I backpatched the previous fixes to 9.5, but it's starting to look like
these changes are too fiddly to backpatch, so commit this to master only,
and revert all the pthread-related configure changes in 9.5.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/01051a9879fcd353eaf0d3788a911e774b52798c

Modified Files
--------------
configure    |  273 ++++++++++++++++++++++++++++++----------------------------
configure.in |   14 +--
2 files changed, 149 insertions(+), 138 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1ZD7PT-0007TJ-7s@gemulon.postgresql.org>
Permalink:  ../E1ZD7PT-0007TJ-7s@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ZD7PT-0007TJ-7s@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Use AS_IF rather than plain shell "if" in pthread-check.
  In-Reply-To: <E1ZD7PT-0007TJ-7s@gemulon.postgresql.org>
  References: <E1ZD7PT-0007TJ-7s@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox