提交 83147222 编写于 作者: D Daniel Gustafsson

Add libexecinfo check for OpenBSD

In order to use backtrace() in error reporting on OpenBSD we need
to link with libexecinfo from ports as backtrace() is a glibc only
addition.
上级 70a33737
......@@ -12294,6 +12294,57 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
# OpenBSD requires libexecinfo from ports for backtrace() as it's a glibc addition
if test "$PORTNAME" = "openbsd"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lexecinfo" >&5
$as_echo_n "checking for backtrace in -lexecinfo... " >&6; }
if ${ac_cv_lib_execinfo_backtrace+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lexecinfo $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char backtrace ();
int
main ()
{
return backtrace ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_execinfo_backtrace=yes
else
ac_cv_lib_execinfo_backtrace=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5
$as_echo "$ac_cv_lib_execinfo_backtrace" >&6; }
if test "x$ac_cv_lib_execinfo_backtrace" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBEXECINFO 1
_ACEOF
LIBS="-lexecinfo $LIBS"
else
as_fn_error $? "library 'execinfo' is required for backtrace support" "$LINENO" 5
fi
fi
##
......@@ -13319,6 +13370,24 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
# OpenBSD requires libexecinfo from ports for backtrace() as it's a glibc addition
if test "$PORTNAME" = "openbsd"; then
for ac_header in execinfo.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default"
if test "x$ac_cv_header_execinfo_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_EXECINFO_H 1
_ACEOF
else
as_fn_error $? "header file <execinfo.h> is required for backtrace support" "$LINENO" 5
fi
done
fi
##
......
......@@ -1397,6 +1397,11 @@ if test "$enable_orca" = yes; then
PGAC_CHECK_ORCA_LIBS
fi
# OpenBSD requires libexecinfo from ports for backtrace() as it's a glibc addition
if test "$PORTNAME" = "openbsd"; then
AC_CHECK_LIB(execinfo, backtrace, [], [AC_MSG_ERROR([library 'execinfo' is required for backtrace support])])
fi
##
## Header files
##
......@@ -1576,6 +1581,11 @@ if test "$enable_orca" = yes; then
PGAC_CHECK_ORCA_VERSION
fi
# OpenBSD requires libexecinfo from ports for backtrace() as it's a glibc addition
if test "$PORTNAME" = "openbsd"; then
AC_CHECK_HEADERS([execinfo.h], [], [AC_MSG_ERROR([header file <execinfo.h> is required for backtrace support])])
fi
##
## Types, structures, compiler characteristics
##
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册