summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 519a372)
raw | patch | inline | side by side (parent: 519a372)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 15 Oct 2009 21:56:41 +0000 (23:56 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 15 Oct 2009 21:56:41 +0000 (23:56 +0200) |
This option may be used to enable C99 and POSIX.1 2001 standards compliance
mode.
mode.
configure.ac | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index abd0c5ed3efe981c6b152bef8c66ec352ecc81a6..e0fd5dbcab30485e671c6c022012d05ac7e884fc 100644 (file)
--- a/configure.ac
+++ b/configure.ac
return $ret
}
+dnl Optionally stick to standard C99 and POSIX.1 2001 as close as possible.
+AC_ARG_ENABLE([standards],
+ AS_HELP_STRING([--enable-standards],
+ [Enable standards compliance mode]),
+ [enable_standards="$enableval"],
+ [enable_standards="no"])
+
+if test "x$enable_standards" = "xyes"; then
+ AC_DEFINE([_ISOC99_SOURCE], 1,
+ [Define to enforce ISO/IEC 9899:1999 (C99) compliance.])
+ AC_DEFINE([_POSIX_C_SOURCE], 200112L,
+ [Define to enforce IEEE 1003.1-2001 (POSIX:2001) compliance.])
+ AC_DEFINE([_XOPEN_SOURCE], 600,
+ [Define to enforce X/Open 6 (XSI) compliance.])
+ AC_DEFINE([_REENTRANT], 1,
+ [Define to enable reentrant interfaces.])
+ AC_DEFINE([_THREAD_SAFE], 1,
+ [Define to enable reentrant interfaces.])
+
+ for flag in -std=c99 -pedantic; do
+ AC_MSG_CHECKING([whether $CC accepts $flag])
+
+ if test_cc_flags $flag; then
+ CFLAGS="$CFLAGS $flag"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ done
+fi
+
for flag in -Wall -Wextra -Werror; do
AC_MSG_CHECKING([whether $CC accepts $flag])