Skip to content

Commit 783653f

Browse files
nmarleyUdjinM6
authored andcommitted
Ensure execinfo.h and linker flags set in autoconf (#3098)
* Ensure execinfo.h and linker flags set in autoconf * Only check for backtrace() if not Windows
1 parent 7320c3d commit 783653f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

configure.ac

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ if test x$TARGET_OS = xdarwin; then
631631
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
632632
fi
633633

634-
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])
634+
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h execinfo.h])
635635

636636
AC_CHECK_DECLS([strnlen])
637637

@@ -735,6 +735,13 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
735735
[ AC_MSG_RESULT(no)]
736736
)
737737

738+
# ensure backtrace() is found, check -lexecinfo if necessary
739+
if test x$TARGET_OS != xwindows; then
740+
AC_SEARCH_LIBS([backtrace], [execinfo], [], [
741+
AC_MSG_ERROR([Unable to find backtrace()])
742+
])
743+
fi
744+
738745
# Check for reduced exports
739746
if test x$use_reduce_exports = xyes; then
740747
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],

0 commit comments

Comments
 (0)