From ec062d7a2671739dd977ebde3965fc93f8678a2e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 19 Jul 2010 23:30:26 +0200 Subject: [PATCH] Modernize AC_TRY_LINK invocations. --- ChangeLog | 48 +++++++++++++++++++++++++++++++++++++++++++++++ m4/acosl.m4 | 30 ++++++++++++++++------------- m4/argp.m4 | 28 +++++++++++++-------------- m4/asinl.m4 | 30 ++++++++++++++++------------- m4/atanl.m4 | 30 ++++++++++++++++------------- m4/ceil.m4 | 32 ++++++++++++++++--------------- m4/ceilf.m4 | 32 ++++++++++++++++--------------- m4/ceill.m4 | 32 ++++++++++++++++--------------- m4/codeset.m4 | 12 +++++++----- m4/cosl.m4 | 30 ++++++++++++++++------------- m4/expl.m4 | 30 ++++++++++++++++------------- m4/floor.m4 | 32 ++++++++++++++++--------------- m4/floorf.m4 | 32 ++++++++++++++++--------------- m4/floorl.m4 | 32 ++++++++++++++++--------------- m4/frexp.m4 | 18 +++++++++++------- m4/frexpl.m4 | 16 ++++++++++------ m4/ftello.m4 | 10 +++++++--- m4/gettext.m4 | 52 ++++++++++++++++++++++++++++++++++----------------- m4/hostent.m4 | 12 ++++++++---- m4/iconv.m4 | 30 ++++++++++++++++++----------- m4/intl.m4 | 7 ++++--- m4/intlmacosx.m4 | 13 +++++++++---- m4/isnand.m4 | 46 ++++++++++++++++++++++++--------------------- m4/isnanf.m4 | 46 ++++++++++++++++++++++++--------------------- m4/isnanl.m4 | 46 ++++++++++++++++++++++++--------------------- m4/lcmessage.m4 | 10 +++++++--- m4/ldexpl.m4 | 16 ++++++++++------ m4/lib-link.m4 | 5 +++-- m4/logb.m4 | 36 ++++++++++++++++++----------------- m4/logl.m4 | 30 ++++++++++++++++------------- m4/printf-frexp.m4 | 12 +++++++----- m4/servent.m4 | 12 ++++++++---- m4/signbit.m4 | 26 ++++++++++++++++---------- m4/sinl.m4 | 30 ++++++++++++++++------------- m4/sqrtl.m4 | 30 ++++++++++++++++------------- m4/tanl.m4 | 30 ++++++++++++++++------------- m4/threadlib.m4 | 34 ++++++++++++++++++++++----------- m4/trunc.m4 | 32 ++++++++++++++++--------------- m4/truncf.m4 | 32 ++++++++++++++++--------------- m4/truncl.m4 | 30 +++++++++++++++-------------- modules/tsearch-tests | 17 ++++++++++------- 41 files changed, 655 insertions(+), 453 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e97ef50e..321c4eae3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,53 @@ 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. + * m4/argp.m4 (gl_ARGP): Likewise. + * m4/asinl.m4 (gl_FUNC_ASINL): Likewise. + * m4/atanl.m4 (gl_FUNC_ATANL): 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/cosl.m4 (gl_FUNC_COSL): Likewise. + * m4/expl.m4 (gl_FUNC_EXPL): 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/frexp.m4 (gl_FUNC_FREXP, gl_CHECK_FREXP_NO_LIBM): Likewise. + * m4/frexpl.m4 (gl_FUNC_FREXPL, gl_CHECK_FREXPL_NO_LIBM): 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): Likewise. + * m4/intl.m4 (gt_INTL_SUBDIR_CORE): Likewise. + * m4/intlmacosx.m4 (gt_INTL_MACOSX): 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. + * m4/isnanl.m4 (gl_HAVE_ISNANL_NO_LIBM, gl_HAVE_ISNANL_IN_LIBM): + Likewise. + * m4/lcmessage.m4 (gt_LC_MESSAGES): Likewise. + * m4/ldexpl.m4 (gl_FUNC_LDEXPL, gl_CHECK_LDEXPL_NO_LIBM): Likewise. + * m4/lib-link.m4 (AC_LIB_HAVE_LINKFLAGS): Likewise. + * m4/logb.m4 (gl_FUNC_LOGB): Likewise. + * m4/logl.m4 (gl_FUNC_LOGL): Likewise. + * m4/printf-frexp.m4 (gl_FUNC_PRINTF_FREXP): Likewise. + * m4/servent.m4 (gl_SERVENT): Likewise. + * m4/signbit.m4 (gl_SIGNBIT): Likewise. + * m4/sinl.m4 (gl_FUNC_SINL): Likewise. + * m4/sqrtl.m4 (gl_FUNC_SQRTL): Likewise. + * m4/tanl.m4 (gl_FUNC_TANL): Likewise. + * m4/threadlib.m4 (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. + * modules/tsearch-tests (configure.ac): Likewise. + +2010-08-26 Bruno Haible + Modernize AC_TRY_COMPILE invocations. * m4/environ.m4 (gt_CHECK_VAR_DECL): Use AC_COMPILE_IFELSE instead of AC_TRY_COMPILE. diff --git a/m4/acosl.m4 b/m4/acosl.m4 index 66cbd6cd9..1f6b5b79b 100644 --- a/m4/acosl.m4 +++ b/m4/acosl.m4 @@ -1,4 +1,4 @@ -# acosl.m4 serial 2 +# acosl.m4 serial 3 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, @@ -14,12 +14,14 @@ AC_DEFUN([gl_FUNC_ACOSL], AC_CACHE_CHECK([whether acosl() can be used without linking with libm], [gl_cv_func_acosl_no_libm], [ - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return acosl (x) > 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return acosl (x) > 1;]])], [gl_cv_func_acosl_no_libm=yes], [gl_cv_func_acosl_no_libm=no]) ]) @@ -29,12 +31,14 @@ AC_DEFUN([gl_FUNC_ACOSL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return acosl (x) > 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return acosl (x) > 1;]])], [gl_cv_func_acosl_in_libm=yes], [gl_cv_func_acosl_in_libm=no]) LIBS="$save_LIBS" diff --git a/m4/argp.m4 b/m4/argp.m4 index 819425bbb..d3ca5bacc 100644 --- a/m4/argp.m4 +++ b/m4/argp.m4 @@ -1,5 +1,5 @@ -# argp.m4 serial 10 -dnl Copyright (C) 2003-2007, 2009-2010 Free Software Foundation, Inc. +# argp.m4 serial 11 +dnl Copyright (C) 2003-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. @@ -32,20 +32,20 @@ AC_DEFUN([gl_ARGP], # be defined and other not, I prefer to stay on the safe side and to # test each one separately. AC_MSG_CHECKING([whether program_invocation_name is defined]) - AC_TRY_LINK([#include ], - [ program_invocation_name = "test"; ], - [ AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1], - [Define if program_invocation_name is defined]) - AC_MSG_RESULT([yes])], - [ AC_MSG_RESULT([no])] ) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[program_invocation_name = "test";]])], + [AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1], + [Define if program_invocation_name is defined]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([whether program_invocation_short_name is defined]) - AC_TRY_LINK([#include ], - [ program_invocation_short_name = "test"; ], - [ AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1], - [Define if program_invocation_short_name is defined]) - AC_MSG_RESULT([yes])], - [ AC_MSG_RESULT([no])] ) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[program_invocation_short_name = "test";]])], + [AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1], + [Define if program_invocation_short_name is defined]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) AC_CHECK_DECLS_ONCE([clearerr_unlocked]) AC_CHECK_DECLS_ONCE([feof_unlocked]) diff --git a/m4/asinl.m4 b/m4/asinl.m4 index 1f5bc6df4..1cb272c5d 100644 --- a/m4/asinl.m4 +++ b/m4/asinl.m4 @@ -1,4 +1,4 @@ -# asinl.m4 serial 2 +# asinl.m4 serial 3 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, @@ -14,12 +14,14 @@ AC_DEFUN([gl_FUNC_ASINL], AC_CACHE_CHECK([whether asinl() can be used without linking with libm], [gl_cv_func_asinl_no_libm], [ - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return asinl (x) > 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return asinl (x) > 1;]])], [gl_cv_func_asinl_no_libm=yes], [gl_cv_func_asinl_no_libm=no]) ]) @@ -29,12 +31,14 @@ AC_DEFUN([gl_FUNC_ASINL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return asinl (x) > 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return asinl (x) > 1;]])], [gl_cv_func_asinl_in_libm=yes], [gl_cv_func_asinl_in_libm=no]) LIBS="$save_LIBS" diff --git a/m4/atanl.m4 b/m4/atanl.m4 index 28cf7b3a8..3573a3cd8 100644 --- a/m4/atanl.m4 +++ b/m4/atanl.m4 @@ -1,4 +1,4 @@ -# atanl.m4 serial 2 +# atanl.m4 serial 3 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, @@ -14,12 +14,14 @@ AC_DEFUN([gl_FUNC_ATANL], AC_CACHE_CHECK([whether atanl() can be used without linking with libm], [gl_cv_func_atanl_no_libm], [ - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return atanl (x) > 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return atanl (x) > 1;]])], [gl_cv_func_atanl_no_libm=yes], [gl_cv_func_atanl_no_libm=no]) ]) @@ -29,12 +31,14 @@ AC_DEFUN([gl_FUNC_ATANL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return atanl (x) > 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return atanl (x) > 1;]])], [gl_cv_func_atanl_in_libm=yes], [gl_cv_func_atanl_in_libm=no]) LIBS="$save_LIBS" diff --git a/m4/ceil.m4 b/m4/ceil.m4 index 5981f39c9..306e6c751 100644 --- a/m4/ceil.m4 +++ b/m4/ceil.m4 @@ -1,4 +1,4 @@ -# ceil.m4 serial 3 +# ceil.m4 serial 4 dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -20,24 +20,26 @@ 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 - double x;], - [x = ceil(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - double x;], - [x = ceil(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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 b48fedb68..a33b9aa7e 100644 --- a/m4/ceilf.m4 +++ b/m4/ceilf.m4 @@ -1,4 +1,4 @@ -# ceilf.m4 serial 6 +# ceilf.m4 serial 7 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,24 +35,26 @@ 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 - float x;], - [x = ceilf(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - float x;], - [x = ceilf(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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 3d4612ae5..49aa37697 100644 --- a/m4/ceill.m4 +++ b/m4/ceill.m4 @@ -1,4 +1,4 @@ -# ceill.m4 serial 6 +# ceill.m4 serial 7 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,24 +35,26 @@ 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 - long double x;], - [x = ceill(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [x = ceill(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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 a53c04260..f722b2e86 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.2) dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,10 +9,12 @@ 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 ], - [char* cs = nl_langinfo(CODESET); return !cs;], - [am_cv_langinfo_codeset=yes], - [am_cv_langinfo_codeset=no]) + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[char* cs = nl_langinfo(CODESET); return !cs;]])], + [am_cv_langinfo_codeset=yes], + [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE([HAVE_LANGINFO_CODESET], [1], diff --git a/m4/cosl.m4 b/m4/cosl.m4 index 74c9e7c6d..69f3fbef7 100644 --- a/m4/cosl.m4 +++ b/m4/cosl.m4 @@ -1,4 +1,4 @@ -# cosl.m4 serial 2 +# cosl.m4 serial 3 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, @@ -14,12 +14,14 @@ AC_DEFUN([gl_FUNC_COSL], AC_CACHE_CHECK([whether cosl() can be used without linking with libm], [gl_cv_func_cosl_no_libm], [ - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return cosl (x) > 0.4;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return cosl (x) > 0.4;]])], [gl_cv_func_cosl_no_libm=yes], [gl_cv_func_cosl_no_libm=no]) ]) @@ -29,12 +31,14 @@ AC_DEFUN([gl_FUNC_COSL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return cosl (x) > 0.4;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return cosl (x) > 0.4;]])], [gl_cv_func_cosl_in_libm=yes], [gl_cv_func_cosl_in_libm=no]) LIBS="$save_LIBS" diff --git a/m4/expl.m4 b/m4/expl.m4 index 698a9fb8a..ba1143ee3 100644 --- a/m4/expl.m4 +++ b/m4/expl.m4 @@ -1,4 +1,4 @@ -# expl.m4 serial 1 +# expl.m4 serial 2 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, @@ -14,12 +14,14 @@ AC_DEFUN([gl_FUNC_EXPL], AC_CACHE_CHECK([whether expl() can be used without linking with libm], [gl_cv_func_expl_no_libm], [ - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return expl (x) > 1.5;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return expl (x) > 1.5;]])], [gl_cv_func_expl_no_libm=yes], [gl_cv_func_expl_no_libm=no]) ]) @@ -29,12 +31,14 @@ AC_DEFUN([gl_FUNC_EXPL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return expl (x) > 1.5;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return expl (x) > 1.5;]])], [gl_cv_func_expl_in_libm=yes], [gl_cv_func_expl_in_libm=no]) LIBS="$save_LIBS" diff --git a/m4/floor.m4 b/m4/floor.m4 index ad6a1e49f..754133582 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, 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, @@ -20,24 +20,26 @@ 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 - double x;], - [x = floor(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - double x;], - [x = floor(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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 fb17a5ea1..96c9b3bdc 100644 --- a/m4/floorf.m4 +++ b/m4/floorf.m4 @@ -1,4 +1,4 @@ -# floorf.m4 serial 6 +# floorf.m4 serial 7 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,24 +35,26 @@ 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 - float x;], - [x = floorf(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - float x;], - [x = floorf(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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 9790b9681..5bd62d0bf 100644 --- a/m4/floorl.m4 +++ b/m4/floorl.m4 @@ -1,4 +1,4 @@ -# floorl.m4 serial 6 +# floorl.m4 serial 7 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,24 +35,26 @@ 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 - long double x;], - [x = floorl(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + 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([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [x = floorl(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[x = floorl(x);]])], [gl_cv_func_floorl_libm="-lm"]) LIBS="$save_LIBS" fi diff --git a/m4/frexp.m4 b/m4/frexp.m4 index 1f6d5427b..291348bf6 100644 --- a/m4/frexp.m4 +++ b/m4/frexp.m4 @@ -1,4 +1,4 @@ -# frexp.m4 serial 8 +# frexp.m4 serial 9 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, @@ -15,9 +15,11 @@ AC_DEFUN([gl_FUNC_FREXP], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include - double x;], - [int e; return frexp (x, &e) > 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + 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" @@ -78,9 +80,11 @@ AC_DEFUN([gl_CHECK_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 - double x;], - [int e; return frexp (x, &e) > 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + double x;]], + [[int e; return frexp (x, &e) > 0;]])], [gl_cv_func_frexp_no_libm=yes], [gl_cv_func_frexp_no_libm=no]) ]) diff --git a/m4/frexpl.m4 b/m4/frexpl.m4 index 513c12fdb..f2e254c77 100644 --- a/m4/frexpl.m4 +++ b/m4/frexpl.m4 @@ -19,9 +19,11 @@ AC_DEFUN([gl_FUNC_FREXPL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include - long double x;], - [int e; return frexpl (x, &e) > 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + 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" @@ -90,9 +92,11 @@ AC_DEFUN([gl_CHECK_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 - long double x;], - [int e; return frexpl (x, &e) > 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + long double x;]], + [[int e; return frexpl (x, &e) > 0;]])], [gl_cv_func_frexpl_no_libm=yes], [gl_cv_func_frexpl_no_libm=no]) ]) diff --git a/m4/ftello.m4 b/m4/ftello.m4 index ae9a4e613..38bcf437e 100644 --- a/m4/ftello.m4 +++ b/m4/ftello.m4 @@ -1,4 +1,4 @@ -# ftello.m4 serial 7 +# ftello.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, @@ -15,8 +15,12 @@ AC_DEFUN([gl_FUNC_FTELLO], AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello], [ - AC_TRY_LINK([#include ], [ftello (stdin);], - [gl_cv_func_ftello=yes], [gl_cv_func_ftello=no]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ftello (stdin);]])], + [gl_cv_func_ftello=yes], + [gl_cv_func_ftello=no]) ]) if test $gl_cv_func_ftello = no; then HAVE_FTELLO=0 diff --git a/m4/gettext.m4 b/m4/gettext.m4 index f84e6a5d7..979c52c19 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -1,4 +1,4 @@ -# gettext.m4 serial 63 (gettext-0.18) +# gettext.m4 serial 64 (gettext-0.18.2) dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -157,12 +157,18 @@ changequote([,])dnl fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], - [AC_TRY_LINK([#include + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $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"])]) @@ -183,35 +189,47 @@ 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 + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $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 + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include $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 ("")], - [LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - eval "$gt_func_gnugettext_libintl=yes" - ]) +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" + ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) diff --git a/m4/hostent.m4 b/m4/hostent.m4 index 111104112..7104b3089 100644 --- a/m4/hostent.m4 +++ b/m4/hostent.m4 @@ -1,5 +1,5 @@ -# hostent.m4 serial 1 -dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +# hostent.m4 serial 2 +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, dnl with or without modifications, as long as this notice is preserved. @@ -28,12 +28,16 @@ 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 #endif #include -], [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 081b370ea..b7f5bfe8b 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -30,27 +30,35 @@ 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 -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[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 -#include ], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[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" diff --git a/m4/intl.m4 b/m4/intl.m4 index c918e5717..9767d1629 100644 --- a/m4/intl.m4 +++ b/m4/intl.m4 @@ -220,9 +220,10 @@ 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.])]) diff --git a/m4/intlmacosx.m4 b/m4/intlmacosx.m4 index dd9102596..f0f7c9872 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.2) dnl Copyright (C) 2004-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -22,8 +22,10 @@ AC_DEFUN([gt_INTL_MACOSX], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" - AC_TRY_LINK([#include ], - [CFPreferencesCopyAppValue(NULL, NULL)], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) @@ -35,7 +37,10 @@ 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 ], [CFLocaleCopyCurrent();], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFLocaleCopyCurrent();]])], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) diff --git a/m4/isnand.m4 b/m4/isnand.m4 index cd916284d..31764f72d 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-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, @@ -58,16 +58,18 @@ AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include - #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 + #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 +81,18 @@ 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 - #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 + #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 1509fb443..1fce2eec5 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-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, @@ -71,16 +71,18 @@ 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 - #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 + #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 +96,18 @@ AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include - #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 + #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" diff --git a/m4/isnanl.m4 b/m4/isnanl.m4 index 25daecaed..ad003abb5 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-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, @@ -67,16 +67,18 @@ 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 - #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 + #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 +92,18 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include - #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 + #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" diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4 index 1a705431a..232da73b6 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.2) dnl Copyright (C) 1995-2002, 2004-2005, 2008-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -22,8 +22,12 @@ dnl Ulrich Drepper , 1995. AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES], - [AC_TRY_LINK([#include ], [return LC_MESSAGES], - [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])]) + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[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], [Define if your file defines LC_MESSAGES.]) diff --git a/m4/ldexpl.m4 b/m4/ldexpl.m4 index 84f097718..aaa4eb5a6 100644 --- a/m4/ldexpl.m4 +++ b/m4/ldexpl.m4 @@ -19,9 +19,11 @@ AC_DEFUN([gl_FUNC_LDEXPL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include - long double x;], - [return ldexpl (x, -1) > 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + 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" @@ -61,9 +63,11 @@ AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM], AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm], [gl_cv_func_ldexpl_no_libm], [ - AC_TRY_LINK([#include - long double x;], - [return ldexpl (x, -1) > 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + long double x;]], + [[return ldexpl (x, -1) > 0;]])], [gl_cv_func_ldexpl_no_libm=yes], [gl_cv_func_ldexpl_no_libm=no]) ]) diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 index 9f3be3a2f..2ea9d6d07 100644 --- a/m4/lib-link.m4 +++ b/m4/lib-link.m4 @@ -1,4 +1,4 @@ -# lib-link.m4 serial 24 (gettext-0.18.2) +# lib-link.m4 serial 25 (gettext-0.18.2) dnl Copyright (C) 2001-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, @@ -85,7 +85,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *) LIBS="$LIB[]NAME $LIBS" ;; esac - 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/logb.m4 b/m4/logb.m4 index c5b680323..4dadd179b 100644 --- a/m4/logb.m4 +++ b/m4/logb.m4 @@ -1,4 +1,4 @@ -# logb.m4 serial 1 +# logb.m4 serial 2 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, @@ -14,26 +14,28 @@ AC_DEFUN([gl_FUNC_LOGB], fi dnl Test whether logb() can be used without libm. LOGB_LIBM=? - AC_TRY_LINK([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - extern double logb (double x); - double x;], - [x = logb(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + extern double logb (double x); + double x;]], + [[x = logb(x);]])], [LOGB_LIBM=]) if test "$LOGB_LIBM" = "?"; then save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - extern double logb (double x); - double x;], - [x = logb(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + extern double logb (double x); + double x;]], + [[x = logb(x);]])], [LOGB_LIBM="-lm"]) LIBS="$save_LIBS" fi diff --git a/m4/logl.m4 b/m4/logl.m4 index eab591e2e..d951cdd87 100644 --- a/m4/logl.m4 +++ b/m4/logl.m4 @@ -1,4 +1,4 @@ -# logl.m4 serial 2 +# logl.m4 serial 3 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, @@ -14,12 +14,14 @@ AC_DEFUN([gl_FUNC_LOGL], AC_CACHE_CHECK([whether logl() can be used without linking with libm], [gl_cv_func_logl_no_libm], [ - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return logl (x) > 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return logl (x) > 1;]])], [gl_cv_func_logl_no_libm=yes], [gl_cv_func_logl_no_libm=no]) ]) @@ -29,12 +31,14 @@ AC_DEFUN([gl_FUNC_LOGL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return logl (x) > 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return logl (x) > 1;]])], [gl_cv_func_logl_in_libm=yes], [gl_cv_func_logl_in_libm=no]) LIBS="$save_LIBS" diff --git a/m4/printf-frexp.m4 b/m4/printf-frexp.m4 index 009ee261f..eb3c2dbc1 100644 --- a/m4/printf-frexp.m4 +++ b/m4/printf-frexp.m4 @@ -1,4 +1,4 @@ -# printf-frexp.m4 serial 4 +# printf-frexp.m4 serial 5 dnl Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -22,10 +22,12 @@ 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 - double x; - int y;], - [return ldexp (x, y) < 1;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + 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/servent.m4 b/m4/servent.m4 index 2ed961a43..2486511aa 100644 --- a/m4/servent.m4 +++ b/m4/servent.m4 @@ -1,5 +1,5 @@ -# servent.m4 serial 1 -dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +# servent.m4 serial 2 +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, dnl with or without modifications, as long as this notice is preserved. @@ -30,12 +30,16 @@ 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 #endif #include -], [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/signbit.m4 b/m4/signbit.m4 index 56ff825f9..b86f453d3 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-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, @@ -67,9 +67,11 @@ 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 - float x, y;], - [return copysignf (x, y) < 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + float x, y;]], + [[return copysignf (x, y) < 0;]])], [gl_cv_func_copysignf_no_libm=yes], [gl_cv_func_copysignf_no_libm=no]) ]) @@ -87,9 +89,11 @@ 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 - double x, y;], - [return copysign (x, y) < 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + double x, y;]], + [[return copysign (x, y) < 0;]])], [gl_cv_func_copysign_no_libm=yes], [gl_cv_func_copysign_no_libm=no]) ]) @@ -107,9 +111,11 @@ 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 - long double x, y;], - [return copysignl (x, y) < 0;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + long double x, y;]], + [[return copysignl (x, y) < 0;]])], [gl_cv_func_copysignl_no_libm=yes], [gl_cv_func_copysignl_no_libm=no]) ]) diff --git a/m4/sinl.m4 b/m4/sinl.m4 index c9c0e5c48..d77230a3f 100644 --- a/m4/sinl.m4 +++ b/m4/sinl.m4 @@ -1,4 +1,4 @@ -# sinl.m4 serial 2 +# sinl.m4 serial 3 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, @@ -14,12 +14,14 @@ AC_DEFUN([gl_FUNC_SINL], AC_CACHE_CHECK([whether sinl() can be used without linking with libm], [gl_cv_func_sinl_no_libm], [ - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return sinl (x) > 0.4;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return sinl (x) > 0.4;]])], [gl_cv_func_sinl_no_libm=yes], [gl_cv_func_sinl_no_libm=no]) ]) @@ -29,12 +31,14 @@ AC_DEFUN([gl_FUNC_SINL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return sinl (x) > 0.4;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return sinl (x) > 0.4;]])], [gl_cv_func_sinl_in_libm=yes], [gl_cv_func_sinl_in_libm=no]) LIBS="$save_LIBS" diff --git a/m4/sqrtl.m4 b/m4/sqrtl.m4 index 21b1c6835..53c260015 100644 --- a/m4/sqrtl.m4 +++ b/m4/sqrtl.m4 @@ -1,4 +1,4 @@ -# sqrtl.m4 serial 2 +# sqrtl.m4 serial 3 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, @@ -14,12 +14,14 @@ AC_DEFUN([gl_FUNC_SQRTL], AC_CACHE_CHECK([whether sqrtl() can be used without linking with libm], [gl_cv_func_sqrtl_no_libm], [ - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return sqrtl (x) > 0.4;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return sqrtl (x) > 0.4;]])], [gl_cv_func_sqrtl_no_libm=yes], [gl_cv_func_sqrtl_no_libm=no]) ]) @@ -29,12 +31,14 @@ AC_DEFUN([gl_FUNC_SQRTL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return sqrtl (x) > 0.4;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return sqrtl (x) > 0.4;]])], [gl_cv_func_sqrtl_in_libm=yes], [gl_cv_func_sqrtl_in_libm=no]) LIBS="$save_LIBS" diff --git a/m4/tanl.m4 b/m4/tanl.m4 index 0e785057f..0af27f733 100644 --- a/m4/tanl.m4 +++ b/m4/tanl.m4 @@ -1,4 +1,4 @@ -# tanl.m4 serial 2 +# tanl.m4 serial 3 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, @@ -14,12 +14,14 @@ AC_DEFUN([gl_FUNC_TANL], AC_CACHE_CHECK([whether tanl() can be used without linking with libm], [gl_cv_func_tanl_no_libm], [ - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return tanl (x) > 0.4;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return tanl (x) > 0.4;]])], [gl_cv_func_tanl_no_libm=yes], [gl_cv_func_tanl_no_libm=no]) ]) @@ -29,12 +31,14 @@ AC_DEFUN([gl_FUNC_TANL], [ save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [return tanl (x) > 0.4;], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[return tanl (x) > 0.4;]])], [gl_cv_func_tanl_in_libm=yes], [gl_cv_func_tanl_in_libm=no]) LIBS="$save_LIBS" diff --git a/m4/threadlib.m4 b/m4/threadlib.m4 index 05cc4ffab..01ee9ddb1 100644 --- a/m4/threadlib.m4 +++ b/m4/threadlib.m4 @@ -1,4 +1,4 @@ -# threadlib.m4 serial 5 (gettext-0.18) +# threadlib.m4 serial 6 (gettext-0.18.2) dnl Copyright (C) 2005-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -80,7 +80,7 @@ changequote([,])dnl # groks . 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" ;; @@ -111,8 +111,12 @@ AC_DEFUN([gl_THREADLIB_BODY], [gl_cv_have_weak], [gl_cv_have_weak=no dnl First, test whether the compiler accepts it syntactically. - AC_TRY_LINK([extern void xyzzy (); -#pragma weak xyzzy], [xyzzy();], [gl_cv_have_weak=maybe]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[extern void xyzzy (); +#pragma weak xyzzy]], + [[xyzzy();]])], + [gl_cv_have_weak=maybe]) 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. @@ -148,9 +152,11 @@ int main () # 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_mutex_lock((pthread_mutex_t*)0); - pthread_mutexattr_init((pthread_mutexattr_t*)0);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[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.) @@ -203,9 +209,13 @@ int main () gl_have_solaristhread= gl_save_LIBS="$LIBS" LIBS="$LIBS -lthread" - AC_TRY_LINK([#include -#include ], - [thr_self();], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[thr_self();]])], [gl_have_solaristhread=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then @@ -231,7 +241,9 @@ int main () gl_have_pth= gl_save_LIBS="$LIBS" LIBS="$LIBS -lpth" - AC_TRY_LINK([#include ], [pth_self();], [gl_have_pth=yes]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include ]], [[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 d0e81b95d..0654d9cd2 100644 --- a/m4/trunc.m4 +++ b/m4/trunc.m4 @@ -1,4 +1,4 @@ -# trunc.m4 serial 3 +# trunc.m4 serial 4 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, @@ -14,24 +14,26 @@ 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 - double x;], - [x = trunc(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x;]], + [[x = trunc(x);]])], [TRUNC_LIBM=]) if test "$TRUNC_LIBM" = "?"; then save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - double x;], - [x = trunc(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x;]], + [[x = trunc(x);]])], [TRUNC_LIBM="-lm"]) LIBS="$save_LIBS" fi diff --git a/m4/truncf.m4 b/m4/truncf.m4 index 1a22b4b23..0b7c49ab2 100644 --- a/m4/truncf.m4 +++ b/m4/truncf.m4 @@ -1,4 +1,4 @@ -# truncf.m4 serial 2 +# truncf.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, @@ -14,24 +14,26 @@ 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 - float x;], - [x = truncf(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + float x;]], + [[x = truncf(x);]])], [TRUNCF_LIBM=]) if test "$TRUNCF_LIBM" = "?"; then save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - float x;], - [x = truncf(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + float x;]], + [[x = truncf(x);]])], [TRUNCF_LIBM="-lm"]) LIBS="$save_LIBS" fi diff --git a/m4/truncl.m4 b/m4/truncl.m4 index 49f006520..a2a0695b5 100644 --- a/m4/truncl.m4 +++ b/m4/truncl.m4 @@ -15,24 +15,26 @@ 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 - long double x;], - [x = truncl(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[x = truncl(x);]])], [TRUNCL_LIBM=]) if test "$TRUNCL_LIBM" = "?"; then save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double x;], - [x = truncl(x);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[x = truncl(x);]])], [TRUNCL_LIBM="-lm"]) LIBS="$save_LIBS" fi diff --git a/modules/tsearch-tests b/modules/tsearch-tests index 0c4de8b7c..ca3264926 100644 --- a/modules/tsearch-tests +++ b/modules/tsearch-tests @@ -8,13 +8,16 @@ stdint configure.ac: TEST_TSEARCH_LIBM= -AC_TRY_LINK([ - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - double x;], - [x = log (x);], , [TEST_TSEARCH_LIBM=-lm]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x;]], + [[x = log (x);]])], + [], + [TEST_TSEARCH_LIBM=-lm]) AC_SUBST([TEST_TSEARCH_LIBM]) AC_CHECK_FUNCS_ONCE([initstate]) -- 2.11.0