configure: Check for unw_step() instead of unw_getcontext().

unw_getcontext() can be inlined.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-09-12 11:38:30 +02:00
parent 6033b3a7fb
commit 4c0f59ddbc
2 changed files with 31 additions and 31 deletions

40
configure vendored
View File

@ -14893,9 +14893,9 @@ $as_echo "$as_me:${as_lineno-$LINENO}: libunwind cflags: $UNWIND_CFLAGS" >&5
$as_echo "$as_me:${as_lineno-$LINENO}: libunwind libs: $UNWIND_LIBS" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: libunwind libs: $UNWIND_LIBS" >&5
ac_save_CPPFLAGS=$CPPFLAGS ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $UNWIND_CFLAGS" CPPFLAGS="$CPPFLAGS $UNWIND_CFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_getcontext" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_step" >&5
$as_echo_n "checking for unw_getcontext... " >&6; } $as_echo_n "checking for unw_step... " >&6; }
if ${wine_cv_have_unw_getcontext+:} false; then : if ${wine_cv_have_unw_step+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@ -14905,28 +14905,28 @@ else
int int
main () main ()
{ {
unw_context_t context; unw_getcontext( &context ); unw_context_t context; unw_step( &context );
; ;
return 0; return 0;
} }
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
wine_cv_have_unw_getcontext="yes" wine_cv_have_unw_step="yes"
else else
wine_cv_have_unw_getcontext="no" wine_cv_have_unw_step="no"
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_unw_getcontext" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_unw_step" >&5
$as_echo "$wine_cv_have_unw_getcontext" >&6; } $as_echo "$wine_cv_have_unw_step" >&6; }
if test "$wine_cv_have_unw_getcontext" = no -a -n "$UNWIND_LIBS" if test "$wine_cv_have_unw_step" = no -a -n "$UNWIND_LIBS"
then then
save_libs=$LIBS save_libs=$LIBS
LIBS="$UNWIND_LIBS $LIBS" LIBS="$UNWIND_LIBS $LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_getcontext in libunwind" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_step in libunwind" >&5
$as_echo_n "checking for unw_getcontext in libunwind... " >&6; } $as_echo_n "checking for unw_step in libunwind... " >&6; }
if ${wine_cv_have_libunwind_unw_getcontext+:} false; then : if ${wine_cv_have_libunwind_unw_step+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@ -14936,25 +14936,25 @@ else
int int
main () main ()
{ {
unw_context_t context; unw_getcontext( &context ); unw_context_t context; unw_step( &context );
; ;
return 0; return 0;
} }
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
wine_cv_have_libunwind_unw_getcontext="yes" wine_cv_have_libunwind_unw_step="yes"
else else
wine_cv_have_libunwind_unw_getcontext="no" wine_cv_have_libunwind_unw_step="no"
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_libunwind_unw_getcontext" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $wine_cv_have_libunwind_unw_step" >&5
$as_echo "$wine_cv_have_libunwind_unw_getcontext" >&6; } $as_echo "$wine_cv_have_libunwind_unw_step" >&6; }
LIBS=$save_libs LIBS=$save_libs
fi fi
test "$wine_cv_have_libunwind_unw_getcontext" = yes || UNWIND_LIBS="" test "$wine_cv_have_libunwind_unw_step" = yes || UNWIND_LIBS=""
if test "x$wine_cv_have_unw_getcontext$wine_cv_have_libunwind_unw_getcontext" != xnono if test "x$wine_cv_have_unw_step$wine_cv_have_libunwind_unw_step" != xnono
then then
$as_echo "#define HAVE_LIBUNWIND 1" >>confdefs.h $as_echo "#define HAVE_LIBUNWIND 1" >>confdefs.h
@ -14967,7 +14967,7 @@ test -z "$UNWIND_LIBS" || UNWIND_LIBS=`echo " $UNWIND_LIBS" | sed 's/ -L\([^/]\)
fi fi
case $host in case $host in
aarch64*|*-darwin*) aarch64*|*-darwin*)
if test "x$wine_cv_have_unw_getcontext$wine_cv_have_libunwind_unw_getcontext" != xnono; then : if test "x$wine_cv_have_unw_step$wine_cv_have_libunwind_unw_step" != xnono; then :
case "x$with_unwind" in case "x$with_unwind" in
x) as_fn_append wine_notices "|libunwind ${notice_platform}development files not found, stack unwinding won't work." ;; x) as_fn_append wine_notices "|libunwind ${notice_platform}development files not found, stack unwinding won't work." ;;
xno) ;; xno) ;;

View File

@ -1694,32 +1694,32 @@ dnl **** Check for libuwind ****
if test "x$with_unwind" != xno if test "x$with_unwind" != xno
then then
WINE_PACKAGE_FLAGS(UNWIND,[libunwind],[-lunwind],,, WINE_PACKAGE_FLAGS(UNWIND,[libunwind],[-lunwind],,,
[AC_CACHE_CHECK([for unw_getcontext],wine_cv_have_unw_getcontext, [AC_CACHE_CHECK([for unw_step],wine_cv_have_unw_step,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define UNW_LOCAL_ONLY [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define UNW_LOCAL_ONLY
#include <libunwind.h>]], #include <libunwind.h>]],
[[unw_context_t context; unw_getcontext( &context );]])], [[unw_context_t context; unw_step( &context );]])],
[wine_cv_have_unw_getcontext="yes"],[wine_cv_have_unw_getcontext="no"])]) [wine_cv_have_unw_step="yes"],[wine_cv_have_unw_step="no"])])
if test "$wine_cv_have_unw_getcontext" = no -a -n "$UNWIND_LIBS" if test "$wine_cv_have_unw_step" = no -a -n "$UNWIND_LIBS"
then then
save_libs=$LIBS save_libs=$LIBS
LIBS="$UNWIND_LIBS $LIBS" LIBS="$UNWIND_LIBS $LIBS"
AC_CACHE_CHECK([for unw_getcontext in libunwind],wine_cv_have_libunwind_unw_getcontext, AC_CACHE_CHECK([for unw_step in libunwind],wine_cv_have_libunwind_unw_step,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define UNW_LOCAL_ONLY [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define UNW_LOCAL_ONLY
#include <libunwind.h>]], #include <libunwind.h>]],
[[unw_context_t context; unw_getcontext( &context );]])], [[unw_context_t context; unw_step( &context );]])],
[wine_cv_have_libunwind_unw_getcontext="yes"], [wine_cv_have_libunwind_unw_step="yes"],
[wine_cv_have_libunwind_unw_getcontext="no"])]) [wine_cv_have_libunwind_unw_step="no"])])
LIBS=$save_libs LIBS=$save_libs
fi fi
test "$wine_cv_have_libunwind_unw_getcontext" = yes || UNWIND_LIBS="" test "$wine_cv_have_libunwind_unw_step" = yes || UNWIND_LIBS=""
if test "x$wine_cv_have_unw_getcontext$wine_cv_have_libunwind_unw_getcontext" != xnono if test "x$wine_cv_have_unw_step$wine_cv_have_libunwind_unw_step" != xnono
then then
AC_DEFINE(HAVE_LIBUNWIND,1,[Define to 1 if you have the `unwind' library (-lunwind).]) AC_DEFINE(HAVE_LIBUNWIND,1,[Define to 1 if you have the `unwind' library (-lunwind).])
fi]) fi])
fi fi
case $host in case $host in
aarch64*|*-darwin*) aarch64*|*-darwin*)
WINE_NOTICE_WITH(unwind,[test "x$wine_cv_have_unw_getcontext$wine_cv_have_libunwind_unw_getcontext" != xnono], WINE_NOTICE_WITH(unwind,[test "x$wine_cv_have_unw_step$wine_cv_have_libunwind_unw_step" != xnono],
[libunwind ${notice_platform}development files not found, stack unwinding won't work.]) ;; [libunwind ${notice_platform}development files not found, stack unwinding won't work.]) ;;
esac esac