bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: avoiding obsolete macros like AC_TRY_RUN


From: Ralf Wildenhues
Subject: Re: avoiding obsolete macros like AC_TRY_RUN
Date: Wed, 2 Sep 2009 23:24:20 +0200
User-agent: Mutt/1.5.20 (2009-08-09)

Hello Bruno,

here is a patch to update most obsolete macro uses from modules you
maintain or co-maintain (and which haven't bean dealt with in the first
patch yet).  The patch mostly uses the m4-semantic equivalent of double
quotation (so that brackets inside are not mangled).  However, there are
macros where I think the original code was likely erroneous, or at least
inconsistent:

    environ.m4:gt_CHECK_VAR_DECL
    intl.m4:gt_CHECK_DECL
    lib-link.m4:AC_LIB_HAVE_LINKFLAGS
    minmax.m4:gl_MINMAX_IN_HEADER
    signbit.m4:gl_FLOATTYPE_SIGN_LOCATION

These macros use argument expansion ($1, $2, ...) within m4-double-
quoted code (remember that AC_TRY_* inconsistently double-quoted its
first one or two arguments, which is one of the reason they were
deprecated), which can lead to unexpected results when the arguments
passed to these macros themselves are not m4 literals (but contain
macros again).

For these macros, the patch below removes the double quotation and
instead uses single quotation (at least for the argument expansion),
as is used throughout the bulk of Autoconf macros.  However, you may
want to treat this with caution as it may change code that depended on
the broken behavior.

I have tested as before: ensuring 'gnulib-tool --with-tests --test'
only shows white-space and comment differences.  However, if you'd like
me to rebuild gettext or other havelib users with this, I could do this,
too.  Should the quoting changes have a NEWS entry?

The AM_CONFIG_HEADER is obsoleted by Automake 1.7 (corresponding to
Autoconf 2.54).

Thanks,
Ralf

    Remove obsolete macros in Bruno's modules.

    * m4/environ.m4 (gt_CHECK_VAR_DECL): Replace obsolete Autoconf
    macros with modern counterparts.  Normalize to one level of M4
    quotation per macro depth.
    * m4/intl.m4 (gt_INTL_SUBDIR_CORE, gt_CHECK_DECL): Likewise.
    * m4/lib-link.m4 (AC_LIB_HAVE_LINKFLAGS): Likewise.
    * m4/minmax.m4 (gl_MINMAX_IN_HEADER): Likewise.
    * m4/signbit.m4 (gl_SIGNBIT, gl_FLOATTYPE_SIGN_LOCATION):
    Likewise.

    * gnulib-tool (func_create_testdir, func_create_megatestdir):
    Replace obsolete Autoconf macros with modern counterparts.
    * m4/btowc.m4 (gl_FUNC_BTOWC): Likewise.
    * m4/ceil.m4 (gl_FUNC_CEIL_LIBS): Likewise.
    * m4/ceilf.m4 (gl_FUNC_CEILF_LIBS): Likewise.
    * m4/ceill.m4 (gl_FUNC_CEILL_LIBS): Likewise.
    * m4/codeset.m4 (AM_LANGINFO_CODESET): Likewise.
    * m4/exponentd.m4 (gl_DOUBLE_EXPONENT_LOCATION): Likewise.
    * m4/exponentf.m4 (gl_FLOAT_EXPONENT_LOCATION): Likewise.
    * m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Likewise.
    * m4/floor.m4 (gl_FUNC_FLOOR_LIBS): Likewise.
    * m4/floorf.m4 (gl_FUNC_FLOORF_LIBS): Likewise.
    * m4/floorl.m4 (gl_FUNC_FLOORL_LIBS): Likewise.
    * m4/fopen.m4 (gl_FUNC_FOPEN): Likewise.
    * m4/frexp.m4 (gl_FUNC_FREXP, gl_FUNC_FREXP_NO_LIBM)
    (gl_FUNC_FREXP_WORKS): Likewise.
    * m4/frexpl.m4 (gl_FUNC_FREXPL, gl_FUNC_FREXPL_NO_LIBM)
    (gl_FUNC_FREXPL_WORKS): Likewise.
    * m4/fseeko.m4 (gl_FUNC_FSEEKO): Likewise.
    * m4/ftello.m4 (gl_FUNC_FTELLO): Likewise.
    * m4/gettext.m4 (AM_GNU_GETTEXT): Likewise.
    * m4/hostent.m4 (gl_HOSTENT): Likewise.
    * m4/iconv.m4 (AM_ICONV_LINK, AM_ICONV): Likewise.
    * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN_UTF): Likewise.
    * m4/intdiv0.m4 (gt_INTDIV0): Likewise.
    * m4/intlmacosx.m4 (gt_INTL_MACOSX): 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/isnand.m4 (gl_HAVE_ISNAND_IN_LIBM, gl_HAVE_ISNAND_NO_LIBM):
    Likewise.
    * m4/isnanf.m4 (gl_HAVE_ISNANF_NO_LIBM, gl_HAVE_ISNANF_IN_LIBM)
    Likewise.
    (gl_ISNANF_WORKS): Likewise.
    * m4/isnanl.m4 (gl_HAVE_ISNANL_NO_LIBM, gl_HAVE_ISNANL_IN_LIBM)
    Likewise.
    (gl_FUNC_ISNANL_WORKS): Likewise.
    * m4/lcmessage.m4 (gt_LC_MESSAGES): Likewise.
    * m4/ldexpl.m4 (gl_FUNC_LDEXPL, gl_FUNC_LDEXPL_WORKS): Likewise.
    * m4/locale_h.m4 (gl_LOCALE_H): Likewise.
    * m4/lock.m4 (gl_LOCK): Likewise.
    * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Likewise.
    * m4/mbrlen.m4 (gl_MBRLEN_INCOMPLETE_STATE, gl_MBRLEN_RETVAL)
    Likewise.
    (gl_MBRLEN_NUL_RETVAL): Likewise.
    * m4/mbrtowc.m4 (gl_MBRTOWC_INCOMPLETE_STATE)
    (gl_MBRTOWC_SANITYCHECK, gl_MBRTOWC_NULL_ARG, gl_MBRTOWC_RETVAL)
    Likewise.
    (gl_MBRTOWC_NUL_RETVAL): Likewise.
    * m4/mbsrtowcs.m4 (gl_MBSRTOWCS_WORKS): Likewise.
    * m4/mbswidth.m4 (gl_MBSWIDTH): Likewise.
    * m4/open.m4 (gl_FUNC_OPEN): Likewise.
    * m4/printf-frexp.m4 (gl_FUNC_PRINTF_FREXP): Likewise.
    * m4/printf-frexpl.m4 (gl_FUNC_PRINTF_FREXPL): Likewise.
    * m4/printf-posix.m4 (gt_PRINTF_POSIX): Likewise.
    * m4/printf.m4 (gl_PRINTF_SIZES_C99, gl_PRINTF_LONG_DOUBLE)
    Likewise.
    (gl_PRINTF_INFINITE, gl_PRINTF_INFINITE_LONG_DOUBLE)
    (gl_PRINTF_DIRECTIVE_A, gl_PRINTF_DIRECTIVE_F)
    (gl_PRINTF_DIRECTIVE_N, gl_PRINTF_DIRECTIVE_LS)
    (gl_PRINTF_POSITIONS, gl_PRINTF_FLAG_GROUPING)
    (gl_PRINTF_FLAG_LEFTADJUST, gl_PRINTF_FLAG_ZERO)
    (gl_PRINTF_PRECISION, gl_SNPRINTF_TRUNCATION_C99)
    (gl_SNPRINTF_RETVAL_C99, gl_SNPRINTF_DIRECTIVE_N)
    (gl_SNPRINTF_SIZE1, gl_VSNPRINTF_ZEROSIZE_C99): Likewise.
    * m4/servent.m4 (gl_SERVENT): 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/stpncpy.m4 (gl_FUNC_STPNCPY): Likewise.
    * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY, gl_THREADLIB_BODY):
    Likewise.
    * m4/trunc.m4 (gl_FUNC_TRUNC): Likewise.
    * m4/truncf.m4 (gl_FUNC_TRUNCF): Likewise.
    * m4/truncl.m4 (gl_FUNC_TRUNCL): Likewise.
    * m4/visibility.m4 (gl_VISIBILITY): Likewise.
    * m4/wchar_t.m4 (gt_TYPE_WCHAR_T): Likewise.
    * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise.
    * m4/wcsrtombs.m4 (gl_WCSRTOMBS_TERMINATION, gl_WCSRTOMBS_NULL):
    Likewise.
    * m4/wctob.m4 (gl_FUNC_WCTOB): Likewise.
    * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise.
    * m4/wint_t.m4 (gt_TYPE_WINT_T): Likewise.
    Prompted by report from Bruce Korb.

diff --git a/gnulib-tool b/gnulib-tool
index c7f31b2..46f5f87 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -4010,7 +4010,7 @@ func_create_testdir ()
      echo "AC_CONFIG_AUX_DIR([$auxdir])"
      echo "AM_INIT_AUTOMAKE"
      echo
-     echo "AM_CONFIG_HEADER([config.h])"
+     echo "AC_CONFIG_HEADERS([config.h])"
      echo
      echo "AC_PROG_CC"
      echo "AC_PROG_INSTALL"
@@ -4100,7 +4100,8 @@ func_create_testdir ()
      # by "merging" config.h into $testsbase/config.h; look out for gcc 
warnings.
      echo "AH_TOP([#include \"../config.h\"])"
      echo
-     echo "AC_OUTPUT([Makefile])"
+     echo "AC_CONFIG_FILES([Makefile])"
+     echo "AC_OUTPUT"
     ) > "$testdir/$testsbase/configure.ac"
     auxdir="$saved_auxdir"
     func_append subdirs " $testsbase"
@@ -4125,7 +4126,7 @@ func_create_testdir ()
    fi
    echo "AM_INIT_AUTOMAKE"
    echo
-   echo "AM_CONFIG_HEADER([config.h])"
+   echo "AC_CONFIG_HEADERS([config.h])"
    echo
    echo "AC_PROG_CC"
    echo "AC_PROG_INSTALL"
@@ -4216,7 +4217,8 @@ func_create_testdir ()
        *) func_append makefiles " $d/Makefile" ;;
      esac
    done
-   echo "AC_OUTPUT([$makefiles])"
+   echo "AC_CONFIG_FILES([$makefiles])"
+   echo "AC_OUTPUT"
   ) > "$testdir/configure.ac"
 
   # Create autogenerated files.
@@ -4378,7 +4380,8 @@ func_create_megatestdir ()
    echo "AC_PROG_MAKE_SET"
    echo
    echo "AC_CONFIG_SUBDIRS([$megasubdirs])"
-   echo "AC_OUTPUT([Makefile])"
+   echo "AC_CONFIG_FILES([Makefile])"
+   echo "AC_OUTPUT"
   ) > "$megatestdir/configure.ac"
 
   # Create autogenerated files.
diff --git a/m4/btowc.m4 b/m4/btowc.m4
index b46f74f..799079c 100644
--- a/m4/btowc.m4
+++ b/m4/btowc.m4
@@ -1,4 +1,4 @@
-# btowc.m4 serial 4
+# btowc.m4 serial 5
 dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -31,7 +31,7 @@ changequote(,)dnl
         esac
 changequote([,])dnl
         if test $LOCALE_FR != none; then
-          AC_TRY_RUN([
+          AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <stdio.h>
 #include <string.h>
@@ -44,7 +44,7 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
             [gl_cv_func_btowc_eof=yes],
             [gl_cv_func_btowc_eof=no],
             [:])
diff --git a/m4/ceil.m4 b/m4/ceil.m4
index 9567686..616a6ac 100644
--- a/m4/ceil.m4
+++ b/m4/ceil.m4
@@ -20,24 +20,24 @@ AC_DEFUN([gl_FUNC_CEIL_LIBS],
 [
   gl_CACHE_VAL_SILENT([gl_cv_func_ceil_libm], [
     gl_cv_func_ceil_libm=?
-    AC_TRY_LINK([
-       #ifndef __NO_MATH_INLINES
-       # define __NO_MATH_INLINES 1 /* for glibc */
-       #endif
-       #include <math.h>
-       double x;],
-      [x = ceil(x);],
-      [gl_cv_func_ceil_libm=])
-    if test "$gl_cv_func_ceil_libm" = "?"; then
-      save_LIBS="$LIBS"
-      LIBS="$LIBS -lm"
-      AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
          #ifndef __NO_MATH_INLINES
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         double x;],
-        [x = ceil(x);],
+         double x;]],
+        [[x = ceil(x);]])],
+      [gl_cv_func_ceil_libm=])
+    if test "$gl_cv_func_ceil_libm" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+           #ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           double x;]],
+          [[x = ceil(x);]])],
         [gl_cv_func_ceil_libm="-lm"])
       LIBS="$save_LIBS"
     fi
diff --git a/m4/ceilf.m4 b/m4/ceilf.m4
index 6455ccd..93120ea 100644
--- a/m4/ceilf.m4
+++ b/m4/ceilf.m4
@@ -1,4 +1,4 @@
-# ceilf.m4 serial 4
+# ceilf.m4 serial 5
 dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -36,24 +36,24 @@ AC_DEFUN([gl_FUNC_CEILF_LIBS],
 [
   gl_CACHE_VAL_SILENT([gl_cv_func_ceilf_libm], [
     gl_cv_func_ceilf_libm=?
-    AC_TRY_LINK([
-       #ifndef __NO_MATH_INLINES
-       # define __NO_MATH_INLINES 1 /* for glibc */
-       #endif
-       #include <math.h>
-       float x;],
-      [x = ceilf(x);],
-      [gl_cv_func_ceilf_libm=])
-    if test "$gl_cv_func_ceilf_libm" = "?"; then
-      save_LIBS="$LIBS"
-      LIBS="$LIBS -lm"
-      AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
          #ifndef __NO_MATH_INLINES
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         float x;],
-        [x = ceilf(x);],
+         float x;]],
+        [[x = ceilf(x);]])],
+      [gl_cv_func_ceilf_libm=])
+    if test "$gl_cv_func_ceilf_libm" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+           #ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           float x;]],
+          [[x = ceilf(x);]])],
         [gl_cv_func_ceilf_libm="-lm"])
       LIBS="$save_LIBS"
     fi
diff --git a/m4/ceill.m4 b/m4/ceill.m4
index 12b3c8f..bdb1ab2 100644
--- a/m4/ceill.m4
+++ b/m4/ceill.m4
@@ -1,4 +1,4 @@
-# ceill.m4 serial 4
+# ceill.m4 serial 5
 dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -36,24 +36,24 @@ AC_DEFUN([gl_FUNC_CEILL_LIBS],
 [
   gl_CACHE_VAL_SILENT([gl_cv_func_ceill_libm], [
     gl_cv_func_ceill_libm=?
-    AC_TRY_LINK([
-       #ifndef __NO_MATH_INLINES
-       # define __NO_MATH_INLINES 1 /* for glibc */
-       #endif
-       #include <math.h>
-       long double x;],
-      [x = ceill(x);],
-      [gl_cv_func_ceill_libm=])
-    if test "$gl_cv_func_ceill_libm" = "?"; then
-      save_LIBS="$LIBS"
-      LIBS="$LIBS -lm"
-      AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
          #ifndef __NO_MATH_INLINES
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         long double x;],
-        [x = ceill(x);],
+         long double x;]],
+        [[x = ceill(x);]])],
+      [gl_cv_func_ceill_libm=])
+    if test "$gl_cv_func_ceill_libm" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+           #ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           long double x;]],
+          [[x = ceill(x);]])],
         [gl_cv_func_ceill_libm="-lm"])
       LIBS="$save_LIBS"
     fi
diff --git a/m4/codeset.m4 b/m4/codeset.m4
index 413217b..4d97a61 100644
--- a/m4/codeset.m4
+++ b/m4/codeset.m4
@@ -1,4 +1,4 @@
-# codeset.m4 serial 4 (gettext-0.18)
+# codeset.m4 serial 5 (gettext-0.18)
 dnl Copyright (C) 2000-2002, 2006, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,8 +9,8 @@ dnl From Bruno Haible.
 AC_DEFUN([AM_LANGINFO_CODESET],
 [
   AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
-    [AC_TRY_LINK([#include <langinfo.h>],
-      [char* cs = nl_langinfo(CODESET); return !cs;],
+    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+        [[char* cs = nl_langinfo(CODESET); return !cs;]])],
       [am_cv_langinfo_codeset=yes],
       [am_cv_langinfo_codeset=no])
     ])
diff --git a/m4/environ.m4 b/m4/environ.m4
index b17bb60..f9d0a68 100644
--- a/m4/environ.m4
+++ b/m4/environ.m4
@@ -1,4 +1,4 @@
-# environ.m4 serial 2
+# environ.m4 serial 3
 dnl Copyright (C) 2001-2004, 2006-2009 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,9 +22,9 @@ 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;],
+    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])
diff --git a/m4/exponentd.m4 b/m4/exponentd.m4
index 140cee4..7175f40 100644
--- a/m4/exponentd.m4
+++ b/m4/exponentd.m4
@@ -1,5 +1,5 @@
-# exponentd.m4 serial 1
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# exponentd.m4 serial 2
+dnl Copyright (C) 2007-2009 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.
@@ -8,7 +8,7 @@ AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION],
   AC_CACHE_CHECK([where to find the exponent in a 'double'],
     [gl_cv_cc_double_expbit0],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <float.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -71,7 +71,7 @@ int main ()
   fprintf (fp, "unknown");
   return (fclose (fp) != 0);
 }
-        ],
+          ]])],
         [gl_cv_cc_double_expbit0=`cat conftest.out`],
         [gl_cv_cc_double_expbit0="unknown"],
         [
diff --git a/m4/exponentf.m4 b/m4/exponentf.m4
index 7ff3413..4c0e3ce 100644
--- a/m4/exponentf.m4
+++ b/m4/exponentf.m4
@@ -1,5 +1,5 @@
-# exponentf.m4 serial 1
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# exponentf.m4 serial 2
+dnl Copyright (C) 2007-2009 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.
@@ -8,7 +8,7 @@ AC_DEFUN([gl_FLOAT_EXPONENT_LOCATION],
   AC_CACHE_CHECK([where to find the exponent in a 'float'],
     [gl_cv_cc_float_expbit0],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <float.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -72,7 +72,7 @@ int main ()
   fprintf (fp, "unknown");
   return (fclose (fp) != 0);
 }
-        ],
+          ]])],
         [gl_cv_cc_float_expbit0=`cat conftest.out`],
         [gl_cv_cc_float_expbit0="unknown"],
         [gl_cv_cc_float_expbit0="word 0 bit 23"])
diff --git a/m4/exponentl.m4 b/m4/exponentl.m4
index 98e35eb..a50e595 100644
--- a/m4/exponentl.m4
+++ b/m4/exponentl.m4
@@ -1,4 +1,4 @@
-# exponentl.m4 serial 2
+# exponentl.m4 serial 3
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,7 @@ AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION],
   AC_CACHE_CHECK([where to find the exponent in a 'long double'],
     [gl_cv_cc_long_double_expbit0],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <float.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -74,7 +74,7 @@ int main ()
   fprintf (fp, "unknown");
   return (fclose (fp) != 0);
 }
-        ],
+          ]])],
         [gl_cv_cc_long_double_expbit0=`cat conftest.out`],
         [gl_cv_cc_long_double_expbit0="unknown"],
         [
diff --git a/m4/floor.m4 b/m4/floor.m4
index b002f58..7c51e4f 100644
--- a/m4/floor.m4
+++ b/m4/floor.m4
@@ -1,4 +1,4 @@
-# floor.m4 serial 3
+# floor.m4 serial 4
 dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -20,24 +20,24 @@ AC_DEFUN([gl_FUNC_FLOOR_LIBS],
 [
   gl_CACHE_VAL_SILENT([gl_cv_func_floor_libm], [
     gl_cv_func_floor_libm=?
-    AC_TRY_LINK([
-       #ifndef __NO_MATH_INLINES
-       # define __NO_MATH_INLINES 1 /* for glibc */
-       #endif
-       #include <math.h>
-       double x;],
-      [x = floor(x);],
-      [gl_cv_func_floor_libm=])
-    if test "$gl_cv_func_floor_libm" = "?"; then
-      save_LIBS="$LIBS"
-      LIBS="$LIBS -lm"
-      AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
          #ifndef __NO_MATH_INLINES
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         double x;],
-        [x = floor(x);],
+         double x;]],
+        [[x = floor(x);]])],
+      [gl_cv_func_floor_libm=])
+    if test "$gl_cv_func_floor_libm" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+           #ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           double x;]],
+          [[x = floor(x);]])],
         [gl_cv_func_floor_libm="-lm"])
       LIBS="$save_LIBS"
     fi
diff --git a/m4/floorf.m4 b/m4/floorf.m4
index 915e566..d617659 100644
--- a/m4/floorf.m4
+++ b/m4/floorf.m4
@@ -1,4 +1,4 @@
-# floorf.m4 serial 4
+# floorf.m4 serial 5
 dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -36,24 +36,24 @@ AC_DEFUN([gl_FUNC_FLOORF_LIBS],
 [
   gl_CACHE_VAL_SILENT([gl_cv_func_floorf_libm], [
     gl_cv_func_floorf_libm=?
-    AC_TRY_LINK([
-       #ifndef __NO_MATH_INLINES
-       # define __NO_MATH_INLINES 1 /* for glibc */
-       #endif
-       #include <math.h>
-       float x;],
-      [x = floorf(x);],
-      [gl_cv_func_floorf_libm=])
-    if test "$gl_cv_func_floorf_libm" = "?"; then
-      save_LIBS="$LIBS"
-      LIBS="$LIBS -lm"
-      AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
          #ifndef __NO_MATH_INLINES
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         float x;],
-        [x = floorf(x);],
+         float x;]],
+        [[x = floorf(x);]])],
+      [gl_cv_func_floorf_libm=])
+    if test "$gl_cv_func_floorf_libm" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+           #ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           float x;]],
+          [[x = floorf(x);]])],
         [gl_cv_func_floorf_libm="-lm"])
       LIBS="$save_LIBS"
     fi
diff --git a/m4/floorl.m4 b/m4/floorl.m4
index fb0e164..f8458fe 100644
--- a/m4/floorl.m4
+++ b/m4/floorl.m4
@@ -1,4 +1,4 @@
-# floorl.m4 serial 4
+# floorl.m4 serial 5
 dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -36,24 +36,24 @@ AC_DEFUN([gl_FUNC_FLOORL_LIBS],
 [
   gl_CACHE_VAL_SILENT([gl_cv_func_floorl_libm], [
     gl_cv_func_floorl_libm=?
-    AC_TRY_LINK([
-       #ifndef __NO_MATH_INLINES
-       # define __NO_MATH_INLINES 1 /* for glibc */
-       #endif
-       #include <math.h>
-       long double x;],
-      [x = floorl(x);],
-      [gl_cv_func_floorl_libm=])
-    if test "$gl_cv_func_floorl_libm" = "?"; then
-      save_LIBS="$LIBS"
-      LIBS="$LIBS -lm"
-      AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
          #ifndef __NO_MATH_INLINES
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         long double x;],
-        [x = floorl(x);],
+         long double x;]],
+        [[x = floorl(x);]])],
+      [gl_cv_func_floorl_libm=])
+    if test "$gl_cv_func_floorl_libm" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+           #ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           long double x;]],
+          [[x = floorl(x);]])],
         [gl_cv_func_floorl_libm="-lm"])
       LIBS="$save_LIBS"
     fi
diff --git a/m4/fopen.m4 b/m4/fopen.m4
index aabe022..aace5db 100644
--- a/m4/fopen.m4
+++ b/m4/fopen.m4
@@ -1,4 +1,4 @@
-# fopen.m4 serial 5
+# fopen.m4 serial 6
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,13 +21,13 @@ AC_DEFUN([gl_FUNC_FOPEN],
       AC_CACHE_CHECK([whether fopen recognizes a trailing slash],
         [gl_cv_func_fopen_slash],
         [
-          AC_TRY_RUN([
+          AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stddef.h>
 #include <stdio.h>
 int main ()
 {
   return fopen ("conftest.sl/", "w") != NULL;
-}], [gl_cv_func_fopen_slash=yes], [gl_cv_func_fopen_slash=no],
+}]])], [gl_cv_func_fopen_slash=yes], [gl_cv_func_fopen_slash=no],
             [
 changequote(,)dnl
              case "$host_os" in
diff --git a/m4/frexp.m4 b/m4/frexp.m4
index 6c91112..043f958 100644
--- a/m4/frexp.m4
+++ b/m4/frexp.m4
@@ -1,4 +1,4 @@
-# frexp.m4 serial 7
+# frexp.m4 serial 8
 dnl Copyright (C) 2007, 2008, 2009 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,9 @@ AC_DEFUN([gl_FUNC_FREXP],
   AC_CACHE_CHECK([whether frexp() can be used without linking with libm],
     [gl_cv_func_frexp_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   double x;],
-                  [int e; return frexp (x, &e) > 0;],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                        double x;]],
+                       [[int e; return frexp (x, &e) > 0;]])],
         [gl_cv_func_frexp_no_libm=yes],
         [gl_cv_func_frexp_no_libm=no])
     ])
@@ -23,9 +23,9 @@ AC_DEFUN([gl_FUNC_FREXP],
       [
         save_LIBS="$LIBS"
         LIBS="$LIBS -lm"
-        AC_TRY_LINK([#include <math.h>
-                     double x;],
-                    [int e; return frexp (x, &e) > 0;],
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                          double x;]],
+                         [[int e; return frexp (x, &e) > 0;]])],
           [gl_cv_func_frexp_in_libm=yes],
           [gl_cv_func_frexp_in_libm=no])
         LIBS="$save_LIBS"
@@ -62,9 +62,9 @@ AC_DEFUN([gl_FUNC_FREXP_NO_LIBM],
   AC_CACHE_CHECK([whether frexp() can be used without linking with libm],
     [gl_cv_func_frexp_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   double x;],
-                  [int e; return frexp (x, &e) > 0;],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                        double x;]],
+                       [[int e; return frexp (x, &e) > 0;]])],
         [gl_cv_func_frexp_no_libm=yes],
         [gl_cv_func_frexp_no_libm=no])
     ])
@@ -96,7 +96,7 @@ AC_DEFUN([gl_FUNC_FREXP_WORKS],
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether frexp works], [gl_cv_func_frexp_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <float.h>
 #include <math.h>
 #include <string.h>
@@ -136,7 +136,7 @@ int main()
       return 1;
   }
   return 0;
-}], [gl_cv_func_frexp_works=yes], [gl_cv_func_frexp_works=no],
+}]])], [gl_cv_func_frexp_works=yes], [gl_cv_func_frexp_works=no],
       [case "$host_os" in
          netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
          *)                        gl_cv_func_frexp_works="guessing yes";;
diff --git a/m4/frexpl.m4 b/m4/frexpl.m4
index c5da744..de2463a 100644
--- a/m4/frexpl.m4
+++ b/m4/frexpl.m4
@@ -1,4 +1,4 @@
-# frexpl.m4 serial 9
+# frexpl.m4 serial 10
 dnl Copyright (C) 2007-2009 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,9 @@ AC_DEFUN([gl_FUNC_FREXPL],
   AC_CACHE_CHECK([whether frexpl() can be used without linking with libm],
     [gl_cv_func_frexpl_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;],
-                  [int e; return frexpl (x, &e) > 0;],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                         long double x;]],
+                        [[int e; return frexpl (x, &e) > 0;]])],
         [gl_cv_func_frexpl_no_libm=yes],
         [gl_cv_func_frexpl_no_libm=no])
     ])
@@ -23,9 +23,9 @@ AC_DEFUN([gl_FUNC_FREXPL],
       [
         save_LIBS="$LIBS"
         LIBS="$LIBS -lm"
-        AC_TRY_LINK([#include <math.h>
-                     long double x;],
-                    [int e; return frexpl (x, &e) > 0;],
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                           long double x;]],
+                          [[int e; return frexpl (x, &e) > 0;]])],
           [gl_cv_func_frexpl_in_libm=yes],
           [gl_cv_func_frexpl_in_libm=no])
         LIBS="$save_LIBS"
@@ -66,9 +66,9 @@ AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM],
   AC_CACHE_CHECK([whether frexpl() can be used without linking with libm],
     [gl_cv_func_frexpl_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;],
-                  [int e; return frexpl (x, &e) > 0;],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                         long double x;]],
+                        [[int e; return frexpl (x, &e) > 0;]])],
         [gl_cv_func_frexpl_no_libm=yes],
         [gl_cv_func_frexpl_no_libm=no])
     ])
@@ -105,7 +105,7 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS],
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether frexpl works], [gl_cv_func_frexpl_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <float.h>
 #include <math.h>
 /* Override the values of <float.h>, like done in float.in.h.  */
@@ -175,7 +175,7 @@ int main()
       return 1;
   }
   return 0;
-}], [gl_cv_func_frexpl_works=yes], [gl_cv_func_frexpl_works=no],
+}]])], [gl_cv_func_frexpl_works=yes], [gl_cv_func_frexpl_works=no],
       [case "$host_os" in
          aix* | beos* | darwin* | irix* | mingw* | pw*)
             gl_cv_func_frexpl_works="guessing no";;
diff --git a/m4/fseeko.m4 b/m4/fseeko.m4
index 3d77365..59f552e 100644
--- a/m4/fseeko.m4
+++ b/m4/fseeko.m4
@@ -1,5 +1,5 @@
-# fseeko.m4 serial 4
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# fseeko.m4 serial 5
+dnl Copyright (C) 2007-2009 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.
@@ -15,7 +15,7 @@ AC_DEFUN([gl_FUNC_FSEEKO],
 
   AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
     [
-      AC_TRY_LINK([#include <stdio.h>], [fseeko (stdin, 0, 0);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[fseeko (stdin, 
0, 0);]])],
        [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
     ])
   if test $gl_cv_func_fseeko = no; then
diff --git a/m4/ftello.m4 b/m4/ftello.m4
index 51308ef..e1e581c 100644
--- a/m4/ftello.m4
+++ b/m4/ftello.m4
@@ -15,7 +15,7 @@ AC_DEFUN([gl_FUNC_FTELLO],
 
   AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
     [
-      AC_TRY_LINK([#include <stdio.h>], [ftello (stdin);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[ftello 
(stdin);]])],
        [gl_cv_func_ftello=yes], [gl_cv_func_ftello=no])
     ])
   if test $gl_cv_func_ftello = no; then
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index d90c850..8a48c0f 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 62 (gettext-0.18)
+# gettext.m4 serial 63 (gettext-0.18)
 dnl Copyright (C) 1995-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -155,12 +155,12 @@ changequote([,])dnl
         fi
 
         AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
-         [AC_TRY_LINK([#include <libintl.h>
+         [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libintl.h>
 $gt_revision_test_code
 extern int _nl_msg_cat_cntr;
-extern int *_nl_domain_bindings;],
-            [bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + 
*_nl_domain_bindings],
+extern int *_nl_domain_bindings;]],
+              [[bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + 
*_nl_domain_bindings]])],
             [eval "$gt_func_gnugettext_libc=yes"],
             [eval "$gt_func_gnugettext_libc=no"])])
 
@@ -181,31 +181,31 @@ return * gettext ("")$gt_expression_test_code + 
_nl_msg_cat_cntr + *_nl_domain_b
             gt_save_LIBS="$LIBS"
             LIBS="$LIBS $LIBINTL"
             dnl Now see whether libintl exists and does not depend on libiconv.
-            AC_TRY_LINK([#include <libintl.h>
+            AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libintl.h>
 $gt_revision_test_code
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias (const char *);],
-              [bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + 
*_nl_expand_alias ("")],
+const char *_nl_expand_alias (const char *);]],
+                [[bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + 
*_nl_expand_alias ("")]])],
               [eval "$gt_func_gnugettext_libintl=yes"],
               [eval "$gt_func_gnugettext_libintl=no"])
             dnl Now see whether libintl exists and depends on libiconv.
             if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" 
!= yes; } && test -n "$LIBICONV"; then
               LIBS="$LIBS $LIBICONV"
-              AC_TRY_LINK([#include <libintl.h>
+              AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libintl.h>
 $gt_revision_test_code
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias (const char *);],
-                [bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + 
*_nl_expand_alias ("")],
+const char *_nl_expand_alias (const char *);]],
+                  [[bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + 
*_nl_expand_alias ("")]])],
                [LIBINTL="$LIBINTL $LIBICONV"
                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
                 eval "$gt_func_gnugettext_libintl=yes"
diff --git a/m4/hostent.m4 b/m4/hostent.m4
index 4a96af7..5831330 100644
--- a/m4/hostent.m4
+++ b/m4/hostent.m4
@@ -1,5 +1,5 @@
-# hostent.m4 serial 1
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# hostent.m4 serial 2
+dnl Copyright (C) 2008, 2009 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.
@@ -28,12 +28,12 @@ AC_DEFUN([gl_HOSTENT],
         [gl_cv_w32_gethostbyname=no
          gl_save_LIBS="$LIBS"
          LIBS="$LIBS -lws2_32"
-         AC_TRY_LINK([
+         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
 #endif
 #include <stddef.h>
-], [gethostbyname(NULL);], [gl_cv_w32_gethostbyname=yes])
+]], [[gethostbyname(NULL);]])], [gl_cv_w32_gethostbyname=yes])
          LIBS="$gl_save_LIBS"
         ])
       if test "$gl_cv_w32_gethostbyname" = "yes"; then
diff --git a/m4/iconv.m4 b/m4/iconv.m4
index ce21b0b..d3da65b 100644
--- a/m4/iconv.m4
+++ b/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial AM8 (gettext-0.18)
+# iconv.m4 serial AM9 (gettext-0.18)
 dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -30,27 +30,27 @@ AC_DEFUN([AM_ICONV_LINK],
   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
   dnl because if the user has installed libiconv and not disabled its use
   dnl via --without-libiconv-prefix, he wants to use it. The first
-  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+  dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
   am_save_CPPFLAGS="$CPPFLAGS"
   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
   AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
-    AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-      [iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);],
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+#include <iconv.h>]],
+        [[iconv_t cd = iconv_open("","");
+          iconv(cd,NULL,NULL,NULL,NULL);
+          iconv_close(cd);]])],
       [am_cv_func_iconv=yes])
     if test "$am_cv_func_iconv" != yes; then
       am_save_LIBS="$LIBS"
       LIBS="$LIBS $LIBICONV"
-      AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-        [iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+#include <iconv.h>]],
+          [[iconv_t cd = iconv_open("","");
+            iconv(cd,NULL,NULL,NULL,NULL);
+            iconv_close(cd);]])],
         [am_cv_lib_iconv=yes]
         [am_cv_func_iconv=yes])
       LIBS="$am_save_LIBS"
@@ -63,7 +63,7 @@ AC_DEFUN([AM_ICONV_LINK],
       if test $am_cv_lib_iconv = yes; then
         LIBS="$LIBS $LIBICONV"
       fi
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <iconv.h>
 #include <string.h>
 int main ()
@@ -119,7 +119,7 @@ int main ()
       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
     return 1;
   return 0;
-}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
+}]])], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
         [case "$host_os" in
            aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
            *)            am_cv_func_iconv_works="guessing yes" ;;
@@ -157,7 +157,7 @@ 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
@@ -169,7 +169,7 @@ 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/iconv_open.m4 b/m4/iconv_open.m4
index 8eeef9f..323806a 100644
--- a/m4/iconv_open.m4
+++ b/m4/iconv_open.m4
@@ -61,7 +61,7 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF],
       [
         save_LIBS="$LIBS"
         LIBS="$LIBS $LIBICONV"
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <iconv.h>
 #include <errno.h>
 #include <stdio.h>
@@ -207,7 +207,7 @@ int main ()
     ASSERT (iconv_close (cd) == 0);
   }
   return 0;
-}], [gl_cv_func_iconv_supports_utf=yes], [gl_cv_func_iconv_supports_utf=no],
+}]])], [gl_cv_func_iconv_supports_utf=yes], [gl_cv_func_iconv_supports_utf=no],
           [
            dnl We know that GNU libiconv, GNU libc, and Solaris >= 9 do.
            dnl OSF/1 5.1 has these encodings, but inserts a BOM in the "to"
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4
index 29e6e0a..6fa632b 100644
--- a/m4/intdiv0.m4
+++ b/m4/intdiv0.m4
@@ -1,5 +1,5 @@
-# intdiv0.m4 serial 3 (gettext-0.18)
-dnl Copyright (C) 2002, 2007-2008 Free Software Foundation, Inc.
+# intdiv0.m4 serial 4 (gettext-0.18)
+dnl Copyright (C) 2002, 2007-2009 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.
@@ -29,7 +29,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test -z "$gt_cv_int_divbyzero_sigfpe"; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdlib.h>
 #include <signal.h>
 
@@ -61,7 +61,7 @@ int main ()
   nan = y / y;
   exit (1);
 }
-], [gt_cv_int_divbyzero_sigfpe=yes], [gt_cv_int_divbyzero_sigfpe=no],
+]])], [gt_cv_int_divbyzero_sigfpe=yes], [gt_cv_int_divbyzero_sigfpe=no],
           [
             # Guess based on the CPU.
 changequote(,)dnl
diff --git a/m4/intl.m4 b/m4/intl.m4
index 934408b..80aea53 100644
--- a/m4/intl.m4
+++ b/m4/intl.m4
@@ -1,5 +1,5 @@
-# intl.m4 serial 8 (gettext-0.17)
-dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
+# intl.m4 serial 9 (gettext-0.17)
+dnl Copyright (C) 1995-2007, 2009 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.
@@ -195,9 +195,9 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
   AC_REQUIRE([gt_INTTYPES_PRI])dnl
   AC_REQUIRE([gl_LOCK])dnl
 
-  AC_TRY_LINK(
-    [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; 
}],
-    [],
+  AC_LINK_IFELSE([AC_LANG_PROGRAM(
+      [[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 
1; }]],
+      [])],
     [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
        [Define to 1 if the compiler understands __builtin_expect.])])
 
@@ -219,11 +219,11 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
   dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
   dnl and a _NL_LOCALE_NAME macro always.
   AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
-    [AC_TRY_LINK([#include <langinfo.h>
-#include <locale.h>],
-      [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
-       return !cs;
-      ],
+    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>
+#include <locale.h>]],
+        [[char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
+          return !cs;
+        ]])],
       gt_cv_nl_locale_name=yes,
       gt_cv_nl_locale_name=no)
     ])
@@ -270,11 +270,11 @@ 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_PROGRAM([$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/intlmacosx.m4 b/m4/intlmacosx.m4
index c24837c..8df0d4c 100644
--- a/m4/intlmacosx.m4
+++ b/m4/intlmacosx.m4
@@ -1,4 +1,4 @@
-# intlmacosx.m4 serial 3 (gettext-0.18)
+# intlmacosx.m4 serial 4 (gettext-0.18)
 dnl Copyright (C) 2004-2009 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,8 +22,8 @@ AC_DEFUN([gt_INTL_MACOSX],
     [gt_cv_func_CFPreferencesCopyAppValue],
     [gt_save_LIBS="$LIBS"
      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
-     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
-       [CFPreferencesCopyAppValue(NULL, NULL)],
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include 
<CoreFoundation/CFPreferences.h>]],
+         [[CFPreferencesCopyAppValue(NULL, NULL)]])],
        [gt_cv_func_CFPreferencesCopyAppValue=yes],
        [gt_cv_func_CFPreferencesCopyAppValue=no])
      LIBS="$gt_save_LIBS"])
@@ -35,7 +35,8 @@ AC_DEFUN([gt_INTL_MACOSX],
   AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
     [gt_save_LIBS="$LIBS"
      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
-     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], 
[CFLocaleCopyCurrent();],
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <CoreFoundation/CFLocale.h>]],
+         [[CFLocaleCopyCurrent();]])],
        [gt_cv_func_CFLocaleCopyCurrent=yes],
        [gt_cv_func_CFLocaleCopyCurrent=no])
      LIBS="$gt_save_LIBS"])
diff --git a/m4/intmax.m4 b/m4/intmax.m4
index a3785e9..3f032bc 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)
 dnl Copyright (C) 2002-2005, 2008, 2009 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,7 @@ 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 +22,8 @@ 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 264cb57..1b1db6c 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 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,7 @@ 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
@@ -46,7 +46,7 @@ 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 98fec7b..b873ed6 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)
 dnl Copyright (C) 1997-2002, 2006, 2008, 2009 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,11 +18,11 @@ 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 f4ca160..e81bd42 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, 2009 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,10 +12,10 @@ 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;],
+  [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
diff --git a/m4/isnand.m4 b/m4/isnand.m4
index c823c2c..e5dd572 100644
--- a/m4/isnand.m4
+++ b/m4/isnand.m4
@@ -1,4 +1,4 @@
-# isnand.m4 serial 6
+# isnand.m4 serial 7
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -58,16 +58,16 @@ AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM],
     [
       save_LIBS="$LIBS"
       LIBS="$LIBS -lm"
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnand
-                   # define isnand(x) __builtin_isnand ((double)(x))
-                   #elif defined isnan
-                   # undef isnand
-                   # define isnand(x) isnan ((double)(x))
-                   #endif
-                   double x;],
-                  [return isnand (x);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+            #if __GNUC__ >= 4
+            # undef isnand
+            # define isnand(x) __builtin_isnand ((double)(x))
+            #elif defined isnan
+            # undef isnand
+            # define isnand(x) isnan ((double)(x))
+            #endif
+            double x;]],
+          [[return isnand (x);]])],
         [gl_cv_func_isnand_in_libm=yes],
         [gl_cv_func_isnand_in_libm=no])
       LIBS="$save_LIBS"
@@ -79,16 +79,16 @@ AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM],
   AC_CACHE_CHECK([whether isnan(double) can be used without linking with libm],
     [gl_cv_func_isnand_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnand
-                   # define isnand(x) __builtin_isnan ((double)(x))
-                   #else
-                   # undef isnand
-                   # define isnand(x) isnan ((double)(x))
-                   #endif
-                   double x;],
-                  [return isnand (x);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+            #if __GNUC__ >= 4
+            # undef isnand
+            # define isnand(x) __builtin_isnan ((double)(x))
+            #else
+            # undef isnand
+            # define isnand(x) isnan ((double)(x))
+            #endif
+            double x;]],
+          [[return isnand (x);]])],
         [gl_cv_func_isnand_no_libm=yes],
         [gl_cv_func_isnand_no_libm=no])
     ])
diff --git a/m4/isnanf.m4 b/m4/isnanf.m4
index 2ad8f94..0f9421b 100644
--- a/m4/isnanf.m4
+++ b/m4/isnanf.m4
@@ -1,4 +1,4 @@
-# isnanf.m4 serial 10
+# isnanf.m4 serial 11
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -71,16 +71,17 @@ AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM],
   AC_CACHE_CHECK([whether isnan(float) can be used without linking with libm],
     [gl_cv_func_isnanf_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanf
-                   # define isnanf(x) __builtin_isnanf ((float)(x))
-                   #elif defined isnan
-                   # undef isnanf
-                   # define isnanf(x) isnan ((float)(x))
-                   #endif
-                   float x;],
-                  [return isnanf (x);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+             #include <math.h>
+             #if __GNUC__ >= 4
+             # undef isnanf
+             # define isnanf(x) __builtin_isnanf ((float)(x))
+             #elif defined isnan
+             # undef isnanf
+             # define isnanf(x) isnan ((float)(x))
+             #endif
+             float x;]],
+           [[return isnanf (x);]])],
         [gl_cv_func_isnanf_no_libm=yes],
         [gl_cv_func_isnanf_no_libm=no])
     ])
@@ -94,16 +95,16 @@ AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM],
     [
       save_LIBS="$LIBS"
       LIBS="$LIBS -lm"
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanf
-                   # define isnanf(x) __builtin_isnanf ((float)(x))
-                   #elif defined isnan
-                   # undef isnanf
-                   # define isnanf(x) isnan ((float)(x))
-                   #endif
-                   float x;],
-                  [return isnanf (x);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+            #if __GNUC__ >= 4
+            # undef isnanf
+            # define isnanf(x) __builtin_isnanf ((float)(x))
+            #elif defined isnan
+            # undef isnanf
+            # define isnanf(x) isnan ((float)(x))
+            #endif
+            float x;]],
+          [[return isnanf (x);]])],
         [gl_cv_func_isnanf_in_libm=yes],
         [gl_cv_func_isnanf_in_libm=no])
       LIBS="$save_LIBS"
@@ -120,7 +121,7 @@ AC_DEFUN([gl_ISNANF_WORKS],
   AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION])
   AC_CACHE_CHECK([whether isnan(float) works], [gl_cv_func_isnanf_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <math.h>
 #if __GNUC__ >= 4
 # undef isnanf
@@ -169,7 +170,7 @@ int main()
 #endif
 
   return 0;
-}], [gl_cv_func_isnanf_works=yes], [gl_cv_func_isnanf_works=no],
+}]])], [gl_cv_func_isnanf_works=yes], [gl_cv_func_isnanf_works=no],
         [case "$host_os" in
            irix* | solaris*) gl_cv_func_isnanf_works="guessing no";;
            *)                gl_cv_func_isnanf_works="guessing yes";;
diff --git a/m4/isnanl.m4 b/m4/isnanl.m4
index e3029f5..6fb908b 100644
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -1,4 +1,4 @@
-# isnanl.m4 serial 12
+# isnanl.m4 serial 13
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -67,16 +67,16 @@ AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM],
   AC_CACHE_CHECK([whether isnan(long double) can be used without linking with 
libm],
     [gl_cv_func_isnanl_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanl
-                   # define isnanl(x) __builtin_isnanl ((long double)(x))
-                   #elif defined isnan
-                   # undef isnanl
-                   # define isnanl(x) isnan ((long double)(x))
-                   #endif
-                   long double x;],
-                  [return isnanl (x);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+            #if __GNUC__ >= 4
+            # undef isnanl
+            # define isnanl(x) __builtin_isnanl ((long double)(x))
+            #elif defined isnan
+            # undef isnanl
+            # define isnanl(x) isnan ((long double)(x))
+            #endif
+            long double x;]],
+          [[return isnanl (x);]])],
         [gl_cv_func_isnanl_no_libm=yes],
         [gl_cv_func_isnanl_no_libm=no])
     ])
@@ -90,16 +90,16 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM],
     [
       save_LIBS="$LIBS"
       LIBS="$LIBS -lm"
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanl
-                   # define isnanl(x) __builtin_isnanl ((long double)(x))
-                   #elif defined isnan
-                   # undef isnanl
-                   # define isnanl(x) isnan ((long double)(x))
-                   #endif
-                   long double x;],
-                  [return isnanl (x);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+            #if __GNUC__ >= 4
+            # undef isnanl
+            # define isnanl(x) __builtin_isnanl ((long double)(x))
+            #elif defined isnan
+            # undef isnanl
+            # define isnanl(x) isnan ((long double)(x))
+            #endif
+            long double x;]],
+          [[return isnanl (x);]])],
         [gl_cv_func_isnanl_in_libm=yes],
         [gl_cv_func_isnanl_in_libm=no])
       LIBS="$save_LIBS"
@@ -118,7 +118,7 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS],
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <float.h>
 #include <limits.h>
 #include <math.h>
@@ -229,7 +229,7 @@ int main ()
 #endif
 
   return 0;
-}], [gl_cv_func_isnanl_works=yes], [gl_cv_func_isnanl_works=no],
+}]])], [gl_cv_func_isnanl_works=yes], [gl_cv_func_isnanl_works=no],
       [case "$host_cpu" in
                                # Guess no on ia64, x86_64, i386.
          ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";;
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
index fa8e416..2b9ac55 100644
--- a/m4/lcmessage.m4
+++ b/m4/lcmessage.m4
@@ -1,4 +1,4 @@
-# lcmessage.m4 serial 6 (gettext-0.18)
+# lcmessage.m4 serial 7 (gettext-0.18)
 dnl Copyright (C) 1995-2002, 2004-2005, 2008, 2009 Free Software Foundation, 
Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,7 +21,7 @@ dnl   Ulrich Drepper <address@hidden>, 1995.
 AC_DEFUN([gt_LC_MESSAGES],
 [
   AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
-    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <locale.h>]], [[return 
LC_MESSAGES]])],
        [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])])
   if test $gt_cv_val_LC_MESSAGES = yes; then
     AC_DEFINE([HAVE_LC_MESSAGES], [1],
diff --git a/m4/ldexpl.m4 b/m4/ldexpl.m4
index 8ba85c6..eb350ba 100644
--- a/m4/ldexpl.m4
+++ b/m4/ldexpl.m4
@@ -1,4 +1,4 @@
-# ldexpl.m4 serial 4
+# ldexpl.m4 serial 6
 dnl Copyright (C) 2007-2009 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,9 @@ AC_DEFUN([gl_FUNC_LDEXPL],
   AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm],
     [gl_cv_func_ldexpl_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;],
-                  [return ldexpl (x, -1) > 0;],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                          long double x;]],
+                        [[return ldexpl (x, -1) > 0;]])],
         [gl_cv_func_ldexpl_no_libm=yes],
         [gl_cv_func_ldexpl_no_libm=no])
     ])
@@ -23,9 +23,9 @@ AC_DEFUN([gl_FUNC_LDEXPL],
       [
         save_LIBS="$LIBS"
         LIBS="$LIBS -lm"
-        AC_TRY_LINK([#include <math.h>
-                     long double x;],
-                    [return ldexpl (x, -1) > 0;],
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                           long double x;]],
+                         [[return ldexpl (x, -1) > 0;]])],
           [gl_cv_func_ldexpl_in_libm=yes],
           [gl_cv_func_ldexpl_in_libm=no])
         LIBS="$save_LIBS"
@@ -68,7 +68,7 @@ AC_DEFUN([gl_FUNC_LDEXPL_WORKS],
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether ldexpl works], [gl_cv_func_ldexpl_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <math.h>
 extern long double ldexpl (long double, int);
 int main()
@@ -78,7 +78,7 @@ int main()
   volatile long double x2 = 1.73205L;
   volatile long double y2 = ldexpl (x2, 0);
   return (y1 != 0.5L) || (y2 != x2);
-}], [gl_cv_func_ldexpl_works=yes], [gl_cv_func_ldexpl_works=no],
+}]])], [gl_cv_func_ldexpl_works=yes], [gl_cv_func_ldexpl_works=no],
       [case "$host_os" in
          aix*) gl_cv_func_ldexpl_works="guessing no";;
          *)    gl_cv_func_ldexpl_works="guessing yes";;
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index 2f8b7ff..74e5aa1 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 20 (gettext-0.18)
+# lib-link.m4 serial 21 (gettext-0.18)
 dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -75,7 +75,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
     ac_save_LIBS="$LIBS"
     LIBS="$LIBS $LIB[]NAME"
-    AC_TRY_LINK([$3], [$4],
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([$3], [$4])],
       [ac_cv_lib[]Name=yes],
       [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
     LIBS="$ac_save_LIBS"
diff --git a/m4/locale_h.m4 b/m4/locale_h.m4
index 8612367..73ad2d8 100644
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,4 +1,4 @@
-# locale_h.m4 serial 3
+# locale_h.m4 serial 4
 dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,8 +8,8 @@ AC_DEFUN([gl_LOCALE_H],
 [
   AC_CACHE_CHECK([whether locale.h conforms to POSIX],
     [gl_cv_header_working_locale_h],
-    [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_working_locale_h=yes],
        [gl_cv_header_working_locale_h=no])])
 
diff --git a/m4/lock.m4 b/m4/lock.m4
index b416e31..b4c76a6 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)
 dnl Copyright (C) 2005-2009 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,13 @@ 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
-error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
-#else
-int x = (int)PTHREAD_MUTEX_RECURSIVE;
-return !x;
-#endif],
+    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]])],
       [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 8070171..3bf63c5 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,4 +1,4 @@
-# malloc.m4 serial 9
+# malloc.m4 serial 10
 dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ 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/mbrlen.m4 b/m4/mbrlen.m4
index 5623ed5..d5ab546 100644
--- a/m4/mbrlen.m4
+++ b/m4/mbrlen.m4
@@ -1,5 +1,5 @@
-# mbrlen.m4 serial 2
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# mbrlen.m4 serial 3
+dnl Copyright (C) 2008, 2009 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.
@@ -52,7 +52,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_JA != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -69,7 +69,7 @@ int main ()
           return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrlen_incomplete_state=yes],
           [gl_cv_func_mbrlen_incomplete_state=no],
           [])
@@ -102,7 +102,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -137,7 +137,7 @@ int main ()
         }
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrlen_retval=yes],
           [gl_cv_func_mbrlen_retval=no],
           [])
@@ -167,7 +167,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_ZH_CN != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -183,7 +183,7 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrlen_nul_retval=yes],
           [gl_cv_func_mbrlen_nul_retval=no],
           [])
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index 2fddcc8..38663da 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,4 +1,4 @@
-# mbrtowc.m4 serial 16
+# mbrtowc.m4 serial 17
 dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 Free Software Foundation, 
Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -106,7 +106,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_JA != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -124,7 +124,7 @@ int main ()
           return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_incomplete_state=yes],
           [gl_cv_func_mbrtowc_incomplete_state=no],
           [:])
@@ -154,7 +154,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_ZH_CN != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
@@ -176,7 +176,7 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_sanitycheck=yes],
           [gl_cv_func_mbrtowc_sanitycheck=no],
           [:])
@@ -206,7 +206,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_FR_UTF8 != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -226,7 +226,7 @@ int main ()
         return 1;
     }
   return 0;
-}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [:])
+}]])], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], 
[:])
       fi
     ])
 ])
@@ -256,7 +256,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -293,7 +293,7 @@ int main ()
         }
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_retval=yes],
           [gl_cv_func_mbrtowc_retval=no],
           [:])
@@ -323,7 +323,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_ZH_CN != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -340,7 +340,7 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_nul_retval=yes],
           [gl_cv_func_mbrtowc_nul_retval=no],
           [:])
diff --git a/m4/mbsrtowcs.m4 b/m4/mbsrtowcs.m4
index 55b87c1..238716c 100644
--- a/m4/mbsrtowcs.m4
+++ b/m4/mbsrtowcs.m4
@@ -1,4 +1,4 @@
-# mbsrtowcs.m4 serial 5
+# mbsrtowcs.m4 serial 6
 dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -56,7 +56,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test 
$LOCALE_ZH_CN != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -107,7 +107,7 @@ int main ()
           }
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbsrtowcs_works=yes],
           [gl_cv_func_mbsrtowcs_works=no],
           [:])
diff --git a/m4/mbswidth.m4 b/m4/mbswidth.m4
index fcd0a68..f6b9a41 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-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -16,7 +16,7 @@ AC_DEFUN([gl_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_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 +25,10 @@ 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 d2993fb..3e0ad7d 100644
--- a/m4/minmax.m4
+++ b/m4/minmax.m4
@@ -1,4 +1,4 @@
-# minmax.m4 serial 3
+# minmax.m4 serial 4
 dnl Copyright (C) 2005, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -28,8 +28,8 @@ 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/open.m4 b/m4/open.m4
index c0eb8e8..a144bdc 100644
--- a/m4/open.m4
+++ b/m4/open.m4
@@ -1,4 +1,4 @@
-# open.m4 serial 7
+# open.m4 serial 8
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_OPEN],
       AC_CACHE_CHECK([whether open recognizes a trailing slash],
         [gl_cv_func_open_slash],
         [
-          AC_TRY_RUN([
+          AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <fcntl.h>
 #if HAVE_UNISTD_H
 # include <unistd.h>
@@ -25,7 +25,7 @@ AC_DEFUN([gl_FUNC_OPEN],
 int main ()
 {
   return open ("conftest.sl/", O_CREAT, 0600) >= 0;
-}], [gl_cv_func_open_slash=yes], [gl_cv_func_open_slash=no],
+}]])], [gl_cv_func_open_slash=yes], [gl_cv_func_open_slash=no],
             [
 changequote(,)dnl
              case "$host_os" in
diff --git a/m4/printf-frexp.m4 b/m4/printf-frexp.m4
index fa0aa15..079fa4a 100644
--- a/m4/printf-frexp.m4
+++ b/m4/printf-frexp.m4
@@ -1,4 +1,4 @@
-# printf-frexp.m4 serial 3
+# printf-frexp.m4 serial 4
 dnl Copyright (C) 2007, 2009 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,10 +11,10 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXP],
   AC_CACHE_CHECK([whether frexp can be used without linking with libm],
     [gl_cv_func_frexp_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   double x;
-                   int y;],
-                  [return frexp (x, &y) < 1;],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                        double x;
+                        int y;]],
+                       [[return frexp (x, &y) < 1;]])],
         [gl_cv_func_frexp_no_libm=yes],
         [gl_cv_func_frexp_no_libm=no])
     ])
@@ -31,10 +31,10 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXP],
   AC_CACHE_CHECK([whether ldexp can be used without linking with libm],
     [gl_cv_func_ldexp_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   double x;
-                   int y;],
-                  [return ldexp (x, y) < 1;],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                        double x;
+                        int y;]],
+                       [[return ldexp (x, y) < 1;]])],
         [gl_cv_func_ldexp_no_libm=yes],
         [gl_cv_func_ldexp_no_libm=no])
     ])
diff --git a/m4/printf-frexpl.m4 b/m4/printf-frexpl.m4
index f2eb200..d2b6b02 100644
--- a/m4/printf-frexpl.m4
+++ b/m4/printf-frexpl.m4
@@ -1,4 +1,4 @@
-# printf-frexpl.m4 serial 6
+# printf-frexpl.m4 serial 7
 dnl Copyright (C) 2007, 2009 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,10 +13,10 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
   AC_CACHE_CHECK([whether frexpl can be used without linking with libm],
     [gl_cv_func_frexpl_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;
-                   int y;],
-                  [return frexpl (x, &y) < 1;],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                         long double x;
+                         int y;]],
+                        [[return frexpl (x, &y) < 1;]])],
         [gl_cv_func_frexpl_no_libm=yes],
         [gl_cv_func_frexpl_no_libm=no])
     ])
@@ -42,10 +42,10 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
   AC_CACHE_CHECK([whether ldexpl can be used without linking with libm],
     [gl_cv_func_ldexpl_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;
-                   int y;],
-                  [return ldexpl (x, y) < 1;],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                         long double x;
+                         int y;]],
+                        [[return ldexpl (x, y) < 1;]])],
         [gl_cv_func_ldexpl_no_libm=yes],
         [gl_cv_func_ldexpl_no_libm=no])
     ])
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4
index 5922d27..1091625 100644
--- a/m4/printf-posix.m4
+++ b/m4/printf-posix.m4
@@ -1,4 +1,4 @@
-# printf-posix.m4 serial 5 (gettext-0.18)
+# printf-posix.m4 serial 6 (gettext-0.18)
 dnl Copyright (C) 2003, 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,7 @@ AC_DEFUN([gt_PRINTF_POSIX],
   AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
     gt_cv_func_printf_posix,
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 /* The string "%2$d %1$d", with dollar characters protected from the shell's
@@ -25,7 +25,7 @@ int main ()
 {
   sprintf (buf, format, 33, 55);
   return (strcmp (buf, "55 33") != 0);
-}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
+}]])], [gt_cv_func_printf_posix=yes], [gt_cv_func_printf_posix=no],
       [
         AC_EGREP_CPP([notposix], [
 #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined 
__MINGW32__ || defined __CYGWIN__
diff --git a/m4/printf.m4 b/m4/printf.m4
index 87aa45c..991f001 100644
--- a/m4/printf.m4
+++ b/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 33
+# printf.m4 serial 34
 dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ AC_DEFUN([gl_PRINTF_SIZES_C99],
   AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
     [gl_cv_func_printf_sizes_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
@@ -50,7 +50,7 @@ int main ()
       || strcmp (buf, "1.5 33") != 0)
     return 1;
   return 0;
-}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
+}]])], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -92,7 +92,7 @@ AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
   AC_CACHE_CHECK([whether printf supports 'long double' arguments],
     [gl_cv_func_printf_long_double],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[10000];
@@ -111,7 +111,7 @@ int main ()
       || strcmp (buf, "1.75 33") != 0)
     return 1;
   return 0;
-}], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no],
+}]])], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -136,7 +136,7 @@ AC_DEFUN([gl_PRINTF_INFINITE],
   AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
     [gl_cv_func_printf_infinite],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static int
@@ -201,7 +201,7 @@ int main ()
         || strcmp (buf, "-0") != 0)
     return 1;
   return 0;
-}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
+}]])], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -252,7 +252,7 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
       AC_CACHE_CHECK([whether printf supports infinite 'long double' 
arguments],
         [gl_cv_func_printf_infinite_long_double],
         [
-          AC_TRY_RUN([
+          AC_RUN_IFELSE([AC_LANG_SOURCE([[
 ]GL_NOCRASH[
 #include <float.h>
 #include <stdio.h>
@@ -414,7 +414,7 @@ int main ()
   }
 #endif
   return 0;
-}],
+}]])],
           [gl_cv_func_printf_infinite_long_double=yes],
           [gl_cv_func_printf_infinite_long_double=no],
           [
@@ -466,7 +466,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
   AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
     [gl_cv_func_printf_directive_a],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -512,7 +512,7 @@ int main ()
           && strcmp (buf, "0x8.0p-2") != 0))
     return 1;
   return 0;
-}], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
+}]])], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
       [
        case "$host_os" in
                                # Guess yes on glibc >= 2.5 systems.
@@ -546,7 +546,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
   AC_CACHE_CHECK([whether printf supports the 'F' directive],
     [gl_cv_func_printf_directive_f],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -563,7 +563,7 @@ int main ()
       || strcmp (buf, "1234") != 0)
     return 1;
   return 0;
-}], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
+}]])], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -597,7 +597,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
   AC_CACHE_CHECK([whether printf supports the 'n' directive],
     [gl_cv_func_printf_directive_n],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char fmtstring[10];
@@ -614,7 +614,7 @@ int main ()
       || count != 4)
     return 1;
   return 0;
-}], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
+}]])], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -639,7 +639,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
   AC_CACHE_CHECK([whether printf supports the 'ls' directive],
     [gl_cv_func_printf_directive_ls],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 /* 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
@@ -687,7 +687,7 @@ int main ()
       return 1;
   }
   return 0;
-}], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no],
+}]])], [gl_cv_func_printf_directive_ls=yes], 
[gl_cv_func_printf_directive_ls=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -714,7 +714,7 @@ AC_DEFUN([gl_PRINTF_POSITIONS],
   AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with 
positions],
     [gl_cv_func_printf_positions],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 /* The string "%2$d %1$d", with dollar characters protected from the shell's
@@ -725,7 +725,7 @@ int main ()
 {
   sprintf (buf, format, 33, 55);
   return (strcmp (buf, "55 33") != 0);
-}], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
+}]])], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -751,7 +751,7 @@ AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
   AC_CACHE_CHECK([whether printf supports the grouping flag],
     [gl_cv_func_printf_flag_grouping],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -761,7 +761,7 @@ int main ()
       || buf[strlen (buf) - 1] != '9')
     return 1;
   return 0;
-}], [gl_cv_func_printf_flag_grouping=yes], 
[gl_cv_func_printf_flag_grouping=no],
+}]])], [gl_cv_func_printf_flag_grouping=yes], 
[gl_cv_func_printf_flag_grouping=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -787,7 +787,7 @@ AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
   AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
     [gl_cv_func_printf_flag_leftadjust],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -798,7 +798,7 @@ int main ()
       || strcmp (buf, "ab  c") != 0)
     return 1;
   return 0;
-}],
+}]])],
         [gl_cv_func_printf_flag_leftadjust=yes],
         [gl_cv_func_printf_flag_leftadjust=no],
         [
@@ -828,7 +828,7 @@ AC_DEFUN([gl_PRINTF_FLAG_ZERO],
   AC_CACHE_CHECK([whether printf supports the zero flag correctly],
     [gl_cv_func_printf_flag_zero],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -839,7 +839,7 @@ int main ()
           && strcmp (buf, "  infinity") != 0))
     return 1;
   return 0;
-}], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no],
+}]])], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -868,7 +868,7 @@ AC_DEFUN([gl_PRINTF_PRECISION],
   AC_CACHE_CHECK([whether printf supports large precisions],
     [gl_cv_func_printf_precision],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[5000];
@@ -881,7 +881,7 @@ int main ()
   if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
     return 1;
   return 0;
-}], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no],
+}]])], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -1031,7 +1031,7 @@ AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
   AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
     [gl_cv_func_snprintf_truncation_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -1042,7 +1042,7 @@ int main ()
   if (memcmp (buf, "45\0DEF", 6) != 0)
     return 1;
   return 0;
-}], [gl_cv_func_snprintf_truncation_c99=yes], 
[gl_cv_func_snprintf_truncation_c99=no],
+}]])], [gl_cv_func_snprintf_truncation_c99=yes], 
[gl_cv_func_snprintf_truncation_c99=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -1108,7 +1108,7 @@ AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
   AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
     [gl_cv_func_snprintf_retval_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -1118,7 +1118,7 @@ int main ()
   if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
     return 1;
   return 0;
-}], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no],
+}]])], [gl_cv_func_snprintf_retval_c99=yes], 
[gl_cv_func_snprintf_retval_c99=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -1165,7 +1165,7 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
   AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
     [gl_cv_func_snprintf_directive_n],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char fmtstring[10];
@@ -1181,7 +1181,7 @@ int main ()
   if (count != 6)
     return 1;
   return 0;
-}], [gl_cv_func_snprintf_directive_n=yes], 
[gl_cv_func_snprintf_directive_n=no],
+}]])], [gl_cv_func_snprintf_directive_n=yes], 
[gl_cv_func_snprintf_directive_n=no],
       [
 changequote(,)dnl
        case "$host_os" in
@@ -1229,14 +1229,14 @@ AC_DEFUN([gl_SNPRINTF_SIZE1],
   AC_CACHE_CHECK([whether snprintf respects a size of 1],
     [gl_cv_func_snprintf_size1],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdio.h>
 int main()
 {
   static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
   snprintf (buf, 1, "%d", 12345);
   return buf[1] != 'E';
-}],
+}]])],
       [gl_cv_func_snprintf_size1=yes],
       [gl_cv_func_snprintf_size1=no],
       [gl_cv_func_snprintf_size1="guessing yes"])
@@ -1286,7 +1286,7 @@ AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
   AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
     [gl_cv_func_vsnprintf_zerosize_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdarg.h>
 #include <stdio.h>
 static int my_snprintf (char *buf, int size, const char *format, ...)
@@ -1303,7 +1303,7 @@ int main()
   static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
   my_snprintf (buf, 0, "%d", 12345);
   return buf[0] != 'D';
-}],
+}]])],
       [gl_cv_func_vsnprintf_zerosize_c99=yes],
       [gl_cv_func_vsnprintf_zerosize_c99=no],
       [
diff --git a/m4/servent.m4 b/m4/servent.m4
index 242f9e3..81b32aa 100644
--- a/m4/servent.m4
+++ b/m4/servent.m4
@@ -1,5 +1,5 @@
-# servent.m4 serial 1
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# servent.m4 serial 2
+dnl Copyright (C) 2008, 2009 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.
@@ -30,12 +30,12 @@ AC_DEFUN([gl_SERVENT],
         [gl_cv_w32_getservbyname=no
          gl_save_LIBS="$LIBS"
          LIBS="$LIBS -lws2_32"
-         AC_TRY_LINK([
+         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
 #endif
 #include <stddef.h>
-], [getservbyname(NULL,NULL);], [gl_cv_w32_getservbyname=yes])
+]], [[getservbyname(NULL,NULL);]])], [gl_cv_w32_getservbyname=yes])
          LIBS="$gl_save_LIBS"
         ])
       if test "$gl_cv_w32_getservbyname" = "yes"; then
diff --git a/m4/setenv.m4 b/m4/setenv.m4
index e28407e..a22195d 100644
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,4 +1,4 @@
-# setenv.m4 serial 11
+# setenv.m4 serial 12
 dnl Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -36,7 +36,7 @@ AC_DEFUN([gl_FUNC_UNSETENV],
     gl_PREREQ_UNSETENV
   else
     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"
@@ -46,7 +46,7 @@ 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
       VOID_UNSETENV=1
     fi
diff --git a/m4/signbit.m4 b/m4/signbit.m4
index 233bf2a..a1e2f3f 100644
--- a/m4/signbit.m4
+++ b/m4/signbit.m4
@@ -1,4 +1,4 @@
-# signbit.m4 serial 6
+# signbit.m4 serial 7
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,7 @@ AC_DEFUN([gl_SIGNBIT],
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
   AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <math.h>
 /* If signbit is defined as a function, don't use it, since calling it for
    'float' or 'long double' arguments would involve conversions.
@@ -23,7 +23,7 @@ AC_DEFUN([gl_SIGNBIT],
 #endif
 #include <string.h>
 ]gl_SIGNBIT_TEST_PROGRAM
-, [gl_cv_func_signbit=yes], [gl_cv_func_signbit=no],
+])], [gl_cv_func_signbit=yes], [gl_cv_func_signbit=no],
         [gl_cv_func_signbit="guessing no"])
     ])
   dnl GCC 4.0 and newer provides three built-ins for signbit.
@@ -32,7 +32,7 @@ AC_DEFUN([gl_SIGNBIT],
   dnl libc.
   AC_CACHE_CHECK([for signbit compiler built-ins], [gl_cv_func_signbit_gcc],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #if __GNUC__ >= 4
 # define signbit(x) \
    (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
@@ -43,7 +43,7 @@ AC_DEFUN([gl_SIGNBIT],
 #endif
 #include <string.h>
 ]gl_SIGNBIT_TEST_PROGRAM
-, [gl_cv_func_signbit_gcc=yes], [gl_cv_func_signbit_gcc=no],
+])], [gl_cv_func_signbit_gcc=yes], [gl_cv_func_signbit_gcc=no],
         [gl_cv_func_signbit_gcc="guessing no"])
     ])
   dnl Use the compiler built-ins whenever possible, because they are more
@@ -67,9 +67,9 @@ AC_DEFUN([gl_SIGNBIT],
           AC_CACHE_CHECK([whether copysignf can be used without linking with 
libm],
             [gl_cv_func_copysignf_no_libm],
             [
-              AC_TRY_LINK([#include <math.h>
-                           float x, y;],
-                          [return copysignf (x, y) < 0;],
+              AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                                 float x, y;]],
+                                [[return copysignf (x, y) < 0;]])],
                 [gl_cv_func_copysignf_no_libm=yes],
                 [gl_cv_func_copysignf_no_libm=no])
             ])
@@ -87,9 +87,9 @@ AC_DEFUN([gl_SIGNBIT],
           AC_CACHE_CHECK([whether copysign can be used without linking with 
libm],
             [gl_cv_func_copysign_no_libm],
             [
-              AC_TRY_LINK([#include <math.h>
-                           double x, y;],
-                          [return copysign (x, y) < 0;],
+              AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                                 double x, y;]],
+                                [[return copysign (x, y) < 0;]])],
                 [gl_cv_func_copysign_no_libm=yes],
                 [gl_cv_func_copysign_no_libm=no])
             ])
@@ -107,9 +107,9 @@ AC_DEFUN([gl_SIGNBIT],
           AC_CACHE_CHECK([whether copysignl can be used without linking with 
libm],
             [gl_cv_func_copysignl_no_libm],
             [
-              AC_TRY_LINK([#include <math.h>
-                           long double x, y;],
-                          [return copysignl (x, y) < 0;],
+              AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>
+                                 long double x, y;]],
+                                [[return copysignl (x, y) < 0;]])],
                 [gl_cv_func_copysignl_no_libm=yes],
                 [gl_cv_func_copysignl_no_libm=no])
             ])
@@ -211,15 +211,15 @@ AC_DEFUN([gl_FLOATTYPE_SIGN_LOCATION],
   AC_CACHE_CHECK([where to find the sign bit in a '$1'],
     [$2],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stddef.h>
 #include <stdio.h>
 #define NWORDS \
-  ((sizeof ($1) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { $1 value; unsigned int word[NWORDS]; }
+  ((sizeof (]$1[) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { ]$1[ value; unsigned int word[NWORDS]; }
         memory_float;
-static memory_float plus = { 1.0$3 };
-static memory_float minus = { -1.0$3 };
+static memory_float plus = { 1.0]$3[ };
+static memory_float minus = { -1.0]$3[ };
 int main ()
 {
   size_t j, k, i;
@@ -264,7 +264,7 @@ int main ()
   fprintf (fp, "word %d bit %d", (int) k, (int) i);
   return (fclose (fp) != 0);
 }
-        ],
+          ]])],
         [$2=`cat conftest.out`],
         [$2="unknown"],
         [
diff --git a/m4/size_max.m4 b/m4/size_max.m4
index 35bd3d6..c7bb345 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-2009 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,10 @@ 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 4eaef93..95be99b 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 Free Software Foundation, Inc.
+# ssize_t.m4 serial 5 (gettext-0.15)
+dnl Copyright (C) 2001-2003, 2006, 2009 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,9 @@ 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 a9ada4f..fcff254 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-2009 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,11 +13,11 @@ 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])])
   AC_MSG_RESULT([$gl_cv_func_va_copy])
   if test $gl_cv_func_va_copy = no; then
@@ -47,11 +47,11 @@ 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])])
       if test $gl_cv_func___va_copy = yes; then
         AC_DEFINE([va_copy], [__va_copy],
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index 57c804a..ee1325e 100644
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -37,76 +37,76 @@ 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];
-         bool e = &s;
-         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 };
-         _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];
-         #if defined __xlc__ || defined __GNUC__
-          /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-             reported by James Lemley on 2005-10-05; see
-             
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-             This test is not quite right, since xlc is allowed to
-             reject this program, as the initializer for xlcbug is
-             not one of the forms that C requires support for.
-             However, doing the test right would require a run-time
-             test, and that would make cross-compilation harder.
-             Let us hope that IBM fixes the xlc bug, and also adds
-             support for this kind of constant expression.  In the
-             meantime, this test will reject xlc, which is OK, since
-             our stdbool.h substitute should suffice.  We also test
-             this with GCC, where it should work, to detect more
-             quickly whether someone messes up the test in the
-             future.  */
-          char digs[] = "0123456789";
-          int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-         #endif
-         /* 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;
-       ],
-       [
-         *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];
+            bool e = &s;
+            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 };
+            _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];
+            #if defined __xlc__ || defined __GNUC__
+             /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+                reported by James Lemley on 2005-10-05; see
+                
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+                This test is not quite right, since xlc is allowed to
+                reject this program, as the initializer for xlcbug is
+                not one of the forms that C requires support for.
+                However, doing the test right would require a run-time
+                test, and that would make cross-compilation harder.
+                Let us hope that IBM fixes the xlc bug, and also adds
+                support for this kind of constant expression.  In the
+                meantime, this test will reject xlc, which is OK, since
+                our stdbool.h substitute should suffice.  We also test
+                this with GCC, where it should work, to detect more
+                quickly whether someone messes up the test in the
+                future.  */
+             char digs[] = "0123456789";
+             int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : 
-1);
+            #endif
+            /* 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;
+          ]],
+          [[
+            *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 82f0c24..91120aa 100644
--- a/m4/stdint_h.m4
+++ b/m4/stdint_h.m4
@@ -12,10 +12,10 @@ 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;],
+  [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
diff --git a/m4/stpncpy.m4 b/m4/stpncpy.m4
index 75f5739..d010c13 100644
--- a/m4/stpncpy.m4
+++ b/m4/stpncpy.m4
@@ -1,4 +1,4 @@
-# stpncpy.m4 serial 10
+# stpncpy.m4 serial 11
 dnl Copyright (C) 2002-2003, 2005-2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,7 +25,7 @@ AC_DEFUN([gl_FUNC_STPNCPY],
   dnl Only the glibc return value is useful in practice.
 
   AC_CACHE_CHECK([for working stpncpy], [gl_cv_func_stpncpy], [
-    AC_TRY_RUN([
+    AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <stdlib.h>
 #include <string.h> /* for strcpy */
 /* The stpncpy prototype is missing in <string.h> on AIX 4.  */
@@ -44,7 +44,7 @@ int main () {
   if (stpncpy (dest, src, 7) != dest + 5) exit(1);
   exit(0);
 }
-], gl_cv_func_stpncpy=yes, gl_cv_func_stpncpy=no,
+]])], gl_cv_func_stpncpy=yes, gl_cv_func_stpncpy=no,
   [AC_EGREP_CPP([Thanks for using GNU], [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
index f67791e..71360bc 100644
--- a/m4/threadlib.m4
+++ b/m4/threadlib.m4
@@ -1,4 +1,4 @@
-# threadlib.m4 serial 4 (gettext-0.18)
+# threadlib.m4 serial 5 (gettext-0.18)
 dnl Copyright (C) 2005-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -80,7 +80,7 @@ changequote([,])dnl
         # groks <pthread.h>. cc also understands the flag -pthread, but
         # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
         # 2. putting a flag into CPPFLAGS that has an effect on the linker
-        # causes the AC_TRY_LINK test below to succeed unexpectedly,
+        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
         # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
         CPPFLAGS="$CPPFLAGS -D_REENTRANT"
         ;;
@@ -109,8 +109,8 @@ AC_DEFUN([gl_THREADLIB_BODY],
     dnl Check whether the compiler and linker support weak declarations.
     AC_MSG_CHECKING([whether imported symbols can be declared weak])
     gl_have_weak=no
-    AC_TRY_LINK([extern void xyzzy ();
-#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern void xyzzy ();
+#pragma weak xyzzy]], [[xyzzy();]])], [gl_have_weak=yes])
     AC_MSG_RESULT([$gl_have_weak])
     if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
       # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
@@ -125,9 +125,9 @@ AC_DEFUN([gl_THREADLIB_BODY],
         # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
         # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
         # the second one only in libpthread, and lock.c needs it.
-        AC_TRY_LINK([#include <pthread.h>],
-          [pthread_mutex_lock((pthread_mutex_t*)0);
-           pthread_mutexattr_init((pthread_mutexattr_t*)0);],
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
+            [[pthread_mutex_lock((pthread_mutex_t*)0);
+              pthread_mutexattr_init((pthread_mutexattr_t*)0);]])],
           [gl_have_pthread=yes])
         # Test for libpthread by looking for pthread_kill. (Not pthread_self,
         # since it is defined as a macro on OSF/1.)
@@ -180,9 +180,9 @@ AC_DEFUN([gl_THREADLIB_BODY],
         gl_have_solaristhread=
         gl_save_LIBS="$LIBS"
         LIBS="$LIBS -lthread"
-        AC_TRY_LINK([#include <thread.h>
-#include <synch.h>],
-          [thr_self();],
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <thread.h>
+#include <synch.h>]],
+            [[thr_self();]])],
           [gl_have_solaristhread=yes])
         LIBS="$gl_save_LIBS"
         if test -n "$gl_have_solaristhread"; then
@@ -208,7 +208,8 @@ AC_DEFUN([gl_THREADLIB_BODY],
       gl_have_pth=
       gl_save_LIBS="$LIBS"
       LIBS="$LIBS -lpth"
-      AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes])
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
+        [gl_have_pth=yes])
       LIBS="$gl_save_LIBS"
       if test -n "$gl_have_pth"; then
         gl_threads_api=pth
diff --git a/m4/trunc.m4 b/m4/trunc.m4
index feb9d27..d72bcab 100644
--- a/m4/trunc.m4
+++ b/m4/trunc.m4
@@ -1,5 +1,5 @@
-# trunc.m4 serial 2
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# trunc.m4 serial 3
+dnl Copyright (C) 2007, 2009 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.
@@ -14,24 +14,24 @@ AC_DEFUN([gl_FUNC_TRUNC],
   if test "$ac_cv_have_decl_trunc" = yes; then
     dnl Test whether trunc() can be used without libm.
     TRUNC_LIBM=?
-    AC_TRY_LINK([
-       #ifndef __NO_MATH_INLINES
-       # define __NO_MATH_INLINES 1 /* for glibc */
-       #endif
-       #include <math.h>
-       double x;],
-      [x = trunc(x);],
-      [TRUNC_LIBM=])
-    if test "$TRUNC_LIBM" = "?"; then
-      save_LIBS="$LIBS"
-      LIBS="$LIBS -lm"
-      AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
          #ifndef __NO_MATH_INLINES
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         double x;],
-        [x = trunc(x);],
+         double x;]],
+        [[x = trunc(x);]])],
+      [TRUNC_LIBM=])
+    if test "$TRUNC_LIBM" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+           #ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           double x;]],
+          [[x = trunc(x);]])],
         [TRUNC_LIBM="-lm"])
       LIBS="$save_LIBS"
     fi
diff --git a/m4/truncf.m4 b/m4/truncf.m4
index 7de15fe..24f97ae 100644
--- a/m4/truncf.m4
+++ b/m4/truncf.m4
@@ -1,5 +1,5 @@
-# truncf.m4 serial 1
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# truncf.m4 serial 2
+dnl Copyright (C) 2007, 2009 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.
@@ -14,24 +14,24 @@ AC_DEFUN([gl_FUNC_TRUNCF],
   if test "$ac_cv_have_decl_truncf" = yes; then
     dnl Test whether truncf() can be used without libm.
     TRUNCF_LIBM=?
-    AC_TRY_LINK([
-       #ifndef __NO_MATH_INLINES
-       # define __NO_MATH_INLINES 1 /* for glibc */
-       #endif
-       #include <math.h>
-       float x;],
-      [x = truncf(x);],
-      [TRUNCF_LIBM=])
-    if test "$TRUNCF_LIBM" = "?"; then
-      save_LIBS="$LIBS"
-      LIBS="$LIBS -lm"
-      AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
          #ifndef __NO_MATH_INLINES
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         float x;],
-        [x = truncf(x);],
+         float x;]],
+        [[x = truncf(x);]])],
+      [TRUNCF_LIBM=])
+    if test "$TRUNCF_LIBM" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+           #ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           float x;]],
+          [[x = truncf(x);]])],
         [TRUNCF_LIBM="-lm"])
       LIBS="$save_LIBS"
     fi
diff --git a/m4/truncl.m4 b/m4/truncl.m4
index ad03638..f228f44 100644
--- a/m4/truncl.m4
+++ b/m4/truncl.m4
@@ -1,5 +1,5 @@
-# truncl.m4 serial 2
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# truncl.m4 serial 3
+dnl Copyright (C) 2007-2009 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.
@@ -15,24 +15,24 @@ AC_DEFUN([gl_FUNC_TRUNCL],
   if test "$ac_cv_have_decl_truncl" = yes; then
     dnl Test whether truncl() can be used without libm.
     TRUNCL_LIBM=?
-    AC_TRY_LINK([
-       #ifndef __NO_MATH_INLINES
-       # define __NO_MATH_INLINES 1 /* for glibc */
-       #endif
-       #include <math.h>
-       long double x;],
-      [x = truncl(x);],
-      [TRUNCL_LIBM=])
-    if test "$TRUNCL_LIBM" = "?"; then
-      save_LIBS="$LIBS"
-      LIBS="$LIBS -lm"
-      AC_TRY_LINK([
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
          #ifndef __NO_MATH_INLINES
          # define __NO_MATH_INLINES 1 /* for glibc */
          #endif
          #include <math.h>
-         long double x;],
-        [x = truncl(x);],
+         long double x;]],
+        [[x = truncl(x);]])],
+      [TRUNCL_LIBM=])
+    if test "$TRUNCL_LIBM" = "?"; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS -lm"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+           #ifndef __NO_MATH_INLINES
+           # define __NO_MATH_INLINES 1 /* for glibc */
+           #endif
+           #include <math.h>
+           long double x;]],
+          [[x = truncl(x);]])],
         [TRUNCL_LIBM="-lm"])
       LIBS="$save_LIBS"
     fi
@@ -42,14 +42,14 @@ AC_DEFUN([gl_FUNC_TRUNCL],
     dnl Test whether truncl() works. It crashes on OSF/1 4.0d.
     AC_CACHE_CHECK([whether truncl works], [gl_cv_func_truncl_works],
       [
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <math.h>
 long double x;
 int main()
 {
   x = truncl (0.0L);
   return 0;
-}], [gl_cv_func_truncl_works=yes], [gl_cv_func_truncl_works=no],
+}]])], [gl_cv_func_truncl_works=yes], [gl_cv_func_truncl_works=no],
           [case "$host_os" in
              osf4*) gl_cv_func_truncl_works="guessing no";;
              *)     gl_cv_func_truncl_works="guessing yes";;
diff --git a/m4/visibility.m4 b/m4/visibility.m4
index 70bca56..f8bd05a 100644
--- a/m4/visibility.m4
+++ b/m4/visibility.m4
@@ -1,5 +1,5 @@
-# visibility.m4 serial 2 (gettext-0.18)
-dnl Copyright (C) 2005, 2008 Free Software Foundation, Inc.
+# visibility.m4 serial 3 (gettext-0.18)
+dnl Copyright (C) 2005, 2008, 2009 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.
@@ -30,12 +30,12 @@ AC_DEFUN([gl_VISIBILITY],
     AC_CACHE_VAL([gl_cv_cc_visibility], [
       gl_save_CFLAGS="$CFLAGS"
       CFLAGS="$CFLAGS -fvisibility=hidden"
-      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);],
-        [],
+      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);]],
+          [])],
         [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 fb27a7f..c85cb78 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)
 dnl Copyright (C) 2002-2003, 2008, 2009 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,8 +11,8 @@ 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';], ,
+    [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.])
diff --git a/m4/wcrtomb.m4 b/m4/wcrtomb.m4
index cb7d926..4394157 100644
--- a/m4/wcrtomb.m4
+++ b/m4/wcrtomb.m4
@@ -1,4 +1,4 @@
-# wcrtomb.m4 serial 4
+# wcrtomb.m4 serial 5
 dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -40,7 +40,7 @@ changequote(,)dnl
         esac
 changequote([,])dnl
         if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test 
$LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
-          AC_TRY_RUN([
+          AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <stdio.h>
 #include <string.h>
@@ -68,7 +68,7 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
             [gl_cv_func_wcrtomb_retval=yes],
             [gl_cv_func_wcrtomb_retval=no],
             [:])
diff --git a/m4/wcsrtombs.m4 b/m4/wcsrtombs.m4
index 6a64928..97356f5 100644
--- a/m4/wcsrtombs.m4
+++ b/m4/wcsrtombs.m4
@@ -1,4 +1,4 @@
-# wcsrtombs.m4 serial 4
+# wcsrtombs.m4 serial 5
 dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -67,7 +67,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_FR != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <stdlib.h>
 #include <wchar.h>
@@ -88,7 +88,7 @@ int main ()
         }
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_wcsrtombs_termination=yes],
           [gl_cv_func_wcsrtombs_termination=no],
           [:])
@@ -121,7 +121,7 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_FR != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <stdlib.h>
 #include <wchar.h>
@@ -141,7 +141,7 @@ int main ()
         }
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_wcsrtombs_null=yes],
           [gl_cv_func_wcsrtombs_null=no],
           [:])
diff --git a/m4/wctob.m4 b/m4/wctob.m4
index 39270c9..5cd0403 100644
--- a/m4/wctob.m4
+++ b/m4/wctob.m4
@@ -1,4 +1,4 @@
-# wctob.m4 serial 4
+# wctob.m4 serial 5
 dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ changequote(,)dnl
         esac
 changequote([,])dnl
         if test $LOCALE_FR != none; then
-          AC_TRY_RUN([
+          AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
 #include <wchar.h>
@@ -50,7 +50,7 @@ int main ()
           return 1;
     }
   return 0;
-}],
+}]])],
             [gl_cv_func_wctob_works=yes],
             [gl_cv_func_wctob_works=no],
             [:])
diff --git a/m4/wcwidth.m4 b/m4/wcwidth.m4
index 9cacb56..7b7a73c 100644
--- a/m4/wcwidth.m4
+++ b/m4/wcwidth.m4
@@ -1,4 +1,4 @@
-# wcwidth.m4 serial 15
+# wcwidth.m4 serial 16
 dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -43,7 +43,7 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
     AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales],
       [gl_cv_func_wcwidth_works],
       [
-        AC_TRY_RUN([
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <locale.h>
 /* AIX 3.2.5 declares wcwidth in <string.h>. */
 #include <string.h>
@@ -68,7 +68,7 @@ int main ()
     if (wcwidth (0x0301) > 0 || wcwidth (0x200B) > 0)
       return 1;
   return 0;
-}], [gl_cv_func_wcwidth_works=yes], [gl_cv_func_wcwidth_works=no],
+}]])], [gl_cv_func_wcwidth_works=yes], [gl_cv_func_wcwidth_works=no],
           [
 changequote(,)dnl
            case "$host_os" in
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
index 47a4363..2cac985 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)
 dnl Copyright (C) 2003, 2007-2009 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,7 @@ 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,7 +20,7 @@ AC_DEFUN([gt_TYPE_WINT_T],
 #include <stdio.h>
 #include <time.h>
 #include <wchar.h>
-       wint_t foo = (wchar_t)'\0';], ,
+         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.])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]