add checks for execinfo library

This commit is contained in:
Isaac Connor 2015-10-02 13:37:50 -04:00
parent 24b79e81bc
commit 2be61906a4
2 changed files with 11 additions and 2 deletions

View File

@ -191,13 +191,21 @@ if(NOT HAVE_LIBV4L1_VIDEODEV_H)
endif(NOT HAVE_LIBV4L1_VIDEODEV_H) endif(NOT HAVE_LIBV4L1_VIDEODEV_H)
check_include_file("linux/videodev2.h" HAVE_LINUX_VIDEODEV2_H) check_include_file("linux/videodev2.h" HAVE_LINUX_VIDEODEV2_H)
check_include_file("execinfo.h" HAVE_EXECINFO_H) check_include_file("execinfo.h" HAVE_EXECINFO_H)
if (HAVE_EXECINFO_H)
check_function_exists("backtrace" HAVE_DECL_BACKTRACE)
if (NOT HAVE_DECL_BACKTRACE)
find_library (EXECINFO_LIBRARY NAMES execinfo)
if (EXECINFO_LIBRARY)
list(APPEND ZM_BIN_LIBS "-l${EXECINFO_LIBRARY}")
endif (EXECINFO_LIBRARY)
endif (NOT HAVE_DECL_BACKTRACE)
check_function_exists("backtrace_symbols" HAVE_DECL_BACKTRACE_SYMBOLS)
endif (HAVE_EXECINFO_H)
check_include_file("ucontext.h" HAVE_UCONTEXT_H) check_include_file("ucontext.h" HAVE_UCONTEXT_H)
check_include_file("sys/sendfile.h" HAVE_SYS_SENDFILE_H) check_include_file("sys/sendfile.h" HAVE_SYS_SENDFILE_H)
check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H) check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H)
check_function_exists("syscall" HAVE_SYSCALL) check_function_exists("syscall" HAVE_SYSCALL)
check_function_exists("sendfile" HAVE_SENDFILE) check_function_exists("sendfile" HAVE_SENDFILE)
check_function_exists("backtrace" HAVE_DECL_BACKTRACE)
check_function_exists("backtrace_symbols" HAVE_DECL_BACKTRACE_SYMBOLS)
check_function_exists("posix_memalign" HAVE_POSIX_MEMALIGN) check_function_exists("posix_memalign" HAVE_POSIX_MEMALIGN)
check_type_size("siginfo_t" HAVE_SIGINFO_T) check_type_size("siginfo_t" HAVE_SIGINFO_T)
check_type_size("ucontext_t" HAVE_UCONTEXT_T) check_type_size("ucontext_t" HAVE_UCONTEXT_T)

View File

@ -442,6 +442,7 @@ fi
fi fi
AC_CHECK_DECLS(backtrace,,,[#include <execinfo.h>]) AC_CHECK_DECLS(backtrace,,,[#include <execinfo.h>])
AC_CHECK_DECLS(backtrace_symbols,,,[#include <execinfo.h>]) AC_CHECK_DECLS(backtrace_symbols,,,[#include <execinfo.h>])
AC_CHECK_LIB(execinfo,backtrace)
AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS)