From 99ad4c681c7f00774716a4e2ea7cdda062ae1607 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 31 Jul 2005 22:31:53 +0000 Subject: r8868: add comfigure check for c99 struct initialization, which is required for samba4 metze (This used to be commit 3d4fdb70935b4bde1c34a293e5d5a3000151c116) --- source4/build/m4/check_cc.m4 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4 index 8e075b714b..6ab9c17eb3 100644 --- a/source4/build/m4/check_cc.m4 +++ b/source4/build/m4/check_cc.m4 @@ -69,6 +69,27 @@ if test x"$samba_cv_immediate_structures" = x"yes"; then AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures]) fi +############################################ +# check if the compiler handles c99 struct initialization +AC_CACHE_CHECK([for c99 struct initialization],samba_cv_c99_struct_initialization, [ + AC_TRY_COMPILE([ +#include ], +[ + struct foo { + int x; + char y; + } ; + struct foo bar = { + .y = 'X', + .x = 1 + }; +], + samba_cv_c99_struct_initialization=yes,samba_cv_c99_struct_initialization=no)]) +if test x"$samba_cv_c99_struct_initialization" != x"yes"; then + AC_MSG_WARN([C compiler does not support c99 struct initialization!]) + AC_MSG_ERROR([Please Install gcc from http://gcc.gnu.org/]) +fi + ############################################ # check if the compiler can handle negative enum values AC_CACHE_CHECK([that the C compiler understands negative enum values],SMB_BUILD_CC_NEGATIVE_ENUM_VALUES, [ -- cgit