From e997a767aae255992b0f1d229d15eb4f2b00484c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 6 Sep 2006 08:30:56 +0000 Subject: r18145: rename cc_feature.m4 into libreplace_macros.m4 metze (This used to be commit d0f40dd3e5ca8b46ee9b2c4332b393f519383aae) --- source4/lib/replace/cc_features.m4 | 53 -------------------------------- source4/lib/replace/libreplace.m4 | 2 +- source4/lib/replace/libreplace_macros.m4 | 53 ++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 source4/lib/replace/cc_features.m4 create mode 100644 source4/lib/replace/libreplace_macros.m4 (limited to 'source4') diff --git a/source4/lib/replace/cc_features.m4 b/source4/lib/replace/cc_features.m4 deleted file mode 100644 index 255009dd55..0000000000 --- a/source4/lib/replace/cc_features.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl C99 compiler check -dnl ------------------------------------------------------- -dnl Copyright (C) Stefan (metze) Metzmacher 2004,2005 -dnl Released under the GNU GPL -dnl ------------------------------------------------------- -dnl -dnl adapted for libreplace by Andrew Tridgell - -############################################ -# Check if the compiler handles c99 struct initialization, and if not try -AC99 and -c99 flags -# Usage: LIBREPLACE_C99_STRUCT_INIT(success-action,failure-action) -# changes CFLAGS to add -AC99 or -c99 if needed - -AC_DEFUN([LIBREPLACE_C99_STRUCT_INIT], -[ -saved_CFLAGS="$CFLAGS"; -c99_init=no -if test x"$c99_init" = x"no"; then - AC_MSG_CHECKING(for C99 designated initializers) - CFLAGS="$saved_CFLAGS"; - 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 -AC99) - CFLAGS="$saved_CFLAGS -AC99"; - 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" - 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"yes"; then - saved_CFLAGS="" - $1 -else - CFLAGS="$saved_CFLAGS" - saved_CFLAGS="" - $2 -fi -]) diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4 index 1465756261..0c1d089217 100644 --- a/source4/lib/replace/libreplace.m4 +++ b/source4/lib/replace/libreplace.m4 @@ -167,7 +167,7 @@ AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],, [AC_MSG_ERROR([Required function not found])]) m4_include(getpass.m4) -m4_include(cc_features.m4) +m4_include(libreplace_macros.m4) m4_include(system/config.m4) LIBREPLACE_C99_STRUCT_INIT(c99_struct_initialization=yes, diff --git a/source4/lib/replace/libreplace_macros.m4 b/source4/lib/replace/libreplace_macros.m4 new file mode 100644 index 0000000000..255009dd55 --- /dev/null +++ b/source4/lib/replace/libreplace_macros.m4 @@ -0,0 +1,53 @@ +dnl C99 compiler check +dnl ------------------------------------------------------- +dnl Copyright (C) Stefan (metze) Metzmacher 2004,2005 +dnl Released under the GNU GPL +dnl ------------------------------------------------------- +dnl +dnl adapted for libreplace by Andrew Tridgell + +############################################ +# Check if the compiler handles c99 struct initialization, and if not try -AC99 and -c99 flags +# Usage: LIBREPLACE_C99_STRUCT_INIT(success-action,failure-action) +# changes CFLAGS to add -AC99 or -c99 if needed + +AC_DEFUN([LIBREPLACE_C99_STRUCT_INIT], +[ +saved_CFLAGS="$CFLAGS"; +c99_init=no +if test x"$c99_init" = x"no"; then + AC_MSG_CHECKING(for C99 designated initializers) + CFLAGS="$saved_CFLAGS"; + 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 -AC99) + CFLAGS="$saved_CFLAGS -AC99"; + 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" + 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"yes"; then + saved_CFLAGS="" + $1 +else + CFLAGS="$saved_CFLAGS" + saved_CFLAGS="" + $2 +fi +]) -- cgit