From 64865499c9cf8748356a0857a8481d74b394bd79 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 20 Jul 2010 01:06:56 +0200 Subject: [PATCH] Modernize AC_TRY_RUN invocations. --- ChangeLog | 44 ++++ m4/btowc.m4 | 12 +- m4/duplocale.m4 | 9 +- m4/exponentd.m4 | 9 +- m4/exponentf.m4 | 9 +- m4/exponentl.m4 | 7 +- m4/fopen.m4 | 7 +- m4/frexp.m4 | 17 +- m4/frexpl.m4 | 23 +- m4/ftello.m4 | 7 +- m4/iconv.m4 | 9 +- m4/iconv_open.m4 | 9 +- m4/intdiv0.m4 | 11 +- m4/isnanf.m4 | 7 +- m4/isnanl.m4 | 29 ++- m4/ldexpl.m4 | 21 +- m4/mbrlen.m4 | 15 +- m4/mbrtowc.m4 | 28 +- m4/mbsrtowcs.m4 | 7 +- m4/open.m4 | 7 +- m4/printf-posix.m4 | 21 +- m4/printf.m4 | 730 ++++++++++++++++++++++++++++------------------------- m4/signbit.m4 | 19 +- m4/stpncpy.m4 | 7 +- m4/threadlib.m4 | 7 +- m4/truncl.m4 | 7 +- m4/ttyname_r.m4 | 10 +- m4/wcrtomb.m4 | 7 +- m4/wcsrtombs.m4 | 12 +- m4/wctob.m4 | 15 +- m4/wcwidth.m4 | 7 +- 31 files changed, 653 insertions(+), 476 deletions(-) diff --git a/ChangeLog b/ChangeLog index 321c4eae3..5b729040d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,49 @@ 2010-08-26 Bruno Haible + Modernize AC_TRY_RUN invocations. + * m4/btowc.m4 (gl_FUNC_BTOWC): Use AC_RUN_IFELSE instead of AC_TRY_RUN. + * m4/duplocale.m4 (gl_FUNC_DUPLOCALE): 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/fopen.m4 (gl_FUNC_FOPEN): Likewise. + * m4/frexp.m4 (gl_FUNC_FREXP_WORKS): Likewise. + * m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Likewise. + * m4/ftello.m4 (gl_FUNC_FTELLO): Likewise. + * m4/iconv.m4 (AM_ICONV_LINK): Likewise. + * m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN_UTF): Likewise. + * m4/intdiv0.m4 (gt_INTDIV0): Likewise. + * m4/isnanf.m4 (gl_ISNANF_WORKS): Likewise. + * m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Likewise. + * m4/ldexpl.m4 (gl_FUNC_LDEXPL_WORKS): Likewise. + * m4/mbrlen.m4 (gl_MBRLEN_INCOMPLETE_STATE, gl_MBRLEN_RETVAL, + gl_MBRLEN_NUL_RETVAL): Likewise. + * m4/mbrtowc.m4 (gl_MBRTOWC_INCOMPLETE_STATE, gl_MBRTOWC_SANITYCHECK, + gl_MBRTOWC_NULL_ARG, gl_MBRTOWC_RETVAL, gl_MBRTOWC_NUL_RETVAL): + Likewise. + * m4/mbsrtowcs.m4 (gl_MBSRTOWCS_WORKS): Likewise. + * m4/open.m4 (gl_FUNC_OPEN): Likewise. + * m4/printf.m4 (gl_PRINTF_SIZES_C99, gl_PRINTF_LONG_DOUBLE, + 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/printf-posix.m4 (gt_PRINTF_POSIX): Likewise. + * m4/signbit.m4 (gl_SIGNBIT, gl_FLOATTYPE_SIGN_LOCATION): Likewise. + * m4/stpncpy.m4 (gl_FUNC_STPNCPY): Likewise. + * m4/threadlib.m4 (gl_THREADLIB_BODY): Likewise. + * m4/truncl.m4 (gl_FUNC_TRUNCL): Likewise. + * m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Likewise. + * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise. + * m4/wcsrtombs.m4 (gl_WCSRTOMBS_TERMINATION): Likewise. + * m4/wctob.m4 (gl_FUNC_WCTOB): Likewise. + * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise. + +2010-08-26 Bruno Haible + Modernize AC_TRY_LINK invocations. * m4/acosl.m4 (gl_FUNC_ACOSL): Use AC_LINK_IFELSE instead of AC_TRY_LINK. diff --git a/m4/btowc.m4 b/m4/btowc.m4 index c4ee4e419..b16b1f020 100644 --- a/m4/btowc.m4 +++ b/m4/btowc.m4 @@ -1,4 +1,4 @@ -# btowc.m4 serial 6 +# btowc.m4 serial 7 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,7 +26,8 @@ AC_DEFUN([gl_FUNC_BTOWC], AC_CACHE_CHECK([whether btowc(0) is correct], [gl_cv_func_btowc_nul], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -35,7 +36,7 @@ int main () if (btowc ('\0') != 0) return 1; return 0; -}], +}]])], [gl_cv_func_btowc_nul=yes], [gl_cv_func_btowc_nul=no], [ @@ -65,7 +66,8 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_FR != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -78,7 +80,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_btowc_eof=yes], [gl_cv_func_btowc_eof=no], [:]) diff --git a/m4/duplocale.m4 b/m4/duplocale.m4 index e7e784e69..4fc613757 100644 --- a/m4/duplocale.m4 +++ b/m4/duplocale.m4 @@ -1,4 +1,4 @@ -# duplocale.m4 serial 3 +# duplocale.m4 serial 4 dnl Copyright (C) 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -17,7 +17,8 @@ AC_DEFUN([gl_FUNC_DUPLOCALE], AC_REQUIRE([gl_LOCALE_H]) AC_CACHE_CHECK([whether duplocale(LC_GLOBAL_LOCALE) works], [gl_cv_func_duplocale_works], - [AC_TRY_RUN([ + [AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #if HAVE_XLOCALE_H # include @@ -27,7 +28,9 @@ int main () if (duplocale (LC_GLOBAL_LOCALE) == (locale_t)0) return 1; return 0; -}], [gl_cv_func_duplocale_works=yes], [gl_cv_func_duplocale_works=no], +}]])], + [gl_cv_func_duplocale_works=yes], + [gl_cv_func_duplocale_works=no], [dnl Guess it works except on glibc < 2.12 and AIX. case "$host_os" in aix*) gl_cv_func_duplocale_works="guessing no";; diff --git a/m4/exponentd.m4 b/m4/exponentd.m4 index 5d44d0e02..ad26ddf82 100644 --- a/m4/exponentd.m4 +++ b/m4/exponentd.m4 @@ -1,5 +1,5 @@ -# exponentd.m4 serial 1 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# exponentd.m4 serial 2 +dnl Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,7 +8,8 @@ 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 #include #include @@ -71,7 +72,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 4d8063fae..34cf1979c 100644 --- a/m4/exponentf.m4 +++ b/m4/exponentf.m4 @@ -1,5 +1,5 @@ -# exponentf.m4 serial 1 -dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. +# exponentf.m4 serial 2 +dnl Copyright (C) 2007-2008, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,7 +8,8 @@ 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 #include #include @@ -72,7 +73,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 a700d3ba6..b625fea05 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-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,7 +9,8 @@ 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 #include #include @@ -74,7 +75,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/fopen.m4 b/m4/fopen.m4 index 757d4a155..11e0f9a94 100644 --- a/m4/fopen.m4 +++ b/m4/fopen.m4 @@ -21,13 +21,16 @@ 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 #include 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 291348bf6..530fdbcee 100644 --- a/m4/frexp.m4 +++ b/m4/frexp.m4 @@ -99,7 +99,8 @@ 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 #include #include @@ -139,11 +140,13 @@ int main() return 1; } return 0; -}], [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";; - esac - ]) +}]])], + [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";; + esac + ]) ]) ]) diff --git a/m4/frexpl.m4 b/m4/frexpl.m4 index f2e254c77..633f056cd 100644 --- a/m4/frexpl.m4 +++ b/m4/frexpl.m4 @@ -1,4 +1,4 @@ -# frexpl.m4 serial 11 +# frexpl.m4 serial 12 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -112,7 +112,8 @@ 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 #include /* Override the values of , like done in float.in.h. */ @@ -182,15 +183,17 @@ 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], + [ changequote(,)dnl - case "$host_os" in - aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) - gl_cv_func_frexpl_works="guessing no";; - *) gl_cv_func_frexpl_works="guessing yes";; - esac + case "$host_os" in + aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) + gl_cv_func_frexpl_works="guessing no";; + *) gl_cv_func_frexpl_works="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) diff --git a/m4/ftello.m4 b/m4/ftello.m4 index 38bcf437e..33201a010 100644 --- a/m4/ftello.m4 +++ b/m4/ftello.m4 @@ -47,7 +47,8 @@ changequote(,)dnl *) gl_cv_func_ftello_works="guessing yes" ;; esac changequote([,])dnl - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -104,7 +105,9 @@ main (void) /* The file's contents is now "foogarsh!". */ return 0; -}], [gl_cv_func_ftello_works=yes], [gl_cv_func_ftello_works=no], [:]) +}]])], + [gl_cv_func_ftello_works=yes], + [gl_cv_func_ftello_works=no], [:]) ]) case "$gl_cv_func_ftello_works" in *yes) ;; diff --git a/m4/iconv.m4 b/m4/iconv.m4 index b7f5bfe8b..5e838b04b 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,4 +1,4 @@ -# iconv.m4 serial 11c +# iconv.m4 serial 14 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -72,7 +72,8 @@ 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 #include int main () @@ -165,7 +166,9 @@ 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], [ changequote(,)dnl case "$host_os" in diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4 index 60f62ca51..8219ecf5c 100644 --- a/m4/iconv_open.m4 +++ b/m4/iconv_open.m4 @@ -1,4 +1,4 @@ -# iconv_open.m4 serial 7 +# iconv_open.m4 serial 8 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -63,7 +63,8 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF], [ save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -209,7 +210,9 @@ 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 289c4df5e..9b27ff1b7 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-2010 Free Software Foundation, Inc. +# intdiv0.m4 serial 4 (gettext-0.18.2) +dnl Copyright (C) 2002, 2007-2008, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -29,7 +29,8 @@ changequote(,)dnl esac changequote([,])dnl if test -z "$gt_cv_int_divbyzero_sigfpe"; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include @@ -61,7 +62,9 @@ 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/isnanf.m4 b/m4/isnanf.m4 index 1fce2eec5..c040090be 100644 --- a/m4/isnanf.m4 +++ b/m4/isnanf.m4 @@ -124,7 +124,8 @@ 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 #if __GNUC__ >= 4 # undef isnanf @@ -173,7 +174,9 @@ 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 ad003abb5..de7eafb04 100644 --- a/m4/isnanl.m4 +++ b/m4/isnanl.m4 @@ -122,7 +122,8 @@ 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 #include #include @@ -233,17 +234,19 @@ int main () #endif return 0; -}], [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";; - *) - case "$host_os" in - netbsd*) gl_cv_func_isnanl_works="guessing no";; - *) gl_cv_func_isnanl_works="guessing yes";; - esac - ;; - esac - ]) +}]])], + [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";; + *) + case "$host_os" in + netbsd*) gl_cv_func_isnanl_works="guessing no";; + *) gl_cv_func_isnanl_works="guessing yes";; + esac + ;; + esac + ]) ]) ]) diff --git a/m4/ldexpl.m4 b/m4/ldexpl.m4 index aaa4eb5a6..0a4fe88b0 100644 --- a/m4/ldexpl.m4 +++ b/m4/ldexpl.m4 @@ -1,4 +1,4 @@ -# ldexpl.m4 serial 7 +# ldexpl.m4 serial 8 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -81,7 +81,8 @@ 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 extern long double ldexpl (long double, int); int main() @@ -91,14 +92,16 @@ 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], + [ changequote(,)dnl - case "$host_os" in - aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";; - *) gl_cv_func_ldexpl_works="guessing yes";; - esac + case "$host_os" in + aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";; + *) gl_cv_func_ldexpl_works="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) diff --git a/m4/mbrlen.m4 b/m4/mbrlen.m4 index 81fc671da..731c2b318 100644 --- a/m4/mbrlen.m4 +++ b/m4/mbrlen.m4 @@ -52,7 +52,8 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_JA != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -69,7 +70,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_mbrlen_incomplete_state=yes], [gl_cv_func_mbrlen_incomplete_state=no], []) @@ -102,7 +103,8 @@ 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 #include #include @@ -137,7 +139,7 @@ int main () } } return 0; -}], +}]])], [gl_cv_func_mbrlen_retval=yes], [gl_cv_func_mbrlen_retval=no], []) @@ -167,7 +169,8 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -183,7 +186,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 0f5939be1..28b9c43bf 100644 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -108,7 +108,8 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_JA != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -126,7 +127,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_mbrtowc_incomplete_state=yes], [gl_cv_func_mbrtowc_incomplete_state=no], [:]) @@ -156,7 +157,8 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -178,7 +180,7 @@ int main () return 1; } return 0; -}], +}]])], [gl_cv_func_mbrtowc_sanitycheck=yes], [gl_cv_func_mbrtowc_sanitycheck=no], [:]) @@ -208,7 +210,8 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_FR_UTF8 != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -228,7 +231,10 @@ 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 ]) ]) @@ -258,7 +264,8 @@ 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 #include #include @@ -295,7 +302,7 @@ int main () } } return 0; -}], +}]])], [gl_cv_func_mbrtowc_retval=yes], [gl_cv_func_mbrtowc_retval=no], [:]) @@ -325,7 +332,8 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_ZH_CN != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -342,7 +350,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 f9c430f01..e854337ff 100644 --- a/m4/mbsrtowcs.m4 +++ b/m4/mbsrtowcs.m4 @@ -1,4 +1,4 @@ -# mbsrtowcs.m4 serial 6 +# mbsrtowcs.m4 serial 7 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,8 @@ 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 #include #include @@ -108,7 +109,7 @@ int main () } } return 0; -}], +}]])], [gl_cv_func_mbsrtowcs_works=yes], [gl_cv_func_mbsrtowcs_works=no], [:]) diff --git a/m4/open.m4 b/m4/open.m4 index 8731a2555..d402da994 100644 --- a/m4/open.m4 +++ b/m4/open.m4 @@ -22,7 +22,8 @@ AC_DEFUN([gl_FUNC_OPEN], touch conftest.tmp ln -s conftest.tmp conftest.lnk fi - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #if HAVE_UNISTD_H # include @@ -33,7 +34,9 @@ int main () if (open ("conftest.lnk/", O_RDONLY) != -1) return 2; #endif 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-posix.m4 b/m4/printf-posix.m4 index 1eacf95ac..2dc52a486 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.2) dnl Copyright (C) 2003, 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,8 @@ 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 #include /* The string "%2$d %1$d", with dollar characters protected from the shell's @@ -25,16 +26,18 @@ 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, - [ - AC_EGREP_CPP([notposix], [ +}]])], + [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__ notposix #endif - ], - [gt_cv_func_printf_posix="guessing no"], - [gt_cv_func_printf_posix="guessing yes"]) - ]) + ], + [gt_cv_func_printf_posix="guessing no"], + [gt_cv_func_printf_posix="guessing yes"]) + ]) ]) case $gt_cv_func_printf_posix in *yes) diff --git a/m4/printf.m4 b/m4/printf.m4 index 33f5aefb1..e850862c0 100644 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -17,7 +17,8 @@ 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 #include #include @@ -50,34 +51,36 @@ 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 - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; - darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on OpenBSD >= 3.9. - openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) - gl_cv_func_printf_sizes_c99="guessing no";; - openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on Solaris >= 2.10. - solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";; - solaris*) gl_cv_func_printf_sizes_c99="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_printf_sizes_c99="guessing no";; - netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_sizes_c99="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_printf_sizes_c99="guessing no";; + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";; + solaris*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_sizes_c99="guessing no";; + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_sizes_c99="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -92,7 +95,8 @@ 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 #include static char buf[10000]; @@ -111,16 +115,18 @@ 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 - beos*) gl_cv_func_printf_long_double="guessing no";; - mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; - *) gl_cv_func_printf_long_double="guessing yes";; - esac + case "$host_os" in + beos*) gl_cv_func_printf_long_double="guessing no";; + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";; + *) gl_cv_func_printf_long_double="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -136,7 +142,8 @@ 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 #include static int @@ -201,32 +208,34 @@ 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 - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; - darwin*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on HP-UX >= 11. - hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; - hpux*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_printf_infinite="guessing no";; - netbsd*) gl_cv_func_printf_infinite="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_printf_infinite="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_infinite="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; + darwin*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; + hpux*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite="guessing no";; + netbsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_infinite="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -252,7 +261,8 @@ 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 #include @@ -414,38 +424,38 @@ int main () } #endif return 0; -}], - [gl_cv_func_printf_infinite_long_double=yes], - [gl_cv_func_printf_infinite_long_double=no], - [ +}]])], + [gl_cv_func_printf_infinite_long_double=yes], + [gl_cv_func_printf_infinite_long_double=no], + [ changequote(,)dnl - case "$host_cpu" in - # Guess no on ia64, x86_64, i386. - ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; - *) - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";; - darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on HP-UX >= 11. - hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; - hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_printf_infinite_long_double="guessing no";; - netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_infinite_long_double="guessing no";; - esac - ;; - esac + case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; + *) + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";; + darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite_long_double="guessing no";; + netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_infinite_long_double="guessing no";; + esac + ;; + esac changequote([,])dnl - ]) + ]) ]) ;; *) @@ -466,7 +476,8 @@ 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 #include static char buf[100]; @@ -512,26 +523,28 @@ 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], - [ - case "$host_os" in - # Guess yes on glibc >= 2.5 systems. - *-gnu*) - AC_EGREP_CPP([BZ2908], [ - #include - #ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2) - BZ2908 - #endif - #endif - ], - [gl_cv_func_printf_directive_a="guessing yes"], - [gl_cv_func_printf_directive_a="guessing no"]) - ;; - # If we don't know, assume the worst. - *) gl_cv_func_printf_directive_a="guessing no";; - esac - ]) +}]])], + [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. + *-gnu*) + AC_EGREP_CPP([BZ2908], [ + #include + #ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2) + BZ2908 + #endif + #endif + ], + [gl_cv_func_printf_directive_a="guessing yes"], + [gl_cv_func_printf_directive_a="guessing no"]) + ;; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_a="guessing no";; + esac + ]) ]) ]) @@ -546,7 +559,8 @@ 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 #include static char buf[100]; @@ -563,26 +577,28 @@ 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 - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; - # Guess yes on FreeBSD >= 6. - freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; - darwin*) gl_cv_func_printf_directive_f="guessing yes";; - # Guess yes on Solaris >= 2.10. - solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";; - solaris*) gl_cv_func_printf_directive_f="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_directive_f="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; + darwin*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";; + solaris*) gl_cv_func_printf_directive_f="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_directive_f="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -597,7 +613,8 @@ 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 #include static char fmtstring[10]; @@ -614,14 +631,16 @@ 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 - *) gl_cv_func_printf_directive_n="guessing yes";; - esac + case "$host_os" in + *) gl_cv_func_printf_directive_n="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -639,7 +658,8 @@ 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: must be included before . BSD/OS 4.0.1 has a bug: , and must be @@ -687,19 +707,21 @@ 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 - openbsd*) gl_cv_func_printf_directive_ls="guessing no";; - irix*) gl_cv_func_printf_directive_ls="guessing no";; - solaris*) gl_cv_func_printf_directive_ls="guessing no";; - cygwin*) gl_cv_func_printf_directive_ls="guessing no";; - beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; - *) gl_cv_func_printf_directive_ls="guessing yes";; - esac + case "$host_os" in + openbsd*) gl_cv_func_printf_directive_ls="guessing no";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -714,7 +736,8 @@ 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 #include /* The string "%2$d %1$d", with dollar characters protected from the shell's @@ -725,18 +748,20 @@ 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 - netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) - gl_cv_func_printf_positions="guessing no";; - beos*) gl_cv_func_printf_positions="guessing no";; - mingw* | pw*) gl_cv_func_printf_positions="guessing no";; - *) gl_cv_func_printf_positions="guessing yes";; - esac + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -751,7 +776,8 @@ 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 #include static char buf[100]; @@ -761,17 +787,19 @@ 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 - cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; - netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; - mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; - *) gl_cv_func_printf_flag_grouping="guessing yes";; - esac + case "$host_os" in + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -787,7 +815,8 @@ 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 #include static char buf[100]; @@ -798,7 +827,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 +857,8 @@ 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 #include static char buf[100]; @@ -839,19 +869,21 @@ 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 - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_printf_flag_zero="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_printf_flag_zero="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_printf_flag_zero="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -868,7 +900,8 @@ 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 #include static char buf[5000]; @@ -881,17 +914,19 @@ 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 - # Guess no only on native Win32 and BeOS systems. - mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; - beos*) gl_cv_func_printf_precision="guessing no" ;; - *) gl_cv_func_printf_precision="guessing yes" ;; - esac + case "$host_os" in + # Guess no only on native Win32 and BeOS systems. + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + *) gl_cv_func_printf_precision="guessing yes" ;; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -1031,7 +1066,8 @@ 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 #include static char buf[100]; @@ -1042,47 +1078,49 @@ 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 - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; - darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on OpenBSD >= 3.9. - openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) - gl_cv_func_snprintf_truncation_c99="guessing no";; - openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on Solaris >= 2.6. - solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";; - solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on AIX >= 4. - aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; - aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on HP-UX >= 11. - hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; - hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on OSF/1 >= 5. - osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; - osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_snprintf_truncation_c99="guessing no";; - netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_snprintf_truncation_c99="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_truncation_c99="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -1108,7 +1146,8 @@ AC_DEFUN_ONCE([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 #include static char buf[100]; @@ -1118,39 +1157,41 @@ 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 - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; - darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on OpenBSD >= 3.9. - openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) - gl_cv_func_snprintf_retval_c99="guessing no";; - openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on Solaris >= 2.6. - solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";; - solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on AIX >= 4. - aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; - aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_snprintf_retval_c99="guessing no";; - netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_snprintf_retval_c99="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";; + solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_retval_c99="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -1165,7 +1206,8 @@ 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 #include static char fmtstring[10]; @@ -1181,40 +1223,42 @@ 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 - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; - darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on Solaris >= 2.6. - solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";; - solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on AIX >= 4. - aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; - aix*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on OSF/1 >= 5. - osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; - osf*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_snprintf_directive_n="guessing no";; - netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_snprintf_directive_n="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_snprintf_directive_n="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; + darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";; + solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; + aix*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + osf*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_directive_n="guessing no";; + netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_directive_n="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_snprintf_directive_n="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) @@ -1229,17 +1273,18 @@ 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 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"]) +}]])], + [gl_cv_func_snprintf_size1=yes], + [gl_cv_func_snprintf_size1=no], + [gl_cv_func_snprintf_size1="guessing yes"]) ]) ]) @@ -1286,7 +1331,8 @@ 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 #include static int my_snprintf (char *buf, int size, const char *format, ...) @@ -1303,43 +1349,43 @@ 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], - [ +}]])], + [gl_cv_func_vsnprintf_zerosize_c99=yes], + [gl_cv_func_vsnprintf_zerosize_c99=no], + [ changequote(,)dnl - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on FreeBSD >= 5. - freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on MacOS X >= 10.3. - darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on Cygwin. - cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on Solaris >= 2.6. - solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on AIX >= 4. - aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on NetBSD >= 3. - netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on mingw. - mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - esac + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on MacOS X >= 10.3. + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on mingw. + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + esac changequote([,])dnl - ]) + ]) ]) ]) diff --git a/m4/signbit.m4 b/m4/signbit.m4 index b86f453d3..175125394 100644 --- a/m4/signbit.m4 +++ b/m4/signbit.m4 @@ -9,7 +9,8 @@ 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 /* 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 +24,9 @@ AC_DEFUN([gl_SIGNBIT], #endif #include ]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 +35,8 @@ 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 +47,9 @@ AC_DEFUN([gl_SIGNBIT], #endif #include ]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 @@ -217,7 +223,8 @@ 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 #include #define NWORDS \ @@ -270,7 +277,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/stpncpy.m4 b/m4/stpncpy.m4 index 158cc087d..701a82d98 100644 --- a/m4/stpncpy.m4 +++ b/m4/stpncpy.m4 @@ -29,7 +29,8 @@ AC_DEFUN([gl_FUNC_STPNCPY], AC_CHECK_FUNCS_ONCE([stpncpy]) if test $ac_cv_func_stpncpy = yes; then AC_CACHE_CHECK([for working stpncpy], [gl_cv_func_stpncpy], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include /* for strcpy */ /* The stpncpy prototype is missing in on AIX 4. */ @@ -50,7 +51,9 @@ 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 #ifdef __GNU_LIBRARY__ diff --git a/m4/threadlib.m4 b/m4/threadlib.m4 index 01ee9ddb1..bff01bc5e 100644 --- a/m4/threadlib.m4 +++ b/m4/threadlib.m4 @@ -120,13 +120,16 @@ AC_DEFUN([gl_THREADLIB_BODY], if test $gl_cv_have_weak = maybe; then dnl Second, test whether it actually works. On Cygwin 1.7.2, with dnl gcc 4.3, symbols declared weak always evaluate to the address 0. - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #pragma weak fputs int main () { return (fputs == NULL); -}], [gl_cv_have_weak=yes], [gl_cv_have_weak=no], +}]])], + [gl_cv_have_weak=yes], + [gl_cv_have_weak=no], [dnl When cross-compiling, assume that only ELF platforms support dnl weak symbols. AC_EGREP_CPP([Extensible Linking Format], diff --git a/m4/truncl.m4 b/m4/truncl.m4 index a2a0695b5..583ca1359 100644 --- a/m4/truncl.m4 +++ b/m4/truncl.m4 @@ -46,14 +46,17 @@ AC_DEFUN([gl_FUNC_TRUNCL], LIBS="$LIBS $TRUNCL_LIBM" AC_CACHE_CHECK([whether truncl works], [gl_cv_func_truncl_works], [ - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include 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/ttyname_r.m4 b/m4/ttyname_r.m4 index c41d8ba81..dc221ed14 100644 --- a/m4/ttyname_r.m4 +++ b/m4/ttyname_r.m4 @@ -1,4 +1,4 @@ -# ttyname_r.m4 serial 3 +# ttyname_r.m4 serial 4 dnl Copyright (C) 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -51,7 +51,8 @@ changequote(,)dnl *) gl_cv_func_ttyname_r_works="guessing yes" ;; esac changequote([,])dnl - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include int @@ -66,7 +67,10 @@ main (void) if (ttyname_r (fd, buf, sizeof (buf)) != 0) return 1; return 0; -}], [gl_cv_func_ttyname_r_works=yes], [:], [:]) +}]])], + [gl_cv_func_ttyname_r_works=yes], + [:], + [:]) ]) case "$gl_cv_func_ttyname_r_works" in *yes) ;; diff --git a/m4/wcrtomb.m4 b/m4/wcrtomb.m4 index 6a2d772a3..0de262e61 100644 --- a/m4/wcrtomb.m4 +++ b/m4/wcrtomb.m4 @@ -1,4 +1,4 @@ -# wcrtomb.m4 serial 5 +# wcrtomb.m4 serial 6 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -40,7 +40,8 @@ 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 #include #include @@ -68,7 +69,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 fb769f2d6..f340a0570 100644 --- a/m4/wcsrtombs.m4 +++ b/m4/wcsrtombs.m4 @@ -1,4 +1,4 @@ -# wcsrtombs.m4 serial 5 +# wcsrtombs.m4 serial 6 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -68,7 +68,8 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_FR != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -89,7 +90,7 @@ int main () } } return 0; -}], +}]])], [gl_cv_func_wcsrtombs_termination=yes], [gl_cv_func_wcsrtombs_termination=no], [:]) @@ -122,7 +123,8 @@ changequote(,)dnl esac changequote([,])dnl if test $LOCALE_FR != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -142,7 +144,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 3af3cc7bc..59e947a28 100644 --- a/m4/wctob.m4 +++ b/m4/wctob.m4 @@ -1,4 +1,4 @@ -# wctob.m4 serial 5 +# wctob.m4 serial 6 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -38,7 +38,8 @@ changequote(,)dnl changequote([,])dnl case "$host_os" in cygwin*) - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include @@ -54,11 +55,15 @@ int main () if (global != 0x12345678) return 2; return 0; -}], [:], [gl_cv_func_wctob_works=no], [:]) +}]])], + [:], + [gl_cv_func_wctob_works=no], + [:]) ;; esac if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then - AC_TRY_RUN([ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #include #include @@ -73,7 +78,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 ad5c6cc8e..ac357f372 100644 --- a/m4/wcwidth.m4 +++ b/m4/wcwidth.m4 @@ -41,7 +41,8 @@ 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 /* AIX 3.2.5 declares wcwidth in . */ #include @@ -66,7 +67,9 @@ 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 -- 2.11.0