From 1d00893110bd7cc68b49c751d4fd734610eac959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 15 Oct 2020 21:12:57 +0200 Subject: [PATCH] Automatically detect if backtrace(3) needs -lexecinfo --- Makefile.am | 3 +-- configure.ac | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index b6f0f975..085f763a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -154,7 +154,6 @@ freebsd_platform_headers = \ zfs/openzfs_sysctl.h if HTOP_FREEBSD -AM_LDFLAGS += -lexecinfo myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \ freebsd/FreeBSDProcess.c freebsd/Battery.c \ zfs/ZfsArcMeter.c zfs/ZfsCompressedArcMeter.c zfs/ZfsArcStats.c zfs/openzfs_sysctl.c @@ -172,7 +171,7 @@ dragonflybsd_platform_headers = \ dragonflybsd/Battery.h if HTOP_DRAGONFLYBSD -AM_LDFLAGS += -lkvm -lkinfo -lexecinfo +AM_LDFLAGS += -lkvm -lkinfo myhtopplatsources = dragonflybsd/Platform.c dragonflybsd/DragonFlyBSDProcessList.c \ dragonflybsd/DragonFlyBSDProcess.c dragonflybsd/Battery.c diff --git a/configure.ac b/configure.ac index 31d4a57c..b10d819a 100644 --- a/configure.ac +++ b/configure.ac @@ -92,6 +92,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [AC_MSG_ERROR([htop is written in C99. A newer compiler is required.])]) CFLAGS="$save_cflags" +# Add -lexecinfo if needed +AC_SEARCH_LIBS([backtrace], [execinfo]) + # Checks for features and flags. # ---------------------------------------------------------------------- PROCDIR=/proc