]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
autoconf: Use -D_STDC_C99=, not -xc99=all, with Solaris cc
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Dec 2010 07:31:43 +0000 (23:31 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Dec 2010 08:20:30 +0000 (00:20 -0800)
* 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.

ChangeLog
lib/autoconf/c.m4

index c1ec95d8ccd903c6b764406b28ea514485283d38..8c9b89fc7cf2df26f938de40bf937fb329749247 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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.
+
 2010-11-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        autotest: fix file descriptor leak
index a873ccd2040195ad267a331c7684cc8bb6b646cd..5479056e89dd564a99ed2c9293597a456fd85c28 100644 (file)
@@ -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