Commit 10a6c560 authored by Paul Millar's avatar Paul Millar Committed by Alexandre Julliard

Check for features missing in mingw environment, allowing tools

subdirectory to be cross-built again.
parent b100339e
......@@ -16194,6 +16194,7 @@ fi
for ac_func in \
_lwp_create \
_lwp_self \
......@@ -16240,6 +16241,7 @@ for ac_func in \
sendmsg \
settimeofday \
sigaltstack \
sigprocmask \
snprintf \
spawnvp \
statfs \
......@@ -17438,6 +17440,71 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking for sigset_t" >&5
echo $ECHO_N "checking for sigset_t... $ECHO_C" >&6
if test "${ac_cv_type_sigset_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <signal.h>
int
main ()
{
if ((sigset_t *) 0)
return 0;
if (sizeof (sigset_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_type_sigset_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_sigset_t=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_sigset_t" >&5
echo "${ECHO_T}$ac_cv_type_sigset_t" >&6
if test $ac_cv_type_sigset_t = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_SIGSET_T 1
_ACEOF
fi
echo "$as_me:$LINENO: checking whether linux/input.h is for real" >&5
echo $ECHO_N "checking whether linux/input.h is for real... $ECHO_C" >&6
......@@ -17507,6 +17574,68 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking for sigaddset" >&5
echo $ECHO_N "checking for sigaddset... $ECHO_C" >&6
if test "${wine_cv_have_sigaddset+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <signal.h>
int
main ()
{
sigset_t set; sigaddset(&set,SIGTERM);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
wine_cv_have_sigaddset=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
wine_cv_have_sigaddset=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $wine_cv_have_sigaddset" >&5
echo "${ECHO_T}$wine_cv_have_sigaddset" >&6
if test "$wine_cv_have_sigaddset" = "yes"
then
cat >>confdefs.h <<\_ACEOF
#define HAVE_SIGADDSET 1
_ACEOF
fi
echo "$as_me:$LINENO: checking whether we can use re-entrant gethostbyname_r Linux style" >&5
echo $ECHO_N "checking whether we can use re-entrant gethostbyname_r Linux style... $ECHO_C" >&6
......
......@@ -1158,6 +1158,7 @@ AC_CHECK_FUNCS(\
sendmsg \
settimeofday \
sigaltstack \
sigprocmask \
snprintf \
spawnvp \
statfs \
......@@ -1244,6 +1245,7 @@ dnl **** Check for types ****
AC_C_CONST
AC_C_INLINE
AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long, fsblkcnt_t, fsfilcnt_t])
AC_CHECK_TYPES([sigset_t],,,[#include <signal.h>])
AC_CACHE_CHECK([whether linux/input.h is for real],
wine_cv_linux_input_h,
......@@ -1265,6 +1267,14 @@ AC_CACHE_CHECK([whether linux/input.h is for real],
[Define if we have linux/input.h AND it contains the INPUT event API])
fi
AC_CACHE_CHECK([for sigaddset],wine_cv_have_sigaddset,
AC_TRY_LINK([#include <signal.h>],[sigset_t set; sigaddset(&set,SIGTERM);],
wine_cv_have_sigaddset=yes,wine_cv_have_sigaddset=no))
if test "$wine_cv_have_sigaddset" = "yes"
then
AC_DEFINE(HAVE_SIGADDSET, 1, [Define if sigaddset is supported])
fi
AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
wine_cv_linux_gethostbyname_r_6,
......
......@@ -494,15 +494,24 @@
/* Define to 1 if you have the `settimeofday' function. */
#undef HAVE_SETTIMEOFDAY
/* Define if sigaddset is supported */
#undef HAVE_SIGADDSET
/* Define to 1 if you have the `sigaltstack' function. */
#undef HAVE_SIGALTSTACK
/* Define to 1 if `si_fd' is member of `siginfo_t'. */
#undef HAVE_SIGINFO_T_SI_FD
/* Define to 1 if you have the `sigprocmask' function. */
#undef HAVE_SIGPROCMASK
/* Define to 1 if you have the sigsetjmp (and siglongjmp) function */
#undef HAVE_SIGSETJMP
/* Define to 1 if the system has the type `sigset_t'. */
#undef HAVE_SIGSET_T
/* Define to 1 if the system has the type `size_t'. */
#undef HAVE_SIZE_T
......
......@@ -421,7 +421,9 @@ int main(int argc, char **argv)
{
DLLSPEC *spec = alloc_dll_spec();
#ifdef SIGHUP
signal( SIGHUP, exit_on_signal );
#endif
signal( SIGTERM, exit_on_signal );
signal( SIGINT, exit_on_signal );
......
......@@ -138,7 +138,9 @@ static const char* app_loader_template =
static int keep_generated = 0;
static strarray* tmp_files;
#ifdef HAVE_SIGSET_T
static sigset_t signal_mask;
#endif
struct options
{
......@@ -180,11 +182,13 @@ static void exit_on_signal( int sig )
static char* get_temp_file(const char* prefix, const char* suffix)
{
int fd;
sigset_t old_set;
char* tmp = strmake("%s-XXXXXX%s", prefix, suffix);
#ifdef HAVE_SIGPROCMASK
sigset_t old_set;
/* block signals while manipulating the temp files list */
sigprocmask( SIG_BLOCK, &signal_mask, &old_set );
#endif
fd = mkstemps( tmp, strlen(suffix) );
if (fd == -1)
{
......@@ -196,7 +200,9 @@ static char* get_temp_file(const char* prefix, const char* suffix)
}
close( fd );
strarray_add(tmp_files, tmp);
#ifdef HAVE_SIGPROCMASK
sigprocmask( SIG_SETMASK, &old_set, NULL );
#endif
return tmp;
}
......@@ -700,13 +706,17 @@ int main(int argc, char **argv)
char* lang = 0;
char* str;
#ifdef SIGHUP
signal( SIGHUP, exit_on_signal );
#endif
signal( SIGTERM, exit_on_signal );
signal( SIGINT, exit_on_signal );
#ifdef HAVE_SIGADDSET
sigemptyset( &signal_mask );
sigaddset( &signal_mask, SIGHUP );
sigaddset( &signal_mask, SIGTERM );
sigaddset( &signal_mask, SIGINT );
#endif
/* setup tmp file removal at exit */
tmp_files = strarray_alloc();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment