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

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