On 5/30/25 5:38 PM, Pietro Monteiro wrote: > The autoconf macro PKG_CHECK_MODULES defined in config/pkg.m4 is used in > binutils/gdb, but not in GCC. That macro uses the obsolete AC_TRY_LINK[1]. > Update the code to use AC_LINK_IFELSE as documented by autoconf. > > Regenerating all autotool files in both trees shows no difference. > > [1] > https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html#index-AC_005fTRY_005fLINK-2207 > > config/ChangeLog: > > * pkg.m4 (PKG_CHECK_MODULES): Replace AC_TRY_LINK with AC_LINK_IFELSE. > > Signed-off-by: Pietro Monteiro <pie...@sociotechnical.xyz> > --- > config/pkg.m4 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/config/pkg.m4 b/config/pkg.m4 > index 7ebf517cd6a..cc15588a05c 100644 > --- a/config/pkg.m4 > +++ b/config/pkg.m4 > @@ -151,7 +151,7 @@ dnl Check whether $pkg_cv_[]$1[]_LIBS works. > if test $pkg_failed = no; then > pkg_save_LDFLAGS="$LDFLAGS" > LDFLAGS="$LDFLAGS $pkg_cv_[]$1[]_LIBS" > - AC_TRY_LINK([],[], [], [pkg_failed=yes]) > + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[pkg_failed=yes]) > LDFLAGS=$pkg_save_LDFLAGS > fi
I was going to say: ideally, this change would go to pkg-config first, and we would then pull it in, but it is actually in a local modification that we have (which I am not too happy with, but whatever). So, this is ok. Approved-By: Simon Marchi <simon.mar...@efficios.com> Simon