Skip to content

Commit

Permalink
Add libiberty library
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCirdo committed Apr 10, 2024
1 parent 1ff81e6 commit 0dff544
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ To install on the local system run `make install`. By default `make install` ins
- default: *no*
- possible values:
- unwind-ptrace: use unwind-ptrace to get the backtraces
* `--enable-iberty`:
enable the demangling support for the backtraces
- default: *no*

## Runtime dependencies:
`htop` has a set of fixed minimum runtime dependencies, which is kept as minimal as possible:
Expand Down
32 changes: 32 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,37 @@ if test "x$enable_backtrace" = xunwind-ptrace; then
AC_DEFINE([HAVE_BACKTRACE], [1], [Define if the backtraces is enabled])
fi

AC_ARG_ENABLE([demangling],
[AS_HELP_STRING([--enable-demangling],
[enable demangling support for backtraces @<:@default=check@:>@])],
[],
[enable_demangling=check])
case "$enable_demangling" in
check)
enable_demangling=yes
AC_CHECK_HEADERS([demangle.h], [], [
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I/usr/include/libiberty"
AC_CHECK_HEADERS([libiberty/demangle.h], [], [
enable_demangling=no
CFLAGS="$old_CFLAGS"
])
])
;;
no)
;;
yes)
AC_CHECK_LIB([iberty], [cplus_demangle], [], [AC_MSG_ERROR([can not find required library iberty])])
AC_CHECK_HEADERS([demangle.h], [], [
CFLAGS="$CFLAGS -I/usr/include/libiberty"
AC_CHECK_HEADERS([libiberty/demangle.h], [], [AC_MSG_ERROR([can not find required header file libiberty/demange.h])])
])
;;
*)
AC_MSG_ERROR([bad value '$enable_demangling' for --enable-iberty])
;;
esac

AC_ARG_ENABLE([hwloc],
[AS_HELP_STRING([--enable-hwloc],
[enable hwloc support for CPU affinity; disables affinity support; requires libhwloc @<:@default=no@:>@])],
Expand Down Expand Up @@ -897,6 +928,7 @@ AC_MSG_RESULT([
affinity: $enable_affinity
unwind: $enable_unwind
backtrace: $enable_backtrace
demangling: $enable_demangling
hwloc: $enable_hwloc
debug: $enable_debug
static: $enable_static
Expand Down

0 comments on commit 0dff544

Please sign in to comment.