Search for <libiberty/demangle.h> in addition to <demangle.h>

This is the location where this header is installed on Debian-based
systems.

* configure.ac: Check for libiberty/demangle.h in addition to
demangle.h.
* unwind.c [USE_DEMANGLE]: Include either <demangle.h> or
<libiberty_demangle.h> based on the presence of HAVE_DEMANGLE_H and
HAVE_LIBIBERTY_DEMANGLE_H macros.
This commit is contained in:
Eugene Syromyatnikov 2018-01-09 20:23:01 +01:00 committed by Dmitry V. Levin
parent 459b13e1b8
commit 843369ebe1
2 changed files with 6 additions and 2 deletions

View File

@ -919,7 +919,7 @@ use_libiberty=no
AS_IF([test "x$use_libunwind" = xyes && test "x$with_libiberty" != xno],
[saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $libiberty_CPPFLAGS"
AC_CHECK_HEADERS([demangle.h],
AC_CHECK_HEADERS([demangle.h libiberty/demangle.h],
[saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $libiberty_LDFLAGS"
AC_CHECK_LIB([iberty],[cplus_demangle],

View File

@ -30,7 +30,11 @@
#include <libunwind-ptrace.h>
#ifdef USE_DEMANGLE
# include <demangle.h>
# if defined HAVE_DEMANGLE_H
# include <demangle.h>
# elif defined HAVE_LIBIBERTY_DEMANGLE_H
# include <libiberty/demangle.h>
# endif
#endif
#include "xstring.h"