From 46861bc41eec317df8490087feebaa47348d5a6f Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Tue, 15 Mar 2016 07:55:41 -0500 Subject: [PATCH] [libpng16] Reformatted the new code in configure.ac --- ANNOUNCE | 5 +++-- CHANGES | 3 ++- configure.ac | 21 +++++++++++++-------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index b7be0cd94..d51e19b36 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ -Libpng 1.6.22beta04 - March 9, 2016 +Libpng 1.6.22beta04 - March 15, 2016 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -77,7 +77,8 @@ Version 1.6.22beta03 [March 9, 2016] meaningful fashion (John Bowler). Fixed some misleading indentation (Krishnaraj Bhat). -Version 1.6.22beta04 [March 9, 2016] +Version 1.6.22beta04 [March 15, 2016] + Force GCC compilation to C89 if needed (Dagobert Michelsen). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 51abe1695..3a40300c6 100644 --- a/CHANGES +++ b/CHANGES @@ -5537,7 +5537,8 @@ Version 1.6.22beta03 [March 9, 2016] meaningful fashion (John Bowler). Fixed some misleading indentation (Krishnaraj Bhat). -Version 1.6.22beta04 [March 9, 2016] +Version 1.6.22beta04 [March 15, 2016] + Force GCC compilation to C89 if needed (Dagobert Michelsen). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/configure.ac b/configure.ac index ee3ea0593..2dad641c2 100644 --- a/configure.ac +++ b/configure.ac @@ -117,15 +117,20 @@ AC_ARG_ENABLE(werror, # For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89 # In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining _POSIX_SOURCE to 1 # This is incompatible with the new default mode, so we test for that and force the +# "-std=c89" compiler option: AC_MSG_CHECKING([if we need to force back C standard to C89]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#define _POSIX_SOURCE 1 -#include -])],AC_MSG_RESULT(no),[ -if test "x$GCC" != "xyes"; then - AC_MSG_ERROR([Forcing back to C89 is required but the flags are unknown for other compilers than GCC]) -fi -AC_MSG_RESULT(yes) -CFLAGS="$CFLAGS -std=c89" +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + [#define _POSIX_SOURCE 1] + [#include ] + ])], + AC_MSG_RESULT(no),[ + if test "x$GCC" != "xyes"; then + AC_MSG_ERROR( + [Forcing back to C89 is required but the flags are only known for GCC]) + fi + AC_MSG_RESULT(yes) + CFLAGS="$CFLAGS -std=c89" ]) # Checks for header files. -- GitLab