1*f22f0ef4Schristosdnl Copyright (C) 1997-2020 Free Software Foundation, Inc.
2f7172901Schristosdnl This file is free software, distributed under the terms of the GNU
3f7172901Schristosdnl General Public License.  As a special exception to the GNU General
4f7172901Schristosdnl Public License, this file may be distributed as part of a program
5f7172901Schristosdnl that contains a configuration script generated by Autoconf, under
6f7172901Schristosdnl the same distribution terms as the rest of that program.
7f7172901Schristos
8f7172901SchristosAC_DEFUN([AC_DEBUGINFOD],
9f7172901Schristos[
10*f22f0ef4Schristos# Handle optional debuginfod support
11f7172901SchristosAC_ARG_WITH([debuginfod],
12*f22f0ef4Schristos  AC_HELP_STRING([--with-debuginfod], [Enable debuginfo lookups with debuginfod (auto/yes/no)]),
13f7172901Schristos  [], [with_debuginfod=auto])
14f7172901SchristosAC_MSG_CHECKING([whether to use debuginfod])
15f7172901SchristosAC_MSG_RESULT([$with_debuginfod])
16f7172901Schristos
17*f22f0ef4Schristosif test "x$with_debuginfod" != xno; then
18*f22f0ef4Schristos  PKG_CHECK_MODULES([DEBUGINFOD], [libdebuginfod >= 0.179],
19*f22f0ef4Schristos    [AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])],
20*f22f0ef4Schristos    [if test "x$with_debuginfod" = xyes; then
21*f22f0ef4Schristos       AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."])
22*f22f0ef4Schristos     else
23*f22f0ef4Schristos       AC_MSG_WARN([libdebuginfod is missing or unusable; some features may be unavailable.])
24*f22f0ef4Schristos     fi])
25*f22f0ef4Schristoselse
26f7172901Schristos  AC_MSG_WARN([debuginfod support disabled; some features may be unavailable.])
27f7172901Schristosfi
28f7172901Schristos])
29