summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-01-01 18:05:04 -0800
committerKevin McCarthy <kevin@8t8.us>2021-01-03 13:00:29 -0800
commitb04bf448c3db614ce898df2f16c898c570fe9efa (patch)
tree732639095ae49e6a82d455a74bdf3952d3e47f08
parenta01316d918d469c1f2637f00439443146d1d41ca (diff)
Convert AC_TRY_LINK to AC_LINK_IFELSE.
-rw-r--r--m4/codeset.m48
-rw-r--r--m4/curslib.m412
-rw-r--r--m4/funcs.m46
-rw-r--r--m4/gettext.m424
-rw-r--r--m4/iconv.m422
-rw-r--r--m4/lcmessage.m45
6 files changed, 40 insertions, 37 deletions
diff --git a/m4/codeset.m4 b/m4/codeset.m4
index 59d613c6..e73c403e 100644
--- a/m4/codeset.m4
+++ b/m4/codeset.m4
@@ -5,10 +5,10 @@ dnl From Bruno Haible.
AC_DEFUN([MUTT_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);],
- am_cv_langinfo_codeset=yes,
- am_cv_langinfo_codeset=no)
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
+ [[char* cs = nl_langinfo(CODESET);]])],
+ [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/curslib.m4 b/m4/curslib.m4
index 805c68f9..a5ff953b 100644
--- a/m4/curslib.m4
+++ b/m4/curslib.m4
@@ -58,21 +58,21 @@ if test ".$ac_cv_func_initscr" != .yes ; then
LIBS="-l$cf_curs_lib $cf_save_LIBS"
if test "$cf_term_lib" = unknown ; then
AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
- AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
- [initscr()],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <${cf_cv_ncurses_header-curses.h}>]],
+ [[initscr()]])],
[cf_result=yes],
[cf_result=no])
AC_MSG_RESULT($cf_result)
test $cf_result = no && AC_MSG_ERROR([cannot link curses library])
elif test "$cf_term_lib" != predefined ; then
AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
- AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
- [initscr(); tgoto((char *)0, 0, 0);],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <${cf_cv_ncurses_header-curses.h}>]],
+ [[initscr(); tgoto((char *)0, 0, 0);]])],
[cf_result=no],
[
LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
- AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
- [initscr()],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <${cf_cv_ncurses_header-curses.h}>]],
+ [[initscr()]])],
[cf_result=yes],
[cf_result=error])
])
diff --git a/m4/funcs.m4 b/m4/funcs.m4
index d7157f3e..83221942 100644
--- a/m4/funcs.m4
+++ b/m4/funcs.m4
@@ -5,11 +5,13 @@ dnl
AC_DEFUN([XIPH_FUNC_VA_COPY],
[dnl
AC_MSG_CHECKING([for va_copy])
-AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]],
+ [[va_list ap1, ap2; va_copy(ap1, ap2);]])],
AC_MSG_RESULT([va_copy]),
[dnl
AH_TEMPLATE([va_copy], [define if va_copy is not available])
- AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]],
+ [[va_list ap1, ap2; __va_copy(ap1, ap2);]])],
[dnl
AC_DEFINE([va_copy], [__va_copy])
AC_MSG_RESULT([__va_copy])],
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index c3c0b70b..f4965eb0 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -84,24 +84,24 @@ AC_DEFUN([MUTT_AM_WITH_NLS],
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
- [AC_TRY_LINK([#include <libintl.h>
-extern int _nl_msg_cat_cntr;],
- [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
- gt_cv_func_gnugettext_libc=yes,
- gt_cv_func_gnugettext_libc=no)])
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libintl.h>
+extern int _nl_msg_cat_cntr;]],
+ [[bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr]])],
+ [gt_cv_func_gnugettext_libc=yes],
+ [gt_cv_func_gnugettext_libc=no])])
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
AC_CACHE_CHECK([for GNU gettext in libintl],
gt_cv_func_gnugettext_libintl,
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -lintl $LIBICONV"
- AC_TRY_LINK([#include <libintl.h>
-extern int _nl_msg_cat_cntr;],
- [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
- gt_cv_func_gnugettext_libintl=yes,
- gt_cv_func_gnugettext_libintl=no)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libintl.h>
+extern int _nl_msg_cat_cntr;]],
+ [[bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr]])],
+ [gt_cv_func_gnugettext_libintl=yes],
+ [gt_cv_func_gnugettext_libintl=no])
LIBS="$gt_save_LIBS"])
fi
diff --git a/m4/iconv.m4 b/m4/iconv.m4
index cb4fb508..8d5e8efd 100644
--- a/m4/iconv.m4
+++ b/m4/iconv.m4
@@ -18,22 +18,22 @@ AS_HELP_STRING([--with-libiconv-prefix@<:@=DIR@:>@], [Search for libiconv in DIR
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("","");
+ 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)
+ iconv_close(cd);]])],
+ [am_cv_func_iconv=yes])
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
- AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
- [iconv_t cd = iconv_open("","");
+ 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)
+ iconv_close(cd);]])],
+ [am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes])
LIBS="$am_save_LIBS"
fi
])
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
index 3a34f864..86fe7fd4 100644
--- a/m4/lcmessage.m4
+++ b/m4/lcmessage.m4
@@ -15,8 +15,9 @@
AC_DEFUN([MUTT_AM_LC_MESSAGES],
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
- am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <locale.h>]],
+ [[return LC_MESSAGES]])],
+ [am_cv_val_LC_MESSAGES=yes], [am_cv_val_LC_MESSAGES=no])])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES, 1,
[Define if your <locale.h> file defines LC_MESSAGES.])