summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-07-19 02:28:28 +0200
committerBruno Haible <bruno@clisp.org>2010-08-26 22:45:33 +0200
commit2c4321f6d6ab71a7bf97177ab685d67a24934fb5 (patch)
tree3adb9ef29d6f716675046aab8b5b8191efefcbd3 /m4
parent20e165d6a6134f89399e090dfefa0d71e3bd500b (diff)
downloadgnulib-2c4321f6d6ab71a7bf97177ab685d67a24934fb5.tar.gz
Modernize AC_TRY_COMPILE invocations.
Diffstat (limited to 'm4')
-rw-r--r--m4/environ.m414
-rw-r--r--m4/iconv.m411
-rw-r--r--m4/intl.m415
-rw-r--r--m4/intmax.m411
-rw-r--r--m4/intmax_t.m413
-rw-r--r--m4/inttypes-pri.m414
-rw-r--r--m4/inttypes_h.m417
-rw-r--r--m4/libunistring.m414
-rw-r--r--m4/locale_h.m416
-rw-r--r--m4/lock.m412
-rw-r--r--m4/malloc.m416
-rw-r--r--m4/mbswidth.m415
-rw-r--r--m4/minmax.m413
-rw-r--r--m4/setenv.m412
-rw-r--r--m4/size_max.m414
-rw-r--r--m4/ssize_t.m412
-rw-r--r--m4/stdarg.m422
-rw-r--r--m4/stdbool.m4107
-rw-r--r--m4/stdint_h.m415
-rw-r--r--m4/visibility.m423
-rw-r--r--m4/wchar_t.m412
-rw-r--r--m4/wint_t.m412
22 files changed, 249 insertions, 161 deletions
diff --git a/m4/environ.m4 b/m4/environ.m4
index 4c6849a3a8..b9dc2ef27e 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 2a89c606e2..081b370ea5 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 <stdlib.h>
#include <iconv.h>
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 335b23c20c..c918e57177 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 <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 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 74aaaf5ed6..2c0f2afe59 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 <stddef.h>
#include <stdlib.h>
#if HAVE_STDINT_H_WITH_UINTMAX
@@ -22,8 +24,9 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
#if HAVE_INTTYPES_H_WITH_UINTMAX
#include <inttypes.h>
#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 975caac506..493e4a9328 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 <stdint.h> or <inttypes.h>.
@@ -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 <stddef.h>
#include <stdlib.h>
#if HAVE_STDINT_H_WITH_UINTMAX
@@ -47,7 +49,10 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
#if HAVE_INTTYPES_H_WITH_UINTMAX
#include <inttypes.h>
#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 <stdint.h> or <inttypes.h>.])
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
index 718a4f4e19..ee96bcd978 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 <inttypes.h> 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 <inttypes.h>
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <inttypes.h>
#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 782d77ed8b..9d8f926926 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 <sys/types.h>
-#include <inttypes.h>],
- [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 <sys/types.h>
+#include <inttypes.h>
+ ]],
+ [[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 <inttypes.h> exists, doesn't clash with <sys/types.h>,
diff --git a/m4/libunistring.m4 b/m4/libunistring.m4
index 7e920e5d93..55f5334045 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 <unistring/cdefs.h>.
- AC_TRY_COMPILE([#include <unistring/cdefs.h>], ,
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <unistring/cdefs.h>]], [[]])],
[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 <unistr.h>.
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 <unicase.h>
- casing_suffix_context_t ct;], ,
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unicase.h>
+ 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 18a119b8ec..8f4f3d440c 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 <locale.h>
-int x = LC_MESSAGES;], [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ 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 <xlocale.h> will do so.
AC_CACHE_CHECK([whether locale.h defines locale_t],
[gl_cv_header_locale_has_locale_t],
- [AC_TRY_COMPILE([#include <locale.h>
-locale_t x;], [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ 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 9da8465ebf..f71c66459e 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 <pthread.h>])
# glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
- AC_TRY_COMPILE([#include <pthread.h>],
- [#if __FreeBSD__ == 4
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <pthread.h>]],
+ [[
+#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 <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
fi
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index fe5befc24f..56fd25e8b6 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 25089f2758..ec553a0f6b 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 <wchar.h> has a declaration of a function mbswidth()
dnl that clashes with ours.
AC_CACHE_CHECK([whether mbswidth is declared in <wchar.h>],
- 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: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
@@ -25,10 +27,13 @@ AC_DEFUN([gl_MBSWIDTH],
#include <stdio.h>
#include <time.h>
#include <wchar.h>
-], [
+ ]],
+ [[
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 d9e9cecfd7..a5c42dea0f 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 58f6d1382c..5a800d337d 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 <stdlib.h>
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
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 ce992db1f1..f3b1a9dfb2 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 <stddef.h>
- extern size_t foo;
- extern unsigned long foo;
- ], [], [fits_in_uint=0])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ 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 e0ccee3a5c..e4c160b50d 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 <sys/types.h>],
- [int x = sizeof (ssize_t *) + sizeof (ssize_t);
- return !x;],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>]],
+ [[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 5c87bd8b5f..8a62f2e844 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='<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 <stdarg.h>], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdarg.h>]],
+ [[
#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 <config.h>, either __va_copy or as a simple
dnl assignment.
gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [
- AC_TRY_COMPILE([#include <stdarg.h>], [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdarg.h>]],
+ [[
#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 4936746643..1efe59ea1c 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 <stdbool.h> 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 <stdbool.h>
- #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 <stdbool.h>
+ #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 b8e3c6cc71..670c0cc2bf 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 <sys/types.h>
-#include <stdint.h>],
- [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 <sys/types.h>
+ #include <stdint.h>]],
+ [[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 <stdint.h> exists, doesn't clash with <sys/types.h>,
diff --git a/m4/visibility.m4 b/m4/visibility.m4
index 077c4765ec..19cd8f3d3e 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 ed804e664b..a133e6ad58 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 <stddef.h>
- 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 <stddef.h>
+ 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 a6c7d15cb5..58ef865565 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: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
@@ -20,8 +22,10 @@ AC_DEFUN([gt_TYPE_WINT_T],
#include <stdio.h>
#include <time.h>
#include <wchar.h>
- 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