summaryrefslogtreecommitdiff
path: root/source4/build/m4/check_cc.m4
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2005-09-08 08:18:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:36:34 -0500
commite6190e6be55c8e6037b0cb2b357e133f5b313a02 (patch)
treead648e7bfbeb5c9ef5a2b0658190a3d8d4e839bf /source4/build/m4/check_cc.m4
parent1f2f470889d63a2a81ee3f2d8bdff782ac8d0e28 (diff)
downloadsamba-e6190e6be55c8e6037b0cb2b357e133f5b313a02.tar.gz
samba-e6190e6be55c8e6037b0cb2b357e133f5b313a02.tar.bz2
samba-e6190e6be55c8e6037b0cb2b357e133f5b313a02.zip
r10071: Configure checks for IRIX build environment. Test whether we can
use the MIPSPro 7.4 -c99 option to get C99 support. Try to find a common perl that is more modern than /usr/bin/perl. (This used to be commit 82fab8b747bf68d8548c6f0f2f4bff98bd428d22)
Diffstat (limited to 'source4/build/m4/check_cc.m4')
-rw-r--r--source4/build/m4/check_cc.m440
1 files changed, 27 insertions, 13 deletions
diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4
index eaf40f1b53..ab934f328b 100644
--- a/source4/build/m4/check_cc.m4
+++ b/source4/build/m4/check_cc.m4
@@ -71,20 +71,34 @@ 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>],
+AC_DEFUN([SMB_CC_SUPPORTS_C99_STRUCT_INIT],
[
- 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)])
+AC_MSG_CHECKING(for c99 struct initialization)
+AC_TRY_COMPILE([
+ #include <stdio.h>],
+ [
+ struct foo {
+ int x;
+ char y;
+ } ;
+ struct foo bar = {
+ .y = 'X',
+ .x = 1
+ };
+ ],
+[AC_MSG_RESULT(yes); $1],[AC_MSG_RESULT(no); $2])
+])
+
+SMB_CC_SUPPORTS_C99_STRUCT_INIT(samba_cv_c99_struct_initialization=yes,
+ samba_cv_c99_struct_initialization=no)
+
+if test x"$samba_cv_c99_struct_initialization" != x"yes"; then
+ # We might need to add some flags to CC to get c99 behaviour.
+ AX_CFLAGS_IRIX_OPTION(-c99, CFLAGS)
+ SMB_CC_SUPPORTS_C99_STRUCT_INIT(samba_cv_c99_struct_initialization=yes,
+ samba_cv_c99_struct_initialization=no)
+fi
+
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/])