diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2010-12-27 23:31:43 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2010-12-28 00:20:30 -0800 |
commit | 18779ad8f941738075be2c70d6c16acd932fd73b (patch) | |
tree | b322b4fc02324163c0472176af3d832ad6190dbd /lib | |
parent | 45b928b7a1b57f493363ca7d9a331473b225f15a (diff) | |
download | autoconf-18779ad8f941738075be2c70d6c16acd932fd73b.tar.gz |
autoconf: Use -D_STDC_C99=, not -xc99=all, with Solaris cc
* lib/autoconf/c.m4 (_AC_PROG_CC_C99): Use -D_STDC_C99= rather than
-xc99=all to convince Solaris Studio cc to compile c99 programs.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/autoconf/c.m4 | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index a873ccd2..5479056e 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -1340,11 +1340,20 @@ dnl AIX -qlanglvl=extc99 (unused restrictive mode: -qlanglvl=stdc99) dnl HP cc -AC99 dnl Intel ICC -std=c99, -c99 (deprecated) dnl IRIX -c99 -dnl Solaris -xc99=all (Forte Developer 7 C mishandles -xc99 on Solaris 9, -dnl as it incorrectly assumes C99 semantics for library functions) +dnl Solaris -D_STDC_C99= +dnl cc's -xc99 option uses linker magic to define the external +dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99 +dnl behavior for C library functions. This is not wanted here, +dnl because it means that a single module compiled with -xc99 +dnl alters C runtime behavior for the entire program, not for +dnl just the module. Instead, define the (private) symbol +dnl _STDC_C99, which suppresses a bogus failure in <stdbool.h>. +dnl The resulting compiler passes the test case here, and that's +dnl good enough. For more, please see the thread starting at: +dnl http://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html dnl Tru64 -c99 dnl with extended modes being tried first. -[[-std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99]], [$1], [$2])[]dnl +[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99]], [$1], [$2])[]dnl ])# _AC_PROG_CC_C99 |