xref: /netbsd-src/external/gpl3/gdb/dist/config/debuginfod.m4 (revision 782713e6c126f1866c6d9cfdee4ceb49483b5828)
1dnl Copyright (C) 1997-2020 Free Software Foundation, Inc.
2dnl This file is free software, distributed under the terms of the GNU
3dnl General Public License.  As a special exception to the GNU General
4dnl Public License, this file may be distributed as part of a program
5dnl that contains a configuration script generated by Autoconf, under
6dnl the same distribution terms as the rest of that program.
7
8m4_include([../config/pkg.m4])
9
10AC_DEFUN([AC_DEBUGINFOD],
11[
12# Handle optional debuginfod support
13AC_ARG_WITH([debuginfod],
14  AC_HELP_STRING([--with-debuginfod], [Enable debuginfo lookups with debuginfod (auto/yes/no)]),
15  [], [with_debuginfod=auto])
16AC_MSG_CHECKING([whether to use debuginfod])
17AC_MSG_RESULT([$with_debuginfod])
18
19if test "x$with_debuginfod" != xno; then
20  PKG_CHECK_MODULES([DEBUGINFOD], [libdebuginfod >= 0.179],
21    [AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])],
22    [if test "x$with_debuginfod" = xyes; then
23       AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."])
24     else
25       AC_MSG_WARN([libdebuginfod is missing or unusable; some features may be unavailable.])
26     fi])
27else
28  AC_MSG_WARN([debuginfod support disabled; some features may be unavailable.])
29fi
30])
31