Commit 64865499 authored by Bruno Haible's avatar Bruno Haible

Modernize AC_TRY_RUN invocations.

parent ec062d7a
2010-08-26 Bruno Haible <bruno@clisp.org>
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 <bruno@clisp.org>
Modernize AC_TRY_LINK invocations.
# 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 <stdio.h>
#include <string.h>
#include <wchar.h>
......@@ -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 <locale.h>
#include <stdio.h>
#include <string.h>
......@@ -78,7 +80,7 @@ int main ()
return 1;
}
return 0;
}],
}]])],
[gl_cv_func_btowc_eof=yes],
[gl_cv_func_btowc_eof=no],
[:])
......
# 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 <locale.h>
#if HAVE_XLOCALE_H
# include <xlocale.h>
......@@ -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";;
......
# 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 <float.h>
#include <stddef.h>
#include <stdio.h>
......@@ -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"],
[
......
# 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 <float.h>
#include <stddef.h>
#include <stdio.h>
......@@ -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"])
......
# 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 <float.h>
#include <stddef.h>
#include <stdio.h>
......@@ -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"],
[
......
......@@ -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 <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
......
......@@ -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 <float.h>
#include <math.h>
#include <string.h>
......@@ -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
])
])
])
# 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 <float.h>
#include <math.h>
/* Override the values of <float.h>, 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
])
])
])
])
......@@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -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) ;;
......
# 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 <iconv.h>
#include <string.h>
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
......
# 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 <iconv.h>
#include <errno.h>
#include <stdio.h>
......@@ -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"
......
# 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 <stdlib.h>
#include <signal.h>
......@@ -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
......
......@@ -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 <math.h>
#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";;
......
......@@ -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 <float.h>
#include <limits.h>
#include <math.h>
......@@ -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
])
])
])
# 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 <math.h>
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
])
])
])
])
......@@ -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 <locale.h>
#include <string.h>
#include <wchar.h>
......@@ -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 <locale.h>
#include <string.h>
#include <wchar.h>
......@@ -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 <locale.h>
#include <string.h>
#include <wchar.h>
......@@ -183,7 +186,7 @@ int main ()
return 1;
}
return 0;
}],
}]])],
[gl_cv_func_mbrlen_nul_retval=yes],
[gl_cv_func_mbrlen_nul_retval=no],
[])
......
......@@ -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 <locale.h>
#include <string.h>
#include <wchar.h>
......@@ -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 <locale.h>
#include <stdlib.h>
#include <string.h>
......@@ -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 <locale.h>
#include <string.h>
#include <wchar.h>
......@@ -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 <locale.h>
#include <string.h>
#include <wchar.h>
......@@ -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 <locale.h>
#include <string.h>
#include <wchar.h>
......@@ -342,7 +350,7 @@ int main ()
return 1;
}
return 0;
}],
}]])],
[gl_cv_func_mbrtowc_nul_retval=yes],
[gl_cv_func_mbrtowc_nul_retval=no],
[:])
......
# 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 <locale.h>
#include <string.h>
#include <wchar.h>
......@@ -108,7 +109,7 @@ int main ()
}
}
return 0;
}],
}]])],
[gl_cv_func_mbsrtowcs_works=yes],
[gl_cv_func_mbsrtowcs_works=no],
[:])
......
......@@ -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 <fcntl.h>
#if HAVE_UNISTD_H
# include <unistd.h>
......@@ -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
......
# 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 <stdio.h>
#include <string.h>
/* 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)
......
This diff is collapsed.
......@@ -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 <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 +24,9 @@ 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 +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 <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
......@@ -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 <stddef.h>
#include <stdio.h>
#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"],
[
......
......@@ -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 <stdlib.h>
#include <string.h> /* for strcpy */
/* The stpncpy prototype is missing in <string.h> 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 <features.h>
#ifdef __GNU_LIBRARY__
......
......@@ -120,13 +120,16 @@ AC_DEFUN([gl_THREADLIB_BODY],
if test $gl_cv_have_weak = maybe; then