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

This commit is contained in:
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 done
for ac_header in ucontext.h for ac_header in sys/ucontext.h
do : 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 cat >>confdefs.h <<_ACEOF
#define HAVE_UCONTEXT_H 1 #define HAVE_SYS_UCONTEXT_H 1
_ACEOF _ACEOF
fi fi
@ -6829,8 +6829,8 @@ done
for ac_header in sys/thr.h for ac_header in sys/thr.h
do : do :
ac_fn_c_check_header_compile "$LINENO" "sys/thr.h" "ac_cv_header_sys_thr_h" "#include <sys/types.h> ac_fn_c_check_header_compile "$LINENO" "sys/thr.h" "ac_cv_header_sys_thr_h" "#include <sys/types.h>
#ifdef HAVE_UCONTEXT_H #ifdef HAVE_SYS_UCONTEXT_H
#include <ucontext.h> #include <sys/ucontext.h>
#endif #endif
" "
if test "x$ac_cv_header_sys_thr_h" = xyes; then : 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([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],,, AC_CHECK_HEADERS([sys/thr.h],,,
[#include <sys/types.h> [#include <sys/types.h>
#ifdef HAVE_UCONTEXT_H #ifdef HAVE_SYS_UCONTEXT_H
#include <ucontext.h> #include <sys/ucontext.h>
#endif]) #endif])
AC_CHECK_HEADERS([pthread_np.h],,, AC_CHECK_HEADERS([pthread_np.h],,,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -28,25 +28,22 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_UCONTEXT_H
# include <ucontext.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
#ifdef HAVE_MACHINE_SYSARCH_H #ifdef HAVE_MACHINE_SYSARCH_H
# include <machine/sysarch.h> # include <machine/sysarch.h>
#endif #endif
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
# include <sys/param.h> # include <sys/param.h>
#endif #endif
#ifdef HAVE_SYS_SIGNAL_H #ifdef HAVE_SYS_SIGNAL_H
# include <sys/signal.h> # include <sys/signal.h>
#endif #endif
#ifdef HAVE_SYS_UCONTEXT_H
# include <sys/ucontext.h>
#endif
#define NONAMELESSUNION #define NONAMELESSUNION
#define NONAMELESSSTRUCT #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)) #define FPU_sig(context) ((XMM_SAVE_AREA32 *)((context)->uc_mcontext.fpregs))
#elif defined(__FreeBSD__) || defined (__FreeBSD_kernel__) #elif defined(__FreeBSD__) || defined (__FreeBSD_kernel__)
#include <sys/ucontext.h>
#define RAX_sig(context) ((context)->uc_mcontext.mc_rax) #define RAX_sig(context) ((context)->uc_mcontext.mc_rax)
#define RBX_sig(context) ((context)->uc_mcontext.mc_rbx) #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)) #define FPU_sig(context) ((XMM_SAVE_AREA32 *)((context)->uc_mcontext.mc_fpstate))
#elif defined(__NetBSD__) #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 RAX_sig(context) ((context)->uc_mcontext.__gregs[_REG_RAX])
#define RBX_sig(context) ((context)->uc_mcontext.__gregs[_REG_RBX]) #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. */ /* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H #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. */ /* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H #undef HAVE_SYS_UIO_H
@ -1077,9 +1080,6 @@
/* Define if you have the timezone variable */ /* Define if you have the timezone variable */
#undef HAVE_TIMEZONE #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. */ /* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H

View File

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