Message ID | 20121026030909.GA6580@bromo.med.uc.edu |
---|---|
State | New |
Headers | show |
Jack Howarth <howarth@bromo.med.uc.edu> writes: > 2012-10-25 Jack Howarth <howarth@bromo.med.uc.edu> > > target/PR55061 > * configure.ac: Check for _Unwind_GetIPInfo function declaration. > * configure: Regenerate. > > Index: libbacktrace/configure.ac > =================================================================== > --- libbacktrace/configure.ac (revision 192824) > +++ libbacktrace/configure.ac (working copy) > @@ -129,8 +129,15 @@ AC_SUBST(WARN_FLAGS) > if test -n "${with_target_subdir}"; then > GCC_CHECK_UNWIND_GETIPINFO > else > - AC_CHECK_FUNC(_Unwind_GetIPInfo, [have_unwind_getipinfo=yes], > + ac_save_CFLAGS="$CFLAGS" > + CFLAGS="$CFLAGS -Werror-implicit-function-declaration" > + AC_TRY_COMPILE([#include "unwind.h"], [ > + struct _Unwind_Context *context; > + int ip_before_insn = 0; > + return _Unwind_GetIPInfo (context, &ip_before_insn); > + ], [have_unwind_getipinfo=yes], > [have_unwind_getipinfo=no]) > + CFLAGS="$ac_save_CFLAGS" > if test "$have_unwind_getipinfo" = "yes"; then > AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.]) > fi AC_TRY_COMPILE is considered to be obsolete. Can you rewrite in terms of the currently approved AC_COMPILE_IFELSE? When doing that, use AC_LANG_PROGRAM. As the autoconf manual says: -- Macro: AC_TRY_COMPILE (INCLUDES, FUNCTION-BODY, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) Same as: AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[INCLUDES]], [[FUNCTION-BODY]])], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) Ian
Index: libbacktrace/configure.ac =================================================================== --- libbacktrace/configure.ac (revision 192824) +++ libbacktrace/configure.ac (working copy) @@ -129,8 +129,15 @@ AC_SUBST(WARN_FLAGS) if test -n "${with_target_subdir}"; then GCC_CHECK_UNWIND_GETIPINFO else - AC_CHECK_FUNC(_Unwind_GetIPInfo, [have_unwind_getipinfo=yes], + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror-implicit-function-declaration" + AC_TRY_COMPILE([#include "unwind.h"], [ + struct _Unwind_Context *context; + int ip_before_insn = 0; + return _Unwind_GetIPInfo (context, &ip_before_insn); + ], [have_unwind_getipinfo=yes], [have_unwind_getipinfo=no]) + CFLAGS="$ac_save_CFLAGS" if test "$have_unwind_getipinfo" = "yes"; then AC_DEFINE(HAVE_GETIPINFO, 1, [Define if _Unwind_GetIPInfo is available.]) fi