Check for features missing in mingw environment, allowing tools

subdirectory to be cross-built again.
This commit is contained in:
Paul Millar 2004-12-07 17:19:54 +00:00 committed by Alexandre Julliard
parent b100339e2f
commit 10a6c56071
5 changed files with 161 additions and 1 deletions

129
configure vendored
View File

@ -16192,6 +16192,7 @@ fi
for ac_func in \ for ac_func in \
@ -16240,6 +16241,7 @@ for ac_func in \
sendmsg \ sendmsg \
settimeofday \ settimeofday \
sigaltstack \ sigaltstack \
sigprocmask \
snprintf \ snprintf \
spawnvp \ spawnvp \
statfs \ statfs \
@ -17436,6 +17438,71 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _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 fi
@ -17507,6 +17574,68 @@ _ACEOF
fi 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 "$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 echo $ECHO_N "checking whether we can use re-entrant gethostbyname_r Linux style... $ECHO_C" >&6

View File

@ -1158,6 +1158,7 @@ AC_CHECK_FUNCS(\
sendmsg \ sendmsg \
settimeofday \ settimeofday \
sigaltstack \ sigaltstack \
sigprocmask \
snprintf \ snprintf \
spawnvp \ spawnvp \
statfs \ statfs \
@ -1244,6 +1245,7 @@ dnl **** Check for types ****
AC_C_CONST AC_C_CONST
AC_C_INLINE 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([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], AC_CACHE_CHECK([whether linux/input.h is for real],
wine_cv_linux_input_h, 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]) [Define if we have linux/input.h AND it contains the INPUT event API])
fi 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], AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
wine_cv_linux_gethostbyname_r_6, wine_cv_linux_gethostbyname_r_6,

View File

@ -494,15 +494,24 @@
/* Define to 1 if you have the `settimeofday' function. */ /* Define to 1 if you have the `settimeofday' function. */
#undef HAVE_SETTIMEOFDAY #undef HAVE_SETTIMEOFDAY
/* Define if sigaddset is supported */
#undef HAVE_SIGADDSET
/* Define to 1 if you have the `sigaltstack' function. */ /* Define to 1 if you have the `sigaltstack' function. */
#undef HAVE_SIGALTSTACK #undef HAVE_SIGALTSTACK
/* Define to 1 if `si_fd' is member of `siginfo_t'. */ /* Define to 1 if `si_fd' is member of `siginfo_t'. */
#undef HAVE_SIGINFO_T_SI_FD #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 */ /* Define to 1 if you have the sigsetjmp (and siglongjmp) function */
#undef HAVE_SIGSETJMP #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'. */ /* Define to 1 if the system has the type `size_t'. */
#undef HAVE_SIZE_T #undef HAVE_SIZE_T

View File

@ -421,7 +421,9 @@ int main(int argc, char **argv)
{ {
DLLSPEC *spec = alloc_dll_spec(); DLLSPEC *spec = alloc_dll_spec();
#ifdef SIGHUP
signal( SIGHUP, exit_on_signal ); signal( SIGHUP, exit_on_signal );
#endif
signal( SIGTERM, exit_on_signal ); signal( SIGTERM, exit_on_signal );
signal( SIGINT, exit_on_signal ); signal( SIGINT, exit_on_signal );

View File

@ -138,7 +138,9 @@ static const char* app_loader_template =
static int keep_generated = 0; static int keep_generated = 0;
static strarray* tmp_files; static strarray* tmp_files;
#ifdef HAVE_SIGSET_T
static sigset_t signal_mask; static sigset_t signal_mask;
#endif
struct options struct options
{ {
@ -180,11 +182,13 @@ static void exit_on_signal( int sig )
static char* get_temp_file(const char* prefix, const char* suffix) static char* get_temp_file(const char* prefix, const char* suffix)
{ {
int fd; int fd;
sigset_t old_set;
char* tmp = strmake("%s-XXXXXX%s", prefix, suffix); char* tmp = strmake("%s-XXXXXX%s", prefix, suffix);
#ifdef HAVE_SIGPROCMASK
sigset_t old_set;
/* block signals while manipulating the temp files list */ /* block signals while manipulating the temp files list */
sigprocmask( SIG_BLOCK, &signal_mask, &old_set ); sigprocmask( SIG_BLOCK, &signal_mask, &old_set );
#endif
fd = mkstemps( tmp, strlen(suffix) ); fd = mkstemps( tmp, strlen(suffix) );
if (fd == -1) if (fd == -1)
{ {
@ -196,7 +200,9 @@ static char* get_temp_file(const char* prefix, const char* suffix)
} }
close( fd ); close( fd );
strarray_add(tmp_files, tmp); strarray_add(tmp_files, tmp);
#ifdef HAVE_SIGPROCMASK
sigprocmask( SIG_SETMASK, &old_set, NULL ); sigprocmask( SIG_SETMASK, &old_set, NULL );
#endif
return tmp; return tmp;
} }
@ -700,13 +706,17 @@ int main(int argc, char **argv)
char* lang = 0; char* lang = 0;
char* str; char* str;
#ifdef SIGHUP
signal( SIGHUP, exit_on_signal ); signal( SIGHUP, exit_on_signal );
#endif
signal( SIGTERM, exit_on_signal ); signal( SIGTERM, exit_on_signal );
signal( SIGINT, exit_on_signal ); signal( SIGINT, exit_on_signal );
#ifdef HAVE_SIGADDSET
sigemptyset( &signal_mask ); sigemptyset( &signal_mask );
sigaddset( &signal_mask, SIGHUP ); sigaddset( &signal_mask, SIGHUP );
sigaddset( &signal_mask, SIGTERM ); sigaddset( &signal_mask, SIGTERM );
sigaddset( &signal_mask, SIGINT ); sigaddset( &signal_mask, SIGINT );
#endif
/* setup tmp file removal at exit */ /* setup tmp file removal at exit */
tmp_files = strarray_alloc(); tmp_files = strarray_alloc();