[2/3] Replaced obsolete AC_TRY_LINK to AC_LINK_IFELSE

Message ID 20210216120021.213600-1-naohirot@fujitsu.com
State Committed
Headers
Series [1/3] Replaced obsolete AC_TRY_COMPILE to AC_COMPILE_IFELSE |

Commit Message

Naohiro Tamura Feb. 16, 2021, noon UTC
  This patch replaced obsolete AC_TRY_LINK to AC_LINK_IFELSE.
It has been confirmed that GNU 'autoconf' 2.69 doesn't change the
'configure' file and suppressed obsolete warning.
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Andreas Schwab Feb. 16, 2021, 1:04 p.m. UTC | #1
On Feb 16 2021, Naohiro Tamura wrote:

> diff --git a/configure.ac b/configure.ac
> index d8ccb6c119..b7f6f8f008 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1579,7 +1579,7 @@ if test "$with_gd" != "no"; then
>    LDFLAGS="$LDFLAGS $libgd_ldflags"
>    old_LIBS="$LIBS"
>    LIBS="$LIBS -lgd -lpng -lz -lm"
> -  AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
> +  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gd.h>]], [[gdImagePng (0, 0)]])],[LIBGD=yes],[LIBGD=no])

Please fold to avoid long lines.

Andreas.
  
Naohiro Tamura Feb. 17, 2021, 1:08 a.m. UTC | #2
Andreas-san,

Thank you for the review.

> -----Original Message-----
> From: Andreas Schwab <schwab@linux-m68k.org>
> Sent: Tuesday, February 16, 2021 10:05 PM
> To: Tamura, Naohiro/田村 直広 <naohirot@fujitsu.com>
> Cc: libc-alpha@sourceware.org
> Subject: Re: [PATCH 2/3] Replaced obsolete AC_TRY_LINK to AC_LINK_IFELSE
> 
> On Feb 16 2021, Naohiro Tamura wrote:
> 
> > diff --git a/configure.ac b/configure.ac index d8ccb6c119..b7f6f8f008
> > 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -1579,7 +1579,7 @@ if test "$with_gd" != "no"; then
> >    LDFLAGS="$LDFLAGS $libgd_ldflags"
> >    old_LIBS="$LIBS"
> >    LIBS="$LIBS -lgd -lpng -lz -lm"
> > -  AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes,
> > LIBGD=no)
> > +  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gd.h>]],
> [[gdImagePng
> > + (0, 0)]])],[LIBGD=yes],[LIBGD=no])
> 
> Please fold to avoid long lines.
> 

I'll fix that.
Thanks.
Naohiro


> Andreas.
> 
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
  

Patch

diff --git a/configure.ac b/configure.ac
index d8ccb6c119..b7f6f8f008 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1579,7 +1579,7 @@  if test "$with_gd" != "no"; then
   LDFLAGS="$LDFLAGS $libgd_ldflags"
   old_LIBS="$LIBS"
   LIBS="$LIBS -lgd -lpng -lz -lm"
-  AC_TRY_LINK([#include <gd.h>], [gdImagePng (0, 0)], LIBGD=yes, LIBGD=no)
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gd.h>]], [[gdImagePng (0, 0)]])],[LIBGD=yes],[LIBGD=no])
   CFLAGS="$old_CFLAGS"
   LDFLAGS="$old_LDFLAGS"
   LIBS="$old_LIBS"