From 05f98cdbfc64b549f4530a5e6aba0dcf3f536a87 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 9 Sep 2006 03:45:04 +0000 Subject: r18287: add support for the -qlanglvl=extc99 and -qlanglvl=stdc99 flags, needed on AIX 5.2 for C99 structures (This used to be commit 2dc9239a3621f48fbb410a60fee61d70f85ada91) --- source4/lib/replace/libreplace_macros.m4 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source4') diff --git a/source4/lib/replace/libreplace_macros.m4 b/source4/lib/replace/libreplace_macros.m4 index a50104cd1c..03ef97d157 100644 --- a/source4/lib/replace/libreplace_macros.m4 +++ b/source4/lib/replace/libreplace_macros.m4 @@ -28,6 +28,24 @@ if test x"$c99_init" = x"no"; then ], [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)]) fi +if test x"$c99_init" = x"no"; then + AC_MSG_CHECKING(for C99 designated initializers with -qlanglvl=extc99) + CFLAGS="$saved_CFLAGS -qlanglvl=extc99"; + AC_TRY_COMPILE([#include ], + [ struct foo {int x;char y;}; + struct foo bar = { .y = 'X', .x = 1 }; + ], + [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)]) +fi +if test x"$c99_init" = x"no"; then + AC_MSG_CHECKING(for C99 designated initializers with -qlanglvl=stdc99) + CFLAGS="$saved_CFLAGS -qlanglvl=stdc99"; + AC_TRY_COMPILE([#include ], + [ struct foo {int x;char y;}; + struct foo bar = { .y = 'X', .x = 1 }; + ], + [AC_MSG_RESULT(yes); c99_init=yes],[AC_MSG_RESULT(no)]) +fi if test x"$c99_init" = x"no"; then AC_MSG_CHECKING(for C99 designated initializers with -c99) CFLAGS="$saved_CFLAGS -c99" -- cgit