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

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