summaryrefslogtreecommitdiff
path: root/source4/build/m4/check_cc.m4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-07-31 22:31:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:30:13 -0500
commit99ad4c681c7f00774716a4e2ea7cdda062ae1607 (patch)
tree0560095bc41ad76c03a25bb1b8d7af7806cc5316 /source4/build/m4/check_cc.m4
parentc846ec3398139c99f4bb554c20a53a0117a3aeb5 (diff)
downloadsamba-99ad4c681c7f00774716a4e2ea7cdda062ae1607.tar.gz
samba-99ad4c681c7f00774716a4e2ea7cdda062ae1607.tar.bz2
samba-99ad4c681c7f00774716a4e2ea7cdda062ae1607.zip
r8868: add comfigure check for c99 struct initialization,
which is required for samba4 metze (This used to be commit 3d4fdb70935b4bde1c34a293e5d5a3000151c116)
Diffstat (limited to 'source4/build/m4/check_cc.m4')
-rw-r--r--source4/build/m4/check_cc.m421
1 files changed, 21 insertions, 0 deletions
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
@@ -70,6 +70,27 @@ if test x"$samba_cv_immediate_structures" = x"yes"; then
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 <stdio.h>],
+[
+ 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, [
AC_TRY_COMPILE([