Skip to content

Commit

Permalink
configure: support libunwind of LLVM
Browse files Browse the repository at this point in the history
The libunwind headers of LLVM are located in the subdirectory
/usr/include/libunwind. Search that subdirectory when the default
header test fails. Also extend the include path due to the transitive
include of `<__libunwind_config.h>`.

Closes: #894
  • Loading branch information
cgzones authored and BenBE committed Dec 16, 2021
1 parent b45eaf2 commit 6388033
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,23 @@ case "$enable_unwind" in
AC_CHECK_LIB([lzma], [lzma_index_buffer_decode])
fi
AC_CHECK_LIB([unwind], [backtrace], [], [enable_unwind=no])
AC_CHECK_HEADERS([libunwind.h], [], [enable_unwind=no])
AC_CHECK_HEADERS([libunwind.h], [], [
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I/usr/include/libunwind"
AC_CHECK_HEADERS([libunwind/libunwind.h], [], [
enable_unwind=no
CFLAGS="$old_CFLAGS"
])
])
;;
no)
;;
yes)
AC_CHECK_LIB([unwind], [backtrace], [], [AC_MSG_ERROR([can not find required library libunwind])])
AC_CHECK_HEADERS([libunwind.h], [], [AC_MSG_ERROR([can not find require header file libunwind.h])])
AC_CHECK_HEADERS([libunwind.h], [], [
CFLAGS="$CFLAGS -I/usr/include/libunwind"
AC_CHECK_HEADERS([libunwind/libunwind.h], [], [AC_MSG_ERROR([can not find required header file libunwind.h])])
])
;;
*)
AC_MSG_ERROR([bad value '$enable_unwind' for --enable-unwind])
Expand Down

0 comments on commit 6388033

Please sign in to comment.