Blame SOURCES/debuginfod-use-pkg-config.patch

0efd7d
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
0efd7d
From: Keith Seitz <keiths@redhat.com>
0efd7d
Date: Fri, 24 Jul 2020 16:09:15 -0400
0efd7d
Subject: debuginfod-use-pkg-config.patch
0efd7d
0efd7d
;; Use pkg-config for debuginfod.m4.
0efd7d
;; (Aaron Merey)
0efd7d
0efd7d
From: Aaron Merey <amerey@redhat.com>
0efd7d
Date: Fri, 24 Jul 2020 15:16:20 -0400
0efd7d
Subject: [PATCH] config/debuginfod.m4: Use PKG_CHECK_MODULES
0efd7d
0efd7d
Use PKG_CHECK_MODULES to set debuginfod autoconf vars. Also add
0efd7d
pkg.m4 to config/.
0efd7d
0efd7d
ChangeLog:
0efd7d
0efd7d
        * config/debuginfod.m4: use PKG_CHECK_MODULES.
0efd7d
        * config/pkg.m4: New file.
0efd7d
        * configure: Rebuild.
0efd7d
        * configure.ac: Remove AC_DEBUGINFOD.
0efd7d
0efd7d
ChangeLog/binutils:
0efd7d
0efd7d
        * Makefile.am: Replace LIBDEBUGINFOD with DEBUGINFOD_LIBS.
0efd7d
        * Makefile.in: Rebuild.
0efd7d
        * configure: Rebuild.
0efd7d
        * doc/Makefile.in: Rebuild.
0efd7d
0efd7d
ChangeLog/gdb:
0efd7d
0efd7d
        * Makefile.in: Replace LIBDEBUGINFOD with DEBUGINFOD_LIBS.
0efd7d
        * configure: Rebuild.
0efd7d
0efd7d
diff --git a/config/debuginfod.m4 b/config/debuginfod.m4
0efd7d
--- a/config/debuginfod.m4
0efd7d
+++ b/config/debuginfod.m4
0efd7d
@@ -1,38 +1,30 @@
0efd7d
-dnl Copyright (C) 1997-2019 Free Software Foundation, Inc.
0efd7d
+dnl Copyright (C) 1997-2020 Free Software Foundation, Inc.
0efd7d
 dnl This file is free software, distributed under the terms of the GNU
0efd7d
 dnl General Public License.  As a special exception to the GNU General
0efd7d
 dnl Public License, this file may be distributed as part of a program
0efd7d
 dnl that contains a configuration script generated by Autoconf, under
0efd7d
 dnl the same distribution terms as the rest of that program.
0efd7d
 
0efd7d
+m4_include([../config/pkg.m4])
0efd7d
+
0efd7d
 AC_DEFUN([AC_DEBUGINFOD],
0efd7d
 [
0efd7d
-# Enable debuginfod
0efd7d
+# Handle optional debuginfod support
0efd7d
 AC_ARG_WITH([debuginfod],
0efd7d
-        AC_HELP_STRING([--with-debuginfod],
0efd7d
-                       [Enable debuginfo lookups with debuginfod (auto/yes/no)]),
0efd7d
-        [], [with_debuginfod=auto])
0efd7d
+  AC_HELP_STRING([--with-debuginfod], [Enable debuginfo lookups with debuginfod (auto/yes/no)]),
0efd7d
+  [], [with_debuginfod=auto])
0efd7d
 AC_MSG_CHECKING([whether to use debuginfod])
0efd7d
 AC_MSG_RESULT([$with_debuginfod])
0efd7d
 
0efd7d
-if test "${with_debuginfod}" = no; then
0efd7d
-  AC_MSG_WARN([debuginfod support disabled; some features may be unavailable.])
0efd7d
+if test "x$with_debuginfod" != xno; then
0efd7d
+  PKG_CHECK_MODULES([DEBUGINFOD], [libdebuginfod >= 0.179],
0efd7d
+    [AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])],
0efd7d
+    [if test "x$with_debuginfod" = xyes; then
0efd7d
+       AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."])
0efd7d
+     else
0efd7d
+       AC_MSG_WARN([libdebuginfod is missing or unusable; some features may be unavailable.])
0efd7d
+     fi])
0efd7d
 else
0efd7d
-  AC_CHECK_LIB([debuginfod], [debuginfod_begin], [have_debuginfod_lib=yes])
0efd7d
-  AC_CHECK_DECL([debuginfod_begin], [have_debuginfod_h=yes], [],
0efd7d
-                [#include <elfutils/debuginfod.h>])
0efd7d
-  if test "x$have_debuginfod_lib" = "xyes" -a \
0efd7d
-          "x$have_debuginfod_h" = "xyes"; then
0efd7d
-    AC_DEFINE([HAVE_LIBDEBUGINFOD], [1],
0efd7d
-              [Define to 1 if debuginfod is enabled.])
0efd7d
-    AC_SUBST([LIBDEBUGINFOD], ["-ldebuginfod"])
0efd7d
-  else
0efd7d
-    AC_SUBST([LIBDEBUGINFOD], [])
0efd7d
-    if test "$with_debuginfod" = yes; then
0efd7d
-      AC_MSG_ERROR([debuginfod is missing or unusable])
0efd7d
-    else
0efd7d
-      AC_MSG_WARN([debuginfod is missing or unusable; some features may be unavailable.])
0efd7d
-    fi
0efd7d
-  fi
0efd7d
+  AC_MSG_WARN([debuginfod support disabled; some features may be unavailable.])
0efd7d
 fi
0efd7d
 ])
0efd7d
diff --git a/config/pkg.m4 b/config/pkg.m4
0efd7d
new file mode 100644
0efd7d
--- /dev/null
0efd7d
+++ b/config/pkg.m4
0efd7d
@@ -0,0 +1,275 @@
0efd7d
+# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
0efd7d
+# serial 12 (pkg-config-0.29.2)
0efd7d
+
0efd7d
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
0efd7d
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
0efd7d
+dnl
0efd7d
+dnl This program is free software; you can redistribute it and/or modify
0efd7d
+dnl it under the terms of the GNU General Public License as published by
0efd7d
+dnl the Free Software Foundation; either version 2 of the License, or
0efd7d
+dnl (at your option) any later version.
0efd7d
+dnl
0efd7d
+dnl This program is distributed in the hope that it will be useful, but
0efd7d
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
0efd7d
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0efd7d
+dnl General Public License for more details.
0efd7d
+dnl
0efd7d
+dnl You should have received a copy of the GNU General Public License
0efd7d
+dnl along with this program; if not, write to the Free Software
0efd7d
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
0efd7d
+dnl 02111-1307, USA.
0efd7d
+dnl
0efd7d
+dnl As a special exception to the GNU General Public License, if you
0efd7d
+dnl distribute this file as part of a program that contains a
0efd7d
+dnl configuration script generated by Autoconf, you may include it under
0efd7d
+dnl the same distribution terms that you use for the rest of that
0efd7d
+dnl program.
0efd7d
+
0efd7d
+dnl PKG_PREREQ(MIN-VERSION)
0efd7d
+dnl -----------------------
0efd7d
+dnl Since: 0.29
0efd7d
+dnl
0efd7d
+dnl Verify that the version of the pkg-config macros are at least
0efd7d
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
0efd7d
+dnl installed version of pkg-config, this checks the developer's version
0efd7d
+dnl of pkg.m4 when generating configure.
0efd7d
+dnl
0efd7d
+dnl To ensure that this macro is defined, also add:
0efd7d
+dnl m4_ifndef([PKG_PREREQ],
0efd7d
+dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
0efd7d
+dnl
0efd7d
+dnl See the "Since" comment for each macro you use to see what version
0efd7d
+dnl of the macros you require.
0efd7d
+m4_defun([PKG_PREREQ],
0efd7d
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
0efd7d
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
0efd7d
+    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
0efd7d
+])dnl PKG_PREREQ
0efd7d
+
0efd7d
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
0efd7d
+dnl ----------------------------------
0efd7d
+dnl Since: 0.16
0efd7d
+dnl
0efd7d
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
0efd7d
+dnl first found in the path. Checks that the version of pkg-config found
0efd7d
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
0efd7d
+dnl used since that's the first version where most current features of
0efd7d
+dnl pkg-config existed.
0efd7d
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
0efd7d
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
0efd7d
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
0efd7d
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
0efd7d
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
0efd7d
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
0efd7d
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
0efd7d
+
0efd7d
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
0efd7d
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
0efd7d
+fi
0efd7d
+if test -n "$PKG_CONFIG"; then
0efd7d
+	_pkg_min_version=m4_default([$1], [0.9.0])
0efd7d
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
0efd7d
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
0efd7d
+		AC_MSG_RESULT([yes])
0efd7d
+	else
0efd7d
+		AC_MSG_RESULT([no])
0efd7d
+		PKG_CONFIG=""
0efd7d
+	fi
0efd7d
+fi[]dnl
0efd7d
+])dnl PKG_PROG_PKG_CONFIG
0efd7d
+
0efd7d
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
0efd7d
+dnl -------------------------------------------------------------------
0efd7d
+dnl Since: 0.18
0efd7d
+dnl
0efd7d
+dnl Check to see whether a particular set of modules exists. Similar to
0efd7d
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
0efd7d
+dnl
0efd7d
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
0efd7d
+dnl only at the first occurence in configure.ac, so if the first place
0efd7d
+dnl it's called might be skipped (such as if it is within an "if", you
0efd7d
+dnl have to call PKG_CHECK_EXISTS manually
0efd7d
+AC_DEFUN([PKG_CHECK_EXISTS],
0efd7d
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
0efd7d
+if test -n "$PKG_CONFIG" && \
0efd7d
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
0efd7d
+  m4_default([$2], [:])
0efd7d
+m4_ifvaln([$3], [else
0efd7d
+  $3])dnl
0efd7d
+fi])
0efd7d
+
0efd7d
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
0efd7d
+dnl ---------------------------------------------
0efd7d
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
0efd7d
+dnl pkg_failed based on the result.
0efd7d
+m4_define([_PKG_CONFIG],
0efd7d
+[if test -n "$$1"; then
0efd7d
+    pkg_cv_[]$1="$$1"
0efd7d
+ elif test -n "$PKG_CONFIG"; then
0efd7d
+    PKG_CHECK_EXISTS([$3],
0efd7d
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
0efd7d
+		      test "x$?" != "x0" && pkg_failed=yes ],
0efd7d
+		     [pkg_failed=yes])
0efd7d
+ else
0efd7d
+    pkg_failed=untried
0efd7d
+fi[]dnl
0efd7d
+])dnl _PKG_CONFIG
0efd7d
+
0efd7d
+dnl _PKG_SHORT_ERRORS_SUPPORTED
0efd7d
+dnl ---------------------------
0efd7d
+dnl Internal check to see if pkg-config supports short errors.
0efd7d
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
0efd7d
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
0efd7d
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
0efd7d
+        _pkg_short_errors_supported=yes
0efd7d
+else
0efd7d
+        _pkg_short_errors_supported=no
0efd7d
+fi[]dnl
0efd7d
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
0efd7d
+
0efd7d
+
0efd7d
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
0efd7d
+dnl   [ACTION-IF-NOT-FOUND])
0efd7d
+dnl --------------------------------------------------------------
0efd7d
+dnl Since: 0.4.0
0efd7d
+dnl
0efd7d
+dnl Note that if there is a possibility the first call to
0efd7d
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
0efd7d
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
0efd7d
+AC_DEFUN([PKG_CHECK_MODULES],
0efd7d
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
0efd7d
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
0efd7d
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
0efd7d
+
0efd7d
+pkg_failed=no
0efd7d
+AC_MSG_CHECKING([for $2])
0efd7d
+
0efd7d
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
0efd7d
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
0efd7d
+
0efd7d
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
0efd7d
+and $1[]_LIBS to avoid the need to call pkg-config.
0efd7d
+See the pkg-config man page for more details.])
0efd7d
+
0efd7d
+if test $pkg_failed = yes; then
0efd7d
+        AC_MSG_RESULT([no])
0efd7d
+        _PKG_SHORT_ERRORS_SUPPORTED
0efd7d
+        if test $_pkg_short_errors_supported = yes; then
0efd7d
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
0efd7d
+        else
0efd7d
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
0efd7d
+        fi
0efd7d
+	# Put the nasty error message in config.log where it belongs
0efd7d
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
0efd7d
+
0efd7d
+	m4_default([$4], [AC_MSG_ERROR(
0efd7d
+[Package requirements ($2) were not met:
0efd7d
+
0efd7d
+$$1_PKG_ERRORS
0efd7d
+
0efd7d
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
0efd7d
+installed software in a non-standard prefix.
0efd7d
+
0efd7d
+_PKG_TEXT])[]dnl
0efd7d
+        ])
0efd7d
+elif test $pkg_failed = untried; then
0efd7d
+        AC_MSG_RESULT([no])
0efd7d
+	m4_default([$4], [AC_MSG_FAILURE(
0efd7d
+[The pkg-config script could not be found or is too old.  Make sure it
0efd7d
+is in your PATH or set the PKG_CONFIG environment variable to the full
0efd7d
+path to pkg-config.
0efd7d
+
0efd7d
+_PKG_TEXT
0efd7d
+
0efd7d
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
0efd7d
+        ])
0efd7d
+else
0efd7d
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
0efd7d
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
0efd7d
+        AC_MSG_RESULT([yes])
0efd7d
+	$3
0efd7d
+fi[]dnl
0efd7d
+])dnl PKG_CHECK_MODULES
0efd7d
+
0efd7d
+
0efd7d
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
0efd7d
+dnl   [ACTION-IF-NOT-FOUND])
0efd7d
+dnl ---------------------------------------------------------------------
0efd7d
+dnl Since: 0.29
0efd7d
+dnl
0efd7d
+dnl Checks for existence of MODULES and gathers its build flags with
0efd7d
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
0efd7d
+dnl and VARIABLE-PREFIX_LIBS from --libs.
0efd7d
+dnl
0efd7d
+dnl Note that if there is a possibility the first call to
0efd7d
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
0efd7d
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
0efd7d
+dnl configure.ac.
0efd7d
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
0efd7d
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
0efd7d
+_save_PKG_CONFIG=$PKG_CONFIG
0efd7d
+PKG_CONFIG="$PKG_CONFIG --static"
0efd7d
+PKG_CHECK_MODULES($@)
0efd7d
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
0efd7d
+])dnl PKG_CHECK_MODULES_STATIC
0efd7d
+
0efd7d
+
0efd7d
+dnl PKG_INSTALLDIR([DIRECTORY])
0efd7d
+dnl -------------------------
0efd7d
+dnl Since: 0.27
0efd7d
+dnl
0efd7d
+dnl Substitutes the variable pkgconfigdir as the location where a module
0efd7d
+dnl should install pkg-config .pc files. By default the directory is
0efd7d
+dnl $libdir/pkgconfig, but the default can be changed by passing
0efd7d
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
0efd7d
+dnl parameter.
0efd7d
+AC_DEFUN([PKG_INSTALLDIR],
0efd7d
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
0efd7d
+m4_pushdef([pkg_description],
0efd7d
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
0efd7d
+AC_ARG_WITH([pkgconfigdir],
0efd7d
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
0efd7d
+    [with_pkgconfigdir=]pkg_default)
0efd7d
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
0efd7d
+m4_popdef([pkg_default])
0efd7d
+m4_popdef([pkg_description])
0efd7d
+])dnl PKG_INSTALLDIR
0efd7d
+
0efd7d
+
0efd7d
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
0efd7d
+dnl --------------------------------
0efd7d
+dnl Since: 0.27
0efd7d
+dnl
0efd7d
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
0efd7d
+dnl module should install arch-independent pkg-config .pc files. By
0efd7d
+dnl default the directory is $datadir/pkgconfig, but the default can be
0efd7d
+dnl changed by passing DIRECTORY. The user can override through the
0efd7d
+dnl --with-noarch-pkgconfigdir parameter.
0efd7d
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
0efd7d
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
0efd7d
+m4_pushdef([pkg_description],
0efd7d
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
0efd7d
+AC_ARG_WITH([noarch-pkgconfigdir],
0efd7d
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
0efd7d
+    [with_noarch_pkgconfigdir=]pkg_default)
0efd7d
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
0efd7d
+m4_popdef([pkg_default])
0efd7d
+m4_popdef([pkg_description])
0efd7d
+])dnl PKG_NOARCH_INSTALLDIR
0efd7d
+
0efd7d
+
0efd7d
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
0efd7d
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
0efd7d
+dnl -------------------------------------------
0efd7d
+dnl Since: 0.28
0efd7d
+dnl
0efd7d
+dnl Retrieves the value of the pkg-config variable for the given module.
0efd7d
+AC_DEFUN([PKG_CHECK_VAR],
0efd7d
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
0efd7d
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
0efd7d
+
0efd7d
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
0efd7d
+AS_VAR_COPY([$1], [pkg_cv_][$1])
0efd7d
+
0efd7d
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
0efd7d
+])dnl PKG_CHECK_VAR
0efd7d
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
0efd7d
--- a/gdb/Makefile.in
0efd7d
+++ b/gdb/Makefile.in
0efd7d
@@ -587,7 +587,8 @@ INTERNAL_CFLAGS_BASE = \
0efd7d
 	$(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) $(ZLIBINC) \
0efd7d
 	$(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
0efd7d
 	$(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS) \
0efd7d
-	$(SRCHIGH_CFLAGS) $(TOP_CFLAGS) $(PTHREAD_CFLAGS)
0efd7d
+	$(SRCHIGH_CFLAGS) $(TOP_CFLAGS) $(PTHREAD_CFLAGS) \
0efd7d
+	@DEBUGINFOD_CFLAGS@
0efd7d
 INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS)
0efd7d
 INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
0efd7d
 
0efd7d
@@ -613,7 +614,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(LIBCTF) $(ZLIB) \
0efd7d
 	$(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
0efd7d
 	$(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR) \
0efd7d
 	$(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS) \
0efd7d
-	@LIBDEBUGINFOD@
0efd7d
+	@DEBUGINFOD_LIBS@
0efd7d
 CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(LIBCTF) \
0efd7d
 	$(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
0efd7d
 
0efd7d
diff --git a/gdb/configure b/gdb/configure
0efd7d
--- a/gdb/configure
0efd7d
+++ b/gdb/configure
0efd7d
@@ -758,7 +758,11 @@ REPORT_BUGS_TEXI
0efd7d
 REPORT_BUGS_TO
0efd7d
 PKGVERSION
0efd7d
 CODESIGN_CERT
0efd7d
-LIBDEBUGINFOD
0efd7d
+DEBUGINFOD_LIBS
0efd7d
+DEBUGINFOD_CFLAGS
0efd7d
+PKG_CONFIG_LIBDIR
0efd7d
+PKG_CONFIG_PATH
0efd7d
+PKG_CONFIG
0efd7d
 HAVE_NATIVE_GCORE_TARGET
0efd7d
 TARGET_OBS
0efd7d
 subdirs
0efd7d
@@ -937,6 +941,9 @@ MAKEINFOFLAGS
0efd7d
 PKG_CONFIG
0efd7d
 PKG_CONFIG_PATH
0efd7d
 PKG_CONFIG_LIBDIR
0efd7d
+PKG_CONFIG_CFLAGS
0efd7d
+DEBUGINFOD_CFLAGS
0efd7d
+DEBUGINFOD_LIBS
0efd7d
 RPM_CFLAGS
0efd7d
 RPM_LIBS
0efd7d
 YACC
0efd7d
@@ -1683,6 +1690,10 @@ Some influential environment variables:
0efd7d
               directories to add to pkg-config's search path
0efd7d
   PKG_CONFIG_LIBDIR
0efd7d
               path overriding pkg-config's built-in search path
0efd7d
+  DEBUGINFOD_CFLAGS
0efd7d
+              C compiler flags for DEBUGINFOD, overriding pkg-config
0efd7d
+  DEBUGINFOD_LIBS
0efd7d
+              linker flags for DEBUGINFOD, overriding pkg-config
0efd7d
   RPM_CFLAGS  C compiler flags for RPM, overriding pkg-config
0efd7d
   RPM_LIBS    linker flags for RPM, overriding pkg-config
0efd7d
   YACC        The `Yet Another Compiler Compiler' implementation to use.
0efd7d
@@ -2275,52 +2286,6 @@ rm -f conftest.val
0efd7d
 
0efd7d
 } # ac_fn_c_compute_int
0efd7d
 
0efd7d
-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
0efd7d
-# ---------------------------------------------
0efd7d
-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
0efd7d
-# accordingly.
0efd7d
-ac_fn_c_check_decl ()
0efd7d
-{
0efd7d
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
0efd7d
-  as_decl_name=`echo $2|sed 's/ *(.*//'`
0efd7d
-  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
0efd7d
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
0efd7d
-$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
0efd7d
-if eval \${$3+:} false; then :
0efd7d
-  $as_echo_n "(cached) " >&6
0efd7d
-else
0efd7d
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
0efd7d
-/* end confdefs.h.  */
0efd7d
-$4
0efd7d
-int
0efd7d
-main ()
0efd7d
-{
0efd7d
-#ifndef $as_decl_name
0efd7d
-#ifdef __cplusplus
0efd7d
-  (void) $as_decl_use;
0efd7d
-#else
0efd7d
-  (void) $as_decl_name;
0efd7d
-#endif
0efd7d
-#endif
0efd7d
-
0efd7d
-  ;
0efd7d
-  return 0;
0efd7d
-}
0efd7d
-_ACEOF
0efd7d
-if ac_fn_c_try_compile "$LINENO"; then :
0efd7d
-  eval "$3=yes"
0efd7d
-else
0efd7d
-  eval "$3=no"
0efd7d
-fi
0efd7d
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
0efd7d
-fi
0efd7d
-eval ac_res=\$$3
0efd7d
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
0efd7d
-$as_echo "$ac_res" >&6; }
0efd7d
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
0efd7d
-
0efd7d
-} # ac_fn_c_check_decl
0efd7d
-
0efd7d
 # ac_fn_c_check_func LINENO FUNC VAR
0efd7d
 # ----------------------------------
0efd7d
 # Tests whether FUNC exists, setting the cache variable VAR accordingly
0efd7d
@@ -2388,6 +2353,52 @@ $as_echo "$ac_res" >&6; }
0efd7d
 
0efd7d
 } # ac_fn_c_check_func
0efd7d
 
0efd7d
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
0efd7d
+# ---------------------------------------------
0efd7d
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
0efd7d
+# accordingly.
0efd7d
+ac_fn_c_check_decl ()
0efd7d
+{
0efd7d
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
0efd7d
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
0efd7d
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
0efd7d
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
0efd7d
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
0efd7d
+if eval \${$3+:} false; then :
0efd7d
+  $as_echo_n "(cached) " >&6
0efd7d
+else
0efd7d
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
0efd7d
+/* end confdefs.h.  */
0efd7d
+$4
0efd7d
+int
0efd7d
+main ()
0efd7d
+{
0efd7d
+#ifndef $as_decl_name
0efd7d
+#ifdef __cplusplus
0efd7d
+  (void) $as_decl_use;
0efd7d
+#else
0efd7d
+  (void) $as_decl_name;
0efd7d
+#endif
0efd7d
+#endif
0efd7d
+
0efd7d
+  ;
0efd7d
+  return 0;
0efd7d
+}
0efd7d
+_ACEOF
0efd7d
+if ac_fn_c_try_compile "$LINENO"; then :
0efd7d
+  eval "$3=yes"
0efd7d
+else
0efd7d
+  eval "$3=no"
0efd7d
+fi
0efd7d
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
0efd7d
+fi
0efd7d
+eval ac_res=\$$3
0efd7d
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
0efd7d
+$as_echo "$ac_res" >&6; }
0efd7d
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
0efd7d
+
0efd7d
+} # ac_fn_c_check_decl
0efd7d
+
0efd7d
 # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
0efd7d
 # ----------------------------------------------------
0efd7d
 # Tries to find if the field MEMBER exists in type AGGR, after including
0efd7d
@@ -7338,7 +7349,127 @@ esac
0efd7d
 
0efd7d
 # Handle optional debuginfod support
0efd7d
 
0efd7d
-# Enable debuginfod
0efd7d
+
0efd7d
+
0efd7d
+
0efd7d
+
0efd7d
+
0efd7d
+
0efd7d
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
0efd7d
+	if test -n "$ac_tool_prefix"; then
0efd7d
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
0efd7d
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
0efd7d
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
0efd7d
+$as_echo_n "checking for $ac_word... " >&6; }
0efd7d
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
0efd7d
+  $as_echo_n "(cached) " >&6
0efd7d
+else
0efd7d
+  case $PKG_CONFIG in
0efd7d
+  [\\/]* | ?:[\\/]*)
0efd7d
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
0efd7d
+  ;;
0efd7d
+  *)
0efd7d
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
0efd7d
+for as_dir in $PATH
0efd7d
+do
0efd7d
+  IFS=$as_save_IFS
0efd7d
+  test -z "$as_dir" && as_dir=.
0efd7d
+    for ac_exec_ext in '' $ac_executable_extensions; do
0efd7d
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
0efd7d
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
0efd7d
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
0efd7d
+    break 2
0efd7d
+  fi
0efd7d
+done
0efd7d
+  done
0efd7d
+IFS=$as_save_IFS
0efd7d
+
0efd7d
+  ;;
0efd7d
+esac
0efd7d
+fi
0efd7d
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
0efd7d
+if test -n "$PKG_CONFIG"; then
0efd7d
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
0efd7d
+$as_echo "$PKG_CONFIG" >&6; }
0efd7d
+else
0efd7d
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
0efd7d
+$as_echo "no" >&6; }
0efd7d
+fi
0efd7d
+
0efd7d
+
0efd7d
+fi
0efd7d
+if test -z "$ac_cv_path_PKG_CONFIG"; then
0efd7d
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
0efd7d
+  # Extract the first word of "pkg-config", so it can be a program name with args.
0efd7d
+set dummy pkg-config; ac_word=$2
0efd7d
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
0efd7d
+$as_echo_n "checking for $ac_word... " >&6; }
0efd7d
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
0efd7d
+  $as_echo_n "(cached) " >&6
0efd7d
+else
0efd7d
+  case $ac_pt_PKG_CONFIG in
0efd7d
+  [\\/]* | ?:[\\/]*)
0efd7d
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
0efd7d
+  ;;
0efd7d
+  *)
0efd7d
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
0efd7d
+for as_dir in $PATH
0efd7d
+do
0efd7d
+  IFS=$as_save_IFS
0efd7d
+  test -z "$as_dir" && as_dir=.
0efd7d
+    for ac_exec_ext in '' $ac_executable_extensions; do
0efd7d
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
0efd7d
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
0efd7d
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
0efd7d
+    break 2
0efd7d
+  fi
0efd7d
+done
0efd7d
+  done
0efd7d
+IFS=$as_save_IFS
0efd7d
+
0efd7d
+  ;;
0efd7d
+esac
0efd7d
+fi
0efd7d
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
0efd7d
+if test -n "$ac_pt_PKG_CONFIG"; then
0efd7d
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
0efd7d
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
0efd7d
+else
0efd7d
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
0efd7d
+$as_echo "no" >&6; }
0efd7d
+fi
0efd7d
+
0efd7d
+  if test "x$ac_pt_PKG_CONFIG" = x; then
0efd7d
+    PKG_CONFIG=""
0efd7d
+  else
0efd7d
+    case $cross_compiling:$ac_tool_warned in
0efd7d
+yes:)
0efd7d
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
0efd7d
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
0efd7d
+ac_tool_warned=yes ;;
0efd7d
+esac
0efd7d
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
0efd7d
+  fi
0efd7d
+else
0efd7d
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
0efd7d
+fi
0efd7d
+
0efd7d
+fi
0efd7d
+if test -n "$PKG_CONFIG"; then
0efd7d
+	_pkg_min_version=0.9.0
0efd7d
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
0efd7d
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
0efd7d
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
0efd7d
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
0efd7d
+$as_echo "yes" >&6; }
0efd7d
+	else
0efd7d
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
0efd7d
+$as_echo "no" >&6; }
0efd7d
+		PKG_CONFIG=""
0efd7d
+	fi
0efd7d
+fi
0efd7d
+
0efd7d
+# Handle optional debuginfod support
0efd7d
 
0efd7d
 # Check whether --with-debuginfod was given.
0efd7d
 if test "${with_debuginfod+set}" = set; then :
0efd7d
@@ -7352,72 +7483,93 @@ $as_echo_n "checking whether to use debuginfod... " >&6; }
0efd7d
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_debuginfod" >&5
0efd7d
 $as_echo "$with_debuginfod" >&6; }
0efd7d
 
0efd7d
-if test "${with_debuginfod}" = no; then
0efd7d
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: debuginfod support disabled; some features may be unavailable." >&5
0efd7d
-$as_echo "$as_me: WARNING: debuginfod support disabled; some features may be unavailable." >&2;}
0efd7d
-else
0efd7d
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for debuginfod_begin in -ldebuginfod" >&5
0efd7d
-$as_echo_n "checking for debuginfod_begin in -ldebuginfod... " >&6; }
0efd7d
-if ${ac_cv_lib_debuginfod_debuginfod_begin+:} false; then :
0efd7d
-  $as_echo_n "(cached) " >&6
0efd7d
-else
0efd7d
-  ac_check_lib_save_LIBS=$LIBS
0efd7d
-LIBS="-ldebuginfod  $LIBS"
0efd7d
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
0efd7d
-/* end confdefs.h.  */
0efd7d
+if test "x$with_debuginfod" != xno; then
0efd7d
 
0efd7d
-/* Override any GCC internal prototype to avoid an error.
0efd7d
-   Use char because int might match the return type of a GCC
0efd7d
-   builtin and then its argument prototype would still apply.  */
0efd7d
-#ifdef __cplusplus
0efd7d
-extern "C"
0efd7d
-#endif
0efd7d
-char debuginfod_begin ();
0efd7d
-int
0efd7d
-main ()
0efd7d
-{
0efd7d
-return debuginfod_begin ();
0efd7d
-  ;
0efd7d
-  return 0;
0efd7d
-}
0efd7d
-_ACEOF
0efd7d
-if ac_fn_c_try_link "$LINENO"; then :
0efd7d
-  ac_cv_lib_debuginfod_debuginfod_begin=yes
0efd7d
+pkg_failed=no
0efd7d
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdebuginfod >= 0.179" >&5
0efd7d
+$as_echo_n "checking for libdebuginfod >= 0.179... " >&6; }
0efd7d
+
0efd7d
+if test -n "$DEBUGINFOD_CFLAGS"; then
0efd7d
+    pkg_cv_DEBUGINFOD_CFLAGS="$DEBUGINFOD_CFLAGS"
0efd7d
+ elif test -n "$PKG_CONFIG"; then
0efd7d
+    if test -n "$PKG_CONFIG" && \
0efd7d
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdebuginfod >= 0.179\""; } >&5
0efd7d
+  ($PKG_CONFIG --exists --print-errors "libdebuginfod >= 0.179") 2>&5
0efd7d
+  ac_status=$?
0efd7d
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
0efd7d
+  test $ac_status = 0; }; then
0efd7d
+  pkg_cv_DEBUGINFOD_CFLAGS=`$PKG_CONFIG --cflags "libdebuginfod >= 0.179" 2>/dev/null`
0efd7d
+		      test "x$?" != "x0" && pkg_failed=yes
0efd7d
 else
0efd7d
-  ac_cv_lib_debuginfod_debuginfod_begin=no
0efd7d
+  pkg_failed=yes
0efd7d
 fi
0efd7d
-rm -f core conftest.err conftest.$ac_objext \
0efd7d
-    conftest$ac_exeext conftest.$ac_ext
0efd7d
-LIBS=$ac_check_lib_save_LIBS
0efd7d
+ else
0efd7d
+    pkg_failed=untried
0efd7d
+fi
0efd7d
+if test -n "$DEBUGINFOD_LIBS"; then
0efd7d
+    pkg_cv_DEBUGINFOD_LIBS="$DEBUGINFOD_LIBS"
0efd7d
+ elif test -n "$PKG_CONFIG"; then
0efd7d
+    if test -n "$PKG_CONFIG" && \
0efd7d
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdebuginfod >= 0.179\""; } >&5
0efd7d
+  ($PKG_CONFIG --exists --print-errors "libdebuginfod >= 0.179") 2>&5
0efd7d
+  ac_status=$?
0efd7d
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
0efd7d
+  test $ac_status = 0; }; then
0efd7d
+  pkg_cv_DEBUGINFOD_LIBS=`$PKG_CONFIG --libs "libdebuginfod >= 0.179" 2>/dev/null`
0efd7d
+		      test "x$?" != "x0" && pkg_failed=yes
0efd7d
+else
0efd7d
+  pkg_failed=yes
0efd7d
 fi
0efd7d
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_debuginfod_debuginfod_begin" >&5
0efd7d
-$as_echo "$ac_cv_lib_debuginfod_debuginfod_begin" >&6; }
0efd7d
-if test "x$ac_cv_lib_debuginfod_debuginfod_begin" = xyes; then :
0efd7d
-  have_debuginfod_lib=yes
0efd7d
+ else
0efd7d
+    pkg_failed=untried
0efd7d
 fi
0efd7d
 
0efd7d
-  ac_fn_c_check_decl "$LINENO" "debuginfod_begin" "ac_cv_have_decl_debuginfod_begin" "#include <elfutils/debuginfod.h>
0efd7d
-"
0efd7d
-if test "x$ac_cv_have_decl_debuginfod_begin" = xyes; then :
0efd7d
-  have_debuginfod_h=yes
0efd7d
-fi
0efd7d
 
0efd7d
-  if test "x$have_debuginfod_lib" = "xyes" -a \
0efd7d
-          "x$have_debuginfod_h" = "xyes"; then
0efd7d
 
0efd7d
-$as_echo "#define HAVE_LIBDEBUGINFOD 1" >>confdefs.h
0efd7d
+if test $pkg_failed = yes; then
0efd7d
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
0efd7d
+$as_echo "no" >&6; }
0efd7d
 
0efd7d
-    LIBDEBUGINFOD="-ldebuginfod"
0efd7d
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
0efd7d
+        _pkg_short_errors_supported=yes
0efd7d
+else
0efd7d
+        _pkg_short_errors_supported=no
0efd7d
+fi
0efd7d
+        if test $_pkg_short_errors_supported = yes; then
0efd7d
+	        DEBUGINFOD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdebuginfod >= 0.179" 2>&1`
0efd7d
+        else
0efd7d
+	        DEBUGINFOD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdebuginfod >= 0.179" 2>&1`
0efd7d
+        fi
0efd7d
+	# Put the nasty error message in config.log where it belongs
0efd7d
+	echo "$DEBUGINFOD_PKG_ERRORS" >&5
0efd7d
 
0efd7d
-  else
0efd7d
+	if test "x$with_debuginfod" = xyes; then
0efd7d
+       as_fn_error $? "\"--with-debuginfod was given, but libdebuginfod is missing or unusable.\"" "$LINENO" 5
0efd7d
+     else
0efd7d
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdebuginfod is missing or unusable; some features may be unavailable." >&5
0efd7d
+$as_echo "$as_me: WARNING: libdebuginfod is missing or unusable; some features may be unavailable." >&2;}
0efd7d
+     fi
0efd7d
+elif test $pkg_failed = untried; then
0efd7d
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
0efd7d
+$as_echo "no" >&6; }
0efd7d
+	if test "x$with_debuginfod" = xyes; then
0efd7d
+       as_fn_error $? "\"--with-debuginfod was given, but libdebuginfod is missing or unusable.\"" "$LINENO" 5
0efd7d
+     else
0efd7d
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdebuginfod is missing or unusable; some features may be unavailable." >&5
0efd7d
+$as_echo "$as_me: WARNING: libdebuginfod is missing or unusable; some features may be unavailable." >&2;}
0efd7d
+     fi
0efd7d
+else
0efd7d
+	DEBUGINFOD_CFLAGS=$pkg_cv_DEBUGINFOD_CFLAGS
0efd7d
+	DEBUGINFOD_LIBS=$pkg_cv_DEBUGINFOD_LIBS
0efd7d
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
0efd7d
+$as_echo "yes" >&6; }
0efd7d
 
0efd7d
-    if test "$with_debuginfod" = yes; then
0efd7d
-      as_fn_error $? "debuginfod is missing or unusable" "$LINENO" 5
0efd7d
-    else
0efd7d
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: debuginfod is missing or unusable; some features may be unavailable." >&5
0efd7d
-$as_echo "$as_me: WARNING: debuginfod is missing or unusable; some features may be unavailable." >&2;}
0efd7d
-    fi
0efd7d
-  fi
0efd7d
+$as_echo "#define HAVE_LIBDEBUGINFOD 1" >>confdefs.h
0efd7d
+
0efd7d
+fi
0efd7d
+else
0efd7d
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: debuginfod support disabled; some features may be unavailable." >&5
0efd7d
+$as_echo "$as_me: WARNING: debuginfod support disabled; some features may be unavailable." >&2;}
0efd7d
 fi
0efd7d
 
0efd7d