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

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