configure: Add a check for sys/ucontext.h and include it where appropriate.

oldstable
Alexandre Julliard 2014-07-23 16:30:13 +02:00
parent 1b2977420e
commit 8d817997ce
10 changed files with 36 additions and 41 deletions

12
configure vendored
View File

@ -6812,13 +6812,13 @@ fi
done
for ac_header in ucontext.h
for ac_header in sys/ucontext.h
do :
ac_fn_c_check_header_compile "$LINENO" "ucontext.h" "ac_cv_header_ucontext_h" "#include <signal.h>
ac_fn_c_check_header_compile "$LINENO" "sys/ucontext.h" "ac_cv_header_sys_ucontext_h" "#include <signal.h>
"
if test "x$ac_cv_header_ucontext_h" = xyes; then :
if test "x$ac_cv_header_sys_ucontext_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_UCONTEXT_H 1
#define HAVE_SYS_UCONTEXT_H 1
_ACEOF
fi
@ -6829,8 +6829,8 @@ done
for ac_header in sys/thr.h
do :
ac_fn_c_check_header_compile "$LINENO" "sys/thr.h" "ac_cv_header_sys_thr_h" "#include <sys/types.h>
#ifdef HAVE_UCONTEXT_H
#include <ucontext.h>
#ifdef HAVE_SYS_UCONTEXT_H
#include <sys/ucontext.h>
#endif
"
if test "x$ac_cv_header_sys_thr_h" = xyes; then :

View File

@ -631,12 +631,12 @@ AC_CHECK_HEADERS([resolv.h],,,
AC_CHECK_HEADERS([ifaddrs.h],,,[#include <sys/types.h>])
AC_CHECK_HEADERS(ucontext.h,,,[#include <signal.h>])
AC_CHECK_HEADERS(sys/ucontext.h,,,[#include <signal.h>])
AC_CHECK_HEADERS([sys/thr.h],,,
[#include <sys/types.h>
#ifdef HAVE_UCONTEXT_H
#include <ucontext.h>
#ifdef HAVE_SYS_UCONTEXT_H
#include <sys/ucontext.h>
#endif])
AC_CHECK_HEADERS([pthread_np.h],,,

View File

@ -63,8 +63,10 @@
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
#ifdef HAVE_SYS_UCONTEXT_H
# include <sys/ucontext.h>
#endif
#ifdef HAVE_SYS_THR_H
#include <sys/ucontext.h>
#include <sys/thr.h>
#endif
#ifdef HAVE_UNISTD_H

View File

@ -32,7 +32,6 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
@ -46,6 +45,9 @@
#ifdef HAVE_SYS_SIGNAL_H
# include <sys/signal.h>
#endif
#ifdef HAVE_SYS_UCONTEXT_H
# include <sys/ucontext.h>
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
@ -68,7 +70,7 @@ static pthread_key_t teb_key;
*/
#ifdef linux
#ifdef __ANDROID__
#if defined(__ANDROID__) && !defined(HAVE_SYS_UCONTEXT_H)
typedef struct ucontext
{
unsigned long uc_flags;

View File

@ -31,7 +31,6 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
@ -45,6 +44,9 @@
#ifdef HAVE_SYS_SIGNAL_H
# include <sys/signal.h>
#endif
#ifdef HAVE_SYS_UCONTEXT_H
# include <sys/ucontext.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS

View File

@ -32,7 +32,6 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
@ -43,17 +42,18 @@
# include <sys/syscall.h>
# endif
#endif
#ifdef HAVE_SYS_VM86_H
# include <sys/vm86.h>
#endif
#ifdef HAVE_SYS_SIGNAL_H
# include <sys/signal.h>
#endif
#ifdef HAVE_SYS_SYSCTL_H
# include <sys/sysctl.h>
#endif
#ifdef HAVE_SYS_UCONTEXT_H
# include <sys/ucontext.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
@ -313,7 +313,6 @@ typedef struct sigcontext SIGCONTEXT;
#ifdef _SCO_DS
#include <sys/regset.h>
#endif
#include <sys/ucontext.h>
typedef struct ucontext SIGCONTEXT;
#ifdef _SCO_DS
@ -357,7 +356,6 @@ typedef struct ucontext SIGCONTEXT;
#define FPUX_sig(context) NULL /* FIXME */
#elif defined (__APPLE__)
# include <sys/ucontext.h>
typedef ucontext_t SIGCONTEXT;
@ -407,9 +405,6 @@ typedef ucontext_t SIGCONTEXT;
#endif
#elif defined(__NetBSD__)
# include <sys/ucontext.h>
# include <sys/types.h>
# include <signal.h>
typedef ucontext_t SIGCONTEXT;

View File

@ -28,10 +28,10 @@
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
@ -42,10 +42,12 @@
# include <sys/syscall.h>
# endif
#endif
#ifdef HAVE_SYS_SIGNAL_H
# include <sys/signal.h>
#endif
#ifdef HAVE_SYS_UCONTEXT_H
# include <sys/ucontext.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
@ -94,9 +96,6 @@ static pthread_key_t teb_key;
#ifdef __APPLE__
# include <sys/ucontext.h>
# include <sys/types.h>
/* All Registers access - only for local access */
# define REG_sig(reg_name, context) ((context)->uc_mcontext->ss.reg_name)
# define FLOATREG_sig(reg_name, context) ((context)->uc_mcontext->fs.reg_name)

View File

@ -28,25 +28,22 @@
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#ifdef HAVE_UCONTEXT_H
# include <ucontext.h>
#endif
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_MACHINE_SYSARCH_H
# include <machine/sysarch.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_SIGNAL_H
# include <sys/signal.h>
#endif
#ifdef HAVE_SYS_UCONTEXT_H
# include <sys/ucontext.h>
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
@ -165,7 +162,6 @@ extern int arch_prctl(int func, void *ptr);
#define FPU_sig(context) ((XMM_SAVE_AREA32 *)((context)->uc_mcontext.fpregs))
#elif defined(__FreeBSD__) || defined (__FreeBSD_kernel__)
#include <sys/ucontext.h>
#define RAX_sig(context) ((context)->uc_mcontext.mc_rax)
#define RBX_sig(context) ((context)->uc_mcontext.mc_rbx)
@ -200,9 +196,6 @@ extern int arch_prctl(int func, void *ptr);
#define FPU_sig(context) ((XMM_SAVE_AREA32 *)((context)->uc_mcontext.mc_fpstate))
#elif defined(__NetBSD__)
#include <sys/ucontext.h>
#include <sys/types.h>
#include <signal.h>
#define RAX_sig(context) ((context)->uc_mcontext.__gregs[_REG_RAX])
#define RBX_sig(context) ((context)->uc_mcontext.__gregs[_REG_RBX])

View File

@ -1038,6 +1038,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/ucontext.h> header file. */
#undef HAVE_SYS_UCONTEXT_H
/* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
@ -1077,9 +1080,6 @@
/* Define if you have the timezone variable */
#undef HAVE_TIMEZONE
/* Define to 1 if you have the <ucontext.h> header file. */
#undef HAVE_UCONTEXT_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

View File

@ -40,8 +40,10 @@
#ifdef HAVE_SYS_SYSCALL_H
# include <sys/syscall.h>
#endif
#ifdef HAVE_SYS_THR_H
#ifdef HAVE_SYS_UCONTEXT_H
# include <sys/ucontext.h>
#endif
#ifdef HAVE_SYS_THR_H
# include <sys/thr.h>
#endif
#include <unistd.h>