X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fstdarg.m4;h=5705de9ecaa9624d31dde5993659c2bffc5d3a2f;hb=336406c13cc08ee13d6a15cc8cf86efb9132a830;hp=5c87bd8b5f6da4b6b64bb94f68fc61f8c2956e9d;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/m4/stdarg.m4 b/m4/stdarg.m4 index 5c87bd8b5..5705de9ec 100644 --- a/m4/stdarg.m4 +++ b/m4/stdarg.m4 @@ -1,5 +1,5 @@ -# stdarg.m4 serial 3 -dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc. +# stdarg.m4 serial 6 +dnl Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,16 +9,20 @@ dnl Provide a working va_copy in combination with . AC_DEFUN([gl_STDARG_H], [ - STDARG_H=''; AC_SUBST([STDARG_H]) - NEXT_STDARG_H=''; AC_SUBST([NEXT_STDARG_H]) + STDARG_H='' + NEXT_STDARG_H='' AC_MSG_CHECKING([for va_copy]) AC_CACHE_VAL([gl_cv_func_va_copy], [ - AC_TRY_COMPILE([#include ], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ #ifndef va_copy void (*func) (va_list, va_list) = va_copy; #endif -], - [gl_cv_func_va_copy=yes], [gl_cv_func_va_copy=no])]) + ]])], + [gl_cv_func_va_copy=yes], + [gl_cv_func_va_copy=no])]) AC_MSG_RESULT([$gl_cv_func_va_copy]) if test $gl_cv_func_va_copy = no; then dnl Provide a substitute. @@ -37,7 +41,7 @@ void (*func) (va_list, va_list) = va_copy; if test $gl_aixcc = yes; then dnl Provide a substitute file. STDARG_H=stdarg.h - gl_CHECK_NEXT_HEADERS([stdarg.h]) + gl_NEXT_HEADERS([stdarg.h]) dnl Fallback for the case when contains only macro definitions. if test "$gl_cv_next_stdarg_h" = '""'; then gl_cv_next_stdarg_h='"///usr/include/stdarg.h"' @@ -47,12 +51,16 @@ void (*func) (va_list, va_list) = va_copy; dnl Provide a substitute in , either __va_copy or as a simple dnl assignment. gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [ - AC_TRY_COMPILE([#include ], [ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ #ifndef __va_copy error, bail out #endif -], - [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])]) + ]])], + [gl_cv_func___va_copy=yes], + [gl_cv_func___va_copy=no])]) if test $gl_cv_func___va_copy = yes; then AC_DEFINE([va_copy], [__va_copy], [Define as a macro for copying va_list variables.]) @@ -64,4 +72,7 @@ error, bail out fi fi fi + AC_SUBST([STDARG_H]) + AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"]) + AC_SUBST([NEXT_STDARG_H]) ])