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
This commit is contained in:
Nathan Marley 2019-09-22 17:46:45 -03:00 committed by UdjinM6
parent 7320c3da24
commit 783653f6a8

View File

@ -631,7 +631,7 @@ if test x$TARGET_OS = xdarwin; then
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"]) AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
fi fi
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]) 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])
AC_CHECK_DECLS([strnlen]) AC_CHECK_DECLS([strnlen])
@ -735,6 +735,13 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
[ AC_MSG_RESULT(no)] [ AC_MSG_RESULT(no)]
) )
# ensure backtrace() is found, check -lexecinfo if necessary
if test x$TARGET_OS != xwindows; then
AC_SEARCH_LIBS([backtrace], [execinfo], [], [
AC_MSG_ERROR([Unable to find backtrace()])
])
fi
# Check for reduced exports # Check for reduced exports
if test x$use_reduce_exports = xyes; then if test x$use_reduce_exports = xyes; then
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"], AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],