From f9a27e3feda70b7af5813835e6afb788fbad7f04 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 9 Mar 1996 00:06:32 +0000 Subject: [PATCH] Fri Mar 8 15:06:48 1996 Roland McGrath * acgeneral.m4 (AC_CHECK_LIB): Declare $2 to override gcc2 internal prototype. --- acgeneral.m4 | 12 ++++++++++-- lib/autoconf/general.m4 | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/acgeneral.m4 b/acgeneral.m4 index 7c42253a..7f538827 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -1412,8 +1412,16 @@ ac_lib_var=`echo $1[_]$2 | tr '.-/+' '___p'` AC_CACHE_VAL(ac_cv_lib_$ac_lib_var, [ac_save_LIBS="$LIBS" LIBS="-l$1 $5 $LIBS" -AC_TRY_LINK(, [$2()], eval "ac_cv_lib_$ac_lib_var=yes", - eval "ac_cv_lib_$ac_lib_var=no")dnl +AC_TRY_LINK([/* Override any gcc2 internal prototype to avoid an error. */ +]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus +extern "C" +#endif +])dnl +char $2(); +], + [$2()], + eval "ac_cv_lib_$ac_lib_var=yes", + eval "ac_cv_lib_$ac_lib_var=no")dnl LIBS="$ac_save_LIBS" ])dnl if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 7c42253a..7f538827 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1412,8 +1412,16 @@ ac_lib_var=`echo $1[_]$2 | tr '.-/+' '___p'` AC_CACHE_VAL(ac_cv_lib_$ac_lib_var, [ac_save_LIBS="$LIBS" LIBS="-l$1 $5 $LIBS" -AC_TRY_LINK(, [$2()], eval "ac_cv_lib_$ac_lib_var=yes", - eval "ac_cv_lib_$ac_lib_var=no")dnl +AC_TRY_LINK([/* Override any gcc2 internal prototype to avoid an error. */ +]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus +extern "C" +#endif +])dnl +char $2(); +], + [$2()], + eval "ac_cv_lib_$ac_lib_var=yes", + eval "ac_cv_lib_$ac_lib_var=no")dnl LIBS="$ac_save_LIBS" ])dnl if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then -- 2.47.2