mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Reformatted the new code in configure.ac
This commit is contained in:
21
configure.ac
21
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 <stdio.h>
|
||||
])],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 <stdio.h>]
|
||||
])],
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user