config/debuginfod.m4: Use PKG_CHECK_MODULES

Use PKG_CHECK_MODULES to set debuginfod autoconf vars. Also add
pkg.m4 to config/.

ChangeLog:

	* config/debuginfod.m4: use PKG_CHECK_MODULES.
	* config/pkg.m4: New file.
	* configure: Rebuild.
	* configure.ac: Remove AC_DEBUGINFOD.

ChangeLog/binutils:

	* Makefile.am: Replace LIBDEBUGINFOD with DEBUGINFOD_LIBS.
	* Makefile.in: Rebuild.
	* configure: Rebuild.
	* doc/Makefile.in: Rebuild.

ChangeLog/gdb:

	* Makefile.in: Replace LIBDEBUGINFOD with DEBUGINFOD_LIBS.
	* configure: Rebuild.
This commit is contained in:
Aaron Merey
2020-07-24 15:16:20 -04:00
parent 6dcfb80a28
commit f6720b1cfe
13 changed files with 857 additions and 384 deletions

139
configure vendored
View File

@ -690,7 +690,6 @@ extra_mpc_gmp_configure_flags
extra_mpfr_configure_flags
gmpinc
gmplibs
LIBDEBUGINFOD
do_compare
GNATMAKE
GNATBIND
@ -791,7 +790,6 @@ enable_libssp
enable_libstdcxx
enable_liboffloadmic
enable_bootstrap
with_debuginfod
with_mpc
with_mpc_include
with_mpc_lib
@ -1555,8 +1553,6 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-build-libsubdir=DIR Directory where to find libraries for build system
--with-system-zlib use installed libz
--with-debuginfod Enable debuginfo lookups with debuginfod
(auto/yes/no)
--with-mpc=PATH specify prefix directory for installed MPC package.
Equivalent to --with-mpc-include=PATH/include plus
--with-mpc-lib=PATH/lib
@ -1925,52 +1921,6 @@ fi
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
# ---------------------------------------------
# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
# accordingly.
ac_fn_c_check_decl ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
as_decl_name=`echo $2|sed 's/ *(.*//'`
as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
#ifndef $as_decl_name
#ifdef __cplusplus
(void) $as_decl_use;
#else
(void) $as_decl_name;
#endif
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_decl
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@ -5505,92 +5455,6 @@ gmplibs="-lmpc -lmpfr -lgmp"
gmpinc=
have_gmp=no
# Check for debuginfod
# Enable debuginfod
# Check whether --with-debuginfod was given.
if test "${with_debuginfod+set}" = set; then :
withval=$with_debuginfod;
else
with_debuginfod=auto
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use debuginfod" >&5
$as_echo_n "checking whether to use debuginfod... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_debuginfod" >&5
$as_echo "$with_debuginfod" >&6; }
if test "${with_debuginfod}" = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: debuginfod support disabled; some features may be unavailable." >&5
$as_echo "$as_me: WARNING: debuginfod support disabled; some features may be unavailable." >&2;}
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for debuginfod_begin in -ldebuginfod" >&5
$as_echo_n "checking for debuginfod_begin in -ldebuginfod... " >&6; }
if ${ac_cv_lib_debuginfod_debuginfod_begin+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldebuginfod $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char debuginfod_begin ();
int
main ()
{
return debuginfod_begin ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_debuginfod_debuginfod_begin=yes
else
ac_cv_lib_debuginfod_debuginfod_begin=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_debuginfod_debuginfod_begin" >&5
$as_echo "$ac_cv_lib_debuginfod_debuginfod_begin" >&6; }
if test "x$ac_cv_lib_debuginfod_debuginfod_begin" = xyes; then :
have_debuginfod_lib=yes
fi
ac_fn_c_check_decl "$LINENO" "debuginfod_begin" "ac_cv_have_decl_debuginfod_begin" "#include <elfutils/debuginfod.h>
"
if test "x$ac_cv_have_decl_debuginfod_begin" = xyes; then :
have_debuginfod_h=yes
fi
if test "x$have_debuginfod_lib" = "xyes" -a \
"x$have_debuginfod_h" = "xyes"; then
$as_echo "#define HAVE_LIBDEBUGINFOD 1" >>confdefs.h
LIBDEBUGINFOD="-ldebuginfod"
else
if test "$with_debuginfod" = yes; then
as_fn_error $? "debuginfod is missing or unusable" "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: debuginfod is missing or unusable; some features may be unavailable." >&5
$as_echo "$as_me: WARNING: debuginfod is missing or unusable; some features may be unavailable." >&2;}
fi
fi
fi
# Specify a location for mpc
# check for this first so it ends up on the link line before mpfr.
@ -5745,7 +5609,8 @@ if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
# Check for the recommended and required versions of GMP.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the correct version of gmp.h" >&5
$as_echo_n "checking for the correct version of gmp.h... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "gmp.h"
int