From 2c4321f6d6ab71a7bf97177ab685d67a24934fb5 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 19 Jul 2010 02:28:28 +0200 Subject: [PATCH] Modernize AC_TRY_COMPILE invocations. --- ChangeLog | 28 ++++++++++++++ m4/environ.m4 | 14 ++++--- m4/iconv.m4 | 11 ++++-- m4/intl.m4 | 15 +++++--- m4/intmax.m4 | 11 ++++-- m4/intmax_t.m4 | 13 +++++-- m4/inttypes-pri.m4 | 14 +++++-- m4/inttypes_h.m4 | 17 +++++---- m4/libunistring.m4 | 14 ++++--- m4/locale_h.m4 | 16 +++++--- m4/lock.m4 | 12 ++++-- m4/malloc.m4 | 16 +++++--- m4/mbswidth.m4 | 15 +++++--- m4/minmax.m4 | 13 ++++--- m4/setenv.m4 | 12 ++++-- m4/size_max.m4 | 14 ++++--- m4/ssize_t.m4 | 12 +++--- m4/stdarg.m4 | 22 +++++++---- m4/stdbool.m4 | 107 +++++++++++++++++++++++++++-------------------------- m4/stdint_h.m4 | 15 ++++---- m4/visibility.m4 | 23 +++++++----- m4/wchar_t.m4 | 12 ++++-- m4/wint_t.m4 | 12 ++++-- 23 files changed, 277 insertions(+), 161 deletions(-) diff --git a/ChangeLog b/ChangeLog index c65c0a395..2e97ef50e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2010-08-26 Bruno Haible + + Modernize AC_TRY_COMPILE invocations. + * m4/environ.m4 (gt_CHECK_VAR_DECL): Use AC_COMPILE_IFELSE instead of + AC_TRY_COMPILE. + * m4/iconv.m4 (gl_iconv_AC_DEFUN): Likewise. + * m4/intl.m4 (gt_CHECK_DECL): Likewise. + * m4/intmax.m4 (gt_TYPE_INTMAX_T): Likewise. + * m4/intmax_t.m4 (gt_AC_TYPE_INTMAX_T): Likewise. + * m4/inttypes-pri.m4 (gt_INTTYPES_PRI): Likewise. + * m4/inttypes_h.m4 (gl_AC_HEADER_INTTYPES_H): Likewise. + * m4/locale_h.m4 (gl_LOCALE_H): Likewise. + * m4/lock.m4 (gl_LOCK): Likewise. + * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Likewise. + * m4/mbswidth.m4 (gl_MBSWIDTH): Likewise. + * m4/minmax.m4 (gl_MINMAX_IN_HEADER): Likewise. + * m4/setenv.m4 (gl_FUNC_UNSETENV): Likewise. + * m4/size_max.m4 (gl_SIZE_MAX): Likewise. + * m4/ssize_t.m4 (gt_TYPE_SSIZE_T): Likewise. + * m4/stdarg.m4 (gl_STDARG_H): Likewise. + * m4/stdbool.m4 (AC_HEADER_STDBOOL): Likewise. + * m4/stdint_h.m4 (gl_AC_HEADER_STDINT_H): Likewise. + * m4/visibility.m4 (gl_VISIBILITY): Likewise. + * m4/wchar_t.m4 (gt_TYPE_WCHAR_T): Likewise. + * m4/wint_t.m4 (gt_TYPE_WINT_T): Likewise. + * m4/libunistring.m4 (gl_LIBUNISTRING_CORE): Likewise. Remove + extraneous semicolon. + 2010-08-26 Jim Meyering stat-time: relax license LGPL diff --git a/m4/environ.m4 b/m4/environ.m4 index 4c6849a3a..b9dc2ef27 100644 --- a/m4/environ.m4 +++ b/m4/environ.m4 @@ -1,4 +1,4 @@ -# environ.m4 serial 4 +# environ.m4 serial 5 dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -22,11 +22,13 @@ AC_DEFUN([gt_CHECK_VAR_DECL], define([gt_cv_var], [gt_cv_var_]$2[_declaration]) AC_MSG_CHECKING([if $2 is properly declared]) AC_CACHE_VAL([gt_cv_var], [ - AC_TRY_COMPILE([$1 - extern struct { int foo; } $2;], - [$2.foo = 1;], - gt_cv_var=no, - gt_cv_var=yes)]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[$1 + extern struct { int foo; } $2;]], + [[$2.foo = 1;]])], + [gt_cv_var=no], + [gt_cv_var=yes])]) AC_MSG_RESULT([$gt_cv_var]) if test $gt_cv_var = yes; then AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1, diff --git a/m4/iconv.m4 b/m4/iconv.m4 index 2a89c606e..081b370ea 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,4 +1,4 @@ -# iconv.m4 serial 11b +# iconv.m4 serial 11c dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -214,7 +214,9 @@ gl_iconv_AC_DEFUN([AM_ICONV], if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include extern @@ -226,7 +228,10 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si #else size_t iconv(); #endif -], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) + ]], + [[]])], + [am_cv_proto_iconv_arg1=""], + [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ diff --git a/m4/intl.m4 b/m4/intl.m4 index 335b23c20..c918e5717 100644 --- a/m4/intl.m4 +++ b/m4/intl.m4 @@ -1,5 +1,5 @@ -# intl.m4 serial 17 (gettext-0.18) -dnl Copyright (C) 1995-2009 Free Software Foundation, Inc. +# intl.m4 serial 17a +dnl Copyright (C) 1995-2010 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. @@ -17,7 +17,7 @@ dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2009. -AC_PREREQ([2.52]) +AC_PREREQ([2.53]) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, @@ -279,11 +279,16 @@ dnl Check whether a function is declared. AC_DEFUN([gt_CHECK_DECL], [ AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1], - [AC_TRY_COMPILE([$2], [ + [AC_COMPILE_IFELSE( + [AC_LANG_PRORAM( + [[$2]], + [[ #ifndef $1 char *p = (char *) $1; #endif -], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) + ]])], + [ac_cv_have_decl_$1=yes], + [ac_cv_have_decl_$1=no])]) if test $ac_cv_have_decl_$1 = yes; then gt_value=1 else diff --git a/m4/intmax.m4 b/m4/intmax.m4 index 74aaaf5ed..2c0f2afe5 100644 --- a/m4/intmax.m4 +++ b/m4/intmax.m4 @@ -1,4 +1,4 @@ -# intmax.m4 serial 5 (gettext-0.18) +# intmax.m4 serial 6 (gettext-0.18.2) dnl Copyright (C) 2002-2005, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -13,7 +13,9 @@ AC_DEFUN([gt_TYPE_INTMAX_T], AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include #if HAVE_STDINT_H_WITH_UINTMAX @@ -22,8 +24,9 @@ AC_DEFUN([gt_TYPE_INTMAX_T], #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif -], [intmax_t x = -1; - return !x;], + ]], + [[intmax_t x = -1; + return !x;]])], [gt_cv_c_intmax_t=yes], [gt_cv_c_intmax_t=no])]) if test $gt_cv_c_intmax_t = yes; then diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4 index 975caac50..493e4a932 100644 --- a/m4/intmax_t.m4 +++ b/m4/intmax_t.m4 @@ -1,4 +1,4 @@ -# intmax_t.m4 serial 7 +# intmax_t.m4 serial 8 dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. -AC_PREREQ([2.13]) +AC_PREREQ([2.53]) # Define intmax_t to 'long' or 'long long' # if it is not already defined in or . @@ -38,7 +38,9 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include #if HAVE_STDINT_H_WITH_UINTMAX @@ -47,7 +49,10 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif -], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) + ]], + [[intmax_t x = -1; return !x;]])], + [gt_cv_c_intmax_t=yes], + [gt_cv_c_intmax_t=no])]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 index 718a4f4e1..ee96bcd97 100644 --- a/m4/inttypes-pri.m4 +++ b/m4/inttypes-pri.m4 @@ -1,4 +1,4 @@ -# inttypes-pri.m4 serial 6 (gettext-0.18) +# inttypes-pri.m4 serial 7 (gettext-0.18.2) dnl Copyright (C) 1997-2002, 2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -6,7 +6,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -AC_PREREQ([2.52]) +AC_PREREQ([2.53]) # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. @@ -18,11 +18,17 @@ AC_DEFUN([gt_INTTYPES_PRI], AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], [gt_cv_inttypes_pri_broken], [ - AC_TRY_COMPILE([#include + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include #ifdef PRId32 char *p = PRId32; #endif -], [], [gt_cv_inttypes_pri_broken=no], [gt_cv_inttypes_pri_broken=yes]) + ]], + [[]])], + [gt_cv_inttypes_pri_broken=no], + [gt_cv_inttypes_pri_broken=yes]) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 index 782d77ed8..9d8f92692 100644 --- a/m4/inttypes_h.m4 +++ b/m4/inttypes_h.m4 @@ -1,4 +1,4 @@ -# inttypes_h.m4 serial 9 +# inttypes_h.m4 serial 10 dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -12,12 +12,15 @@ dnl From Paul Eggert. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], - [AC_TRY_COMPILE( - [#include -#include ], - [uintmax_t i = (uintmax_t) -1; return !i;], - [gl_cv_header_inttypes_h=yes], - [gl_cv_header_inttypes_h=no])]) + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_inttypes_h=yes], + [gl_cv_header_inttypes_h=no])]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , diff --git a/m4/libunistring.m4 b/m4/libunistring.m4 index 7e920e5d9..55f533404 100644 --- a/m4/libunistring.m4 +++ b/m4/libunistring.m4 @@ -1,4 +1,4 @@ -# libunistring.m4 serial 9 +# libunistring.m4 serial 10 dnl Copyright (C) 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -103,9 +103,10 @@ AC_DEFUN([gl_LIBUNISTRING_CORE], dnl Use other tests to distinguish them. if test $gl_libunistring_hexversion = 9; then dnl Version 0.9.2 introduced the header . - AC_TRY_COMPILE([#include ], , + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], [[]])], [gl_cv_libunistring_version092=true], - [gl_cv_libunistring_version092=false]); + [gl_cv_libunistring_version092=false]) if $gl_cv_libunistring_version092; then dnl Version 0.9.3 changed a comment in . gl_ABSOLUTE_HEADER_ONE([unistr.h]) @@ -119,8 +120,11 @@ AC_DEFUN([gl_LIBUNISTRING_CORE], fi else dnl Version 0.9.1 introduced the type casing_suffix_context_t. - AC_TRY_COMPILE([#include - casing_suffix_context_t ct;], , + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + casing_suffix_context_t ct;]], + [[]])], [gl_cv_libunistring_version091=true], [gl_cv_libunistring_version091=false]) if $gl_cv_libunistring_version091; then diff --git a/m4/locale_h.m4 b/m4/locale_h.m4 index 18a119b8e..8f4f3d440 100644 --- a/m4/locale_h.m4 +++ b/m4/locale_h.m4 @@ -1,4 +1,4 @@ -# locale_h.m4 serial 10 +# locale_h.m4 serial 11 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,8 +18,11 @@ AC_DEFUN([gl_LOCALE_H], AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001], [gl_cv_header_locale_h_posix2001], - [AC_TRY_COMPILE([#include -int x = LC_MESSAGES;], [], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + int x = LC_MESSAGES;]], + [[]])], [gl_cv_header_locale_h_posix2001=yes], [gl_cv_header_locale_h_posix2001=no])]) @@ -32,8 +35,11 @@ int x = LC_MESSAGES;], [], dnl itself, we assume that will do so. AC_CACHE_CHECK([whether locale.h defines locale_t], [gl_cv_header_locale_has_locale_t], - [AC_TRY_COMPILE([#include -locale_t x;], [], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + locale_t x;]], + [[]])], [gl_cv_header_locale_has_locale_t=yes], [gl_cv_header_locale_has_locale_t=no]) ]) diff --git a/m4/lock.m4 b/m4/lock.m4 index 9da8465eb..f71c66459 100644 --- a/m4/lock.m4 +++ b/m4/lock.m4 @@ -1,4 +1,4 @@ -# lock.m4 serial 10 (gettext-0.18) +# lock.m4 serial 11 (gettext-0.18.2) dnl Copyright (C) 2005-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,13 +18,17 @@ AC_DEFUN([gl_LOCK], [], [#include ]) # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. - AC_TRY_COMPILE([#include ], - [#if __FreeBSD__ == 4 + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( + [[#include ]], + [[ +#if __FreeBSD__ == 4 error "No, in FreeBSD 4.0 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; -#endif], +#endif + ]])], [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], [Define if the defines PTHREAD_MUTEX_RECURSIVE.])]) fi diff --git a/m4/malloc.m4 b/m4/malloc.m4 index fe5befc24..56fd25e8b 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,4 +1,4 @@ -# malloc.m4 serial 10 +# malloc.m4 serial 11 dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -47,11 +47,15 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX], dnl It is too dangerous to try to allocate a large amount of memory: dnl some systems go to their knees when you do that. So assume that dnl all Unix implementations of the function are POSIX compliant. - AC_TRY_COMPILE([], - [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ - choke me - #endif - ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[]], + [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + ]])], + [gl_cv_func_malloc_posix=yes], + [gl_cv_func_malloc_posix=no]) ]) ]) diff --git a/m4/mbswidth.m4 b/m4/mbswidth.m4 index 25089f275..ec553a0f6 100644 --- a/m4/mbswidth.m4 +++ b/m4/mbswidth.m4 @@ -1,4 +1,4 @@ -# mbswidth.m4 serial 17 +# mbswidth.m4 serial 18 dnl Copyright (C) 2000-2002, 2004, 2006-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -15,8 +15,10 @@ AC_DEFUN([gl_MBSWIDTH], dnl UnixWare 7.1.1 has a declaration of a function mbswidth() dnl that clashes with ours. AC_CACHE_CHECK([whether mbswidth is declared in ], - ac_cv_have_decl_mbswidth, - [AC_TRY_COMPILE([ + [ac_cv_have_decl_mbswidth], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included @@ -25,10 +27,13 @@ AC_DEFUN([gl_MBSWIDTH], #include #include #include -], [ + ]], + [[ char *p = (char *) mbswidth; return !p; -], ac_cv_have_decl_mbswidth=yes, ac_cv_have_decl_mbswidth=no)]) + ]])], + [ac_cv_have_decl_mbswidth=yes], + [ac_cv_have_decl_mbswidth=no])]) if test $ac_cv_have_decl_mbswidth = yes; then ac_val=1 else diff --git a/m4/minmax.m4 b/m4/minmax.m4 index d9e9cecfd..a5c42dea0 100644 --- a/m4/minmax.m4 +++ b/m4/minmax.m4 @@ -1,10 +1,10 @@ -# minmax.m4 serial 3 -dnl Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc. +# minmax.m4 serial 4 +dnl Copyright (C) 2005, 2009-2010 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. -AC_PREREQ([2.52]) +AC_PREREQ([2.53]) AC_DEFUN([gl_MINMAX], [ @@ -28,8 +28,11 @@ AC_DEFUN([gl_MINMAX_IN_HEADER], m4_pushdef([HEADER], AS_TR_CPP([$1])) AC_CACHE_CHECK([whether <$1> defines MIN and MAX], [gl_cv_minmax_in_]header, - [AC_TRY_COMPILE([#include <$1> -int x = MIN (42, 17);], [], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <$1> + int x = MIN (42, 17);]], + [[]])], [gl_cv_minmax_in_]header[=yes], [gl_cv_minmax_in_]header[=no])]) if test $gl_cv_minmax_in_[]header = yes; then diff --git a/m4/setenv.m4 b/m4/setenv.m4 index 58f6d1382..5a800d337 100644 --- a/m4/setenv.m4 +++ b/m4/setenv.m4 @@ -1,4 +1,4 @@ -# setenv.m4 serial 16 +# setenv.m4 serial 17 dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -53,7 +53,10 @@ AC_DEFUN([gl_FUNC_UNSETENV], else dnl Some BSDs return void, failing to do error checking. AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret], - [AC_TRY_COMPILE([#include + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include extern #ifdef __cplusplus "C" @@ -63,7 +66,10 @@ int unsetenv (const char *name); #else int unsetenv(); #endif -], , gt_cv_func_unsetenv_ret='int', gt_cv_func_unsetenv_ret='void')]) + ]], + [[]])], + [gt_cv_func_unsetenv_ret='int'], + [gt_cv_func_unsetenv_ret='void'])]) if test $gt_cv_func_unsetenv_ret = 'void'; then AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void instead of int.]) diff --git a/m4/size_max.m4 b/m4/size_max.m4 index ce992db1f..f3b1a9dfb 100644 --- a/m4/size_max.m4 +++ b/m4/size_max.m4 @@ -1,4 +1,4 @@ -# size_max.m4 serial 9 +# size_max.m4 serial 10 dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -34,10 +34,14 @@ Found it if test $fits_in_uint = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. - AC_TRY_COMPILE([#include - extern size_t foo; - extern unsigned long foo; - ], [], [fits_in_uint=0]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + extern size_t foo; + extern unsigned long foo; + ]], + [[]])], + [fits_in_uint=0]) fi dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl works only with 'long' integers in the host environment, while we diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4 index e0ccee3a5..e4c160b50 100644 --- a/m4/ssize_t.m4 +++ b/m4/ssize_t.m4 @@ -1,5 +1,5 @@ -# ssize_t.m4 serial 4 (gettext-0.15) -dnl Copyright (C) 2001-2003, 2006, 2009-2010 Free Software Foundation, Inc. +# ssize_t.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2001-2003, 2006, 2010 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. @@ -10,9 +10,11 @@ dnl Test whether ssize_t is defined. AC_DEFUN([gt_TYPE_SSIZE_T], [ AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], - [AC_TRY_COMPILE([#include ], - [int x = sizeof (ssize_t *) + sizeof (ssize_t); - return !x;], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[int x = sizeof (ssize_t *) + sizeof (ssize_t); + return !x;]])], [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])]) if test $gt_cv_ssize_t = no; then AC_DEFINE([ssize_t], [int], diff --git a/m4/stdarg.m4 b/m4/stdarg.m4 index 5c87bd8b5..8a62f2e84 100644 --- a/m4/stdarg.m4 +++ b/m4/stdarg.m4 @@ -1,4 +1,4 @@ -# stdarg.m4 serial 3 +# stdarg.m4 serial 4 dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -13,12 +13,16 @@ AC_DEFUN([gl_STDARG_H], NEXT_STDARG_H=''; AC_SUBST([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. @@ -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.]) diff --git a/m4/stdbool.m4 b/m4/stdbool.m4 index 493674664..1efe59ea1 100644 --- a/m4/stdbool.m4 +++ b/m4/stdbool.m4 @@ -5,7 +5,7 @@ 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. -#serial 2 +#serial 3 # Prepare for substituting if it is not supported. @@ -40,60 +40,61 @@ AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) AC_DEFUN([AC_HEADER_STDBOOL], [AC_CACHE_CHECK([for stdbool.h that conforms to C99], [ac_cv_header_stdbool_h], - [AC_TRY_COMPILE( - [ - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif - struct s { _Bool s: 1; _Bool t; } s; + struct s { _Bool s: 1; _Bool t; } s; - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; - ], - [ - bool e = &s; - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); - ], + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + ]], + [[ + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + ]])], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 index b8e3c6cc7..670c0cc2b 100644 --- a/m4/stdint_h.m4 +++ b/m4/stdint_h.m4 @@ -1,4 +1,4 @@ -# stdint_h.m4 serial 8 +# stdint_h.m4 serial 9 dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -12,12 +12,13 @@ dnl From Paul Eggert. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], - [AC_TRY_COMPILE( - [#include -#include ], - [uintmax_t i = (uintmax_t) -1; return !i;], - [gl_cv_header_stdint_h=yes], - [gl_cv_header_stdint_h=no])]) + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include ]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_stdint_h=yes], + [gl_cv_header_stdint_h=no])]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , diff --git a/m4/visibility.m4 b/m4/visibility.m4 index 077c4765e..19cd8f3d3 100644 --- a/m4/visibility.m4 +++ b/m4/visibility.m4 @@ -1,5 +1,5 @@ -# visibility.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc. +# visibility.m4 serial 4 (gettext-0.18.2) +dnl Copyright (C) 2005, 2008, 2010 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. @@ -33,7 +33,8 @@ AC_DEFUN([gl_VISIBILITY], AC_CACHE_VAL([gl_cv_cc_vis_werror], [ gl_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" - AC_TRY_COMPILE([], [], + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], [gl_cv_cc_vis_werror=yes], [gl_cv_cc_vis_werror=no]) CFLAGS="$gl_save_CFLAGS"]) @@ -51,13 +52,15 @@ AC_DEFUN([gl_VISIBILITY], if test $gl_cv_cc_vis_werror = yes; then CFLAGS="$CFLAGS -Werror" fi - AC_TRY_COMPILE( - [extern __attribute__((__visibility__("hidden"))) int hiddenvar; - extern __attribute__((__visibility__("default"))) int exportedvar; - extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); - extern __attribute__((__visibility__("default"))) int exportedfunc (void); - void dummyfunc (void) {}], - [], + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[extern __attribute__((__visibility__("hidden"))) int hiddenvar; + extern __attribute__((__visibility__("default"))) int exportedvar; + extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); + extern __attribute__((__visibility__("default"))) int exportedfunc (void); + void dummyfunc (void) {} + ]], + [[]])], [gl_cv_cc_visibility=yes], [gl_cv_cc_visibility=no]) CFLAGS="$gl_save_CFLAGS"]) diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 index ed804e664..a133e6ad5 100644 --- a/m4/wchar_t.m4 +++ b/m4/wchar_t.m4 @@ -1,4 +1,4 @@ -# wchar_t.m4 serial 3 (gettext-0.18) +# wchar_t.m4 serial 4 (gettext-0.18.2) dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,9 +11,13 @@ dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], - [AC_TRY_COMPILE([#include - wchar_t foo = (wchar_t)'\0';], , - [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])]) + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + wchar_t foo = (wchar_t)'\0';]], + [[]])], + [gt_cv_c_wchar_t=yes], + [gt_cv_c_wchar_t=no])]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) fi diff --git a/m4/wint_t.m4 b/m4/wint_t.m4 index a6c7d15cb..58ef86556 100644 --- a/m4/wint_t.m4 +++ b/m4/wint_t.m4 @@ -1,4 +1,4 @@ -# wint_t.m4 serial 4 (gettext-0.18) +# wint_t.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,7 +11,9 @@ dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be included @@ -20,8 +22,10 @@ AC_DEFUN([gt_TYPE_WINT_T], #include #include #include - wint_t foo = (wchar_t)'\0';], , - [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) + wint_t foo = (wchar_t)'\0';]], + [[]])], + [gt_cv_c_wint_t=yes], + [gt_cv_c_wint_t=no])]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) fi -- 2.11.0