diff options
author | Bruno Haible <bruno@clisp.org> | 2010-07-19 23:36:41 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2010-08-30 22:58:34 +0200 |
commit | 6adfd11ac958a11340174d4b016d45e3b5d4b55a (patch) | |
tree | 6194f4055c9d8fb52e03ca615eab213f25d165d0 | |
parent | a70dbe527164d7ba8e3e3803cea18c5da1e2b996 (diff) | |
download | external_gettext-6adfd11ac958a11340174d4b016d45e3b5d4b55a.zip external_gettext-6adfd11ac958a11340174d4b016d45e3b5d4b55a.tar.gz external_gettext-6adfd11ac958a11340174d4b016d45e3b5d4b55a.tar.bz2 |
Modernize AC_TRY_LINK invocations.
-rw-r--r-- | gettext-runtime/m4/ChangeLog | 12 | ||||
-rw-r--r-- | gettext-runtime/m4/codeset.m4 | 12 | ||||
-rw-r--r-- | gettext-runtime/m4/gettext.m4 | 52 | ||||
-rw-r--r-- | gettext-runtime/m4/iconv.m4 | 30 | ||||
-rw-r--r-- | gettext-runtime/m4/intl.m4 | 7 | ||||
-rw-r--r-- | gettext-runtime/m4/intlmacosx.m4 | 13 | ||||
-rw-r--r-- | gettext-runtime/m4/lcmessage.m4 | 10 | ||||
-rw-r--r-- | gettext-runtime/m4/threadlib.m4 | 34 |
8 files changed, 116 insertions, 54 deletions
diff --git a/gettext-runtime/m4/ChangeLog b/gettext-runtime/m4/ChangeLog index c3baad2..b3fa581 100644 --- a/gettext-runtime/m4/ChangeLog +++ b/gettext-runtime/m4/ChangeLog @@ -1,3 +1,15 @@ +2010-07-19 Bruno Haible <bruno@clisp.org> + + Modernize AC_TRY_LINK invocations. + * codeset.m4 (AM_LANGINFO_CODESET): Use AC_LINK_IFELSE instead of + AC_TRY_LINK. + * gettext.m4 (AM_GNU_GETTEXT): Likewise. + * iconv.m4 (AM_ICONV_LINK): Likewise. + * intl.m4 (gt_INTL_SUBDIR_CORE): Likewise. + * intlmacosx.m4 (gt_INTL_MACOSX): Likewise. + * lcmessage.m4 (gt_LC_MESSAGES): Likewise. + * threadlib.m4 (gl_THREADLIB_BODY): Likewise. + 2010-07-18 Bruno Haible <bruno@clisp.org> Modernize AC_TRY_COMPILE invocations. diff --git a/gettext-runtime/m4/codeset.m4 b/gettext-runtime/m4/codeset.m4 index a53c042..f722b2e 100644 --- a/gettext-runtime/m4/codeset.m4 +++ b/gettext-runtime/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 <langinfo.h>], - [char* cs = nl_langinfo(CODESET); return !cs;], - [am_cv_langinfo_codeset=yes], - [am_cv_langinfo_codeset=no]) + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <langinfo.h>]], + [[char* cs = nl_langinfo(CODESET); return !cs;]])], + [am_cv_langinfo_codeset=yes], + [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE([HAVE_LANGINFO_CODESET], [1], diff --git a/gettext-runtime/m4/gettext.m4 b/gettext-runtime/m4/gettext.m4 index f84e6a5..979c52c 100644 --- a/gettext-runtime/m4/gettext.m4 +++ b/gettext-runtime/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 <libintl.h> + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <libintl.h> $gt_revision_test_code extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings;], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], +extern int *_nl_domain_bindings; + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings + ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) @@ -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 <libintl.h> + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <libintl.h> $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], +const char *_nl_expand_alias (const char *); + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") + ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include <libintl.h> + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <libintl.h> $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif -const char *_nl_expand_alias (const char *);], - [bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], - [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/gettext-runtime/m4/iconv.m4 b/gettext-runtime/m4/iconv.m4 index 1ec4f82..abba95b 100644 --- a/gettext-runtime/m4/iconv.m4 +++ b/gettext-runtime/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 <stdlib.h> -#include <iconv.h>], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stdlib.h> +#include <iconv.h> + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" - AC_TRY_LINK([#include <stdlib.h> -#include <iconv.h>], - [iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <stdlib.h> +#include <iconv.h> + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" diff --git a/gettext-runtime/m4/intl.m4 b/gettext-runtime/m4/intl.m4 index 134981c..4f6f3cb 100644 --- a/gettext-runtime/m4/intl.m4 +++ b/gettext-runtime/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/gettext-runtime/m4/intlmacosx.m4 b/gettext-runtime/m4/intlmacosx.m4 index dd91025..f0f7c98 100644 --- a/gettext-runtime/m4/intlmacosx.m4 +++ b/gettext-runtime/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 <CoreFoundation/CFPreferences.h>], - [CFPreferencesCopyAppValue(NULL, NULL)], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <CoreFoundation/CFPreferences.h>]], + [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) @@ -35,7 +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 <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <CoreFoundation/CFLocale.h>]], + [[CFLocaleCopyCurrent();]])], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) diff --git a/gettext-runtime/m4/lcmessage.m4 b/gettext-runtime/m4/lcmessage.m4 index 1a70543..232da73 100644 --- a/gettext-runtime/m4/lcmessage.m4 +++ b/gettext-runtime/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 <drepper@cygnus.com>, 1995. AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES], - [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], - [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])]) + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <locale.h>]], + [[return LC_MESSAGES]])], + [gt_cv_val_LC_MESSAGES=yes], + [gt_cv_val_LC_MESSAGES=no])]) if test $gt_cv_val_LC_MESSAGES = yes; then AC_DEFINE([HAVE_LC_MESSAGES], [1], [Define if your <locale.h> file defines LC_MESSAGES.]) diff --git a/gettext-runtime/m4/threadlib.m4 b/gettext-runtime/m4/threadlib.m4 index 05cc4ff..01ee9dd 100644 --- a/gettext-runtime/m4/threadlib.m4 +++ b/gettext-runtime/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 <pthread.h>. cc also understands the flag -pthread, but # we don't use it because 1. gcc-2.95 doesn't understand -pthread, # 2. putting a flag into CPPFLAGS that has an effect on the linker - # causes the AC_TRY_LINK test below to succeed unexpectedly, + # causes the AC_LINK_IFELSE test below to succeed unexpectedly, # leading to wrong values of LIBTHREAD and LTLIBTHREAD. CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; @@ -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.h>], - [pthread_mutex_lock((pthread_mutex_t*)0); - pthread_mutexattr_init((pthread_mutexattr_t*)0);], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <pthread.h>]], + [[pthread_mutex_lock((pthread_mutex_t*)0); + pthread_mutexattr_init((pthread_mutexattr_t*)0);]])], [gl_have_pthread=yes]) # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) @@ -203,9 +209,13 @@ int main () gl_have_solaristhread= gl_save_LIBS="$LIBS" LIBS="$LIBS -lthread" - AC_TRY_LINK([#include <thread.h> -#include <synch.h>], - [thr_self();], + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include <thread.h> +#include <synch.h> + ]], + [[thr_self();]])], [gl_have_solaristhread=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then @@ -231,7 +241,9 @@ int main () gl_have_pth= gl_save_LIBS="$LIBS" LIBS="$LIBS -lpth" - AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])], + [gl_have_pth=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then gl_threads_api=pth |