diff options
author | Ismael Luceno <ismael@iodev.co.uk> | 2021-12-28 12:12:13 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-01-06 17:33:15 +0100 |
commit | 7c0a4e7ca36b93df4968182f92b3d52fd4d1bb01 (patch) | |
tree | f961e527926947e6eb98bf63f532eb58197c81a1 /configure.ac | |
parent | Fixed tdf#143142 when unable to scroll table column width properties. (diff) | |
download | core-7c0a4e7ca36b93df4968182f92b3d52fd4d1bb01.tar.gz core-7c0a4e7ca36b93df4968182f92b3d52fd4d1bb01.zip |
Add configure test for the backtrace implementation
Improve robustness by testing explicitly; instead of assuming based on
the OS, test first the libc and then test for libexecinfo.
The assumption was wrong for FreeBSD (included since 2017) and for
musl-based systems (not in libc).
Also, remove INCLUDE_BACKTRACE and clean up a bit.
Ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220271
Change-Id: Ib4b7fd4fe2cdf5f76babe47a21bd2990fcf42649
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127538
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
(cherry picked from commit c1be12396088563ed77ed61e54fd4e153469701d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127767
Reviewed-by: Ismael Luceno <ismael@iodev.co.uk>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index e1b75d2c10ad..aca958768d0a 100644 --- a/configure.ac +++ b/configure.ac @@ -1334,6 +1334,20 @@ if test $_os != "WINNT"; then fi AC_SUBST(DLOPEN_LIBS) +# Check for a (GNU) backtrace implementation +AC_ARG_VAR([BACKTRACE_CFLAGS], [Compiler flags needed to use backtrace(3)]) +AC_ARG_VAR([BACKTRACE_LIBS], [Linker flags needed to use backtrace(3)]) +AS_IF([test "x$BACKTRACE_LIBS$BACKTRACE_CFLAGS" = x], [ + save_LIBS="$LIBS" + AC_SEARCH_LIBS([backtrace], [libexecinfo], + [case "$ac_cv_search_backtrace" in -l*) BACKTRACE_LIBS="$ac_cv_search_backtrace";; esac], + [PKG_CHECK_MODULES([BACKTRACE], [libexecinfo], [ac_cv_search_backtrace=], [:])]) + LIBS="$save_LIBS" +]) +AS_IF([test "x$ac_cv_search_backtrace" != xno ], [ + AC_DEFINE([HAVE_FEATURE_BACKTRACE]) +]) + dnl =================================================================== dnl Sanity checks for Emscripten SDK setup dnl =================================================================== |