mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 12:20:26 +02:00
don't run the `pthread_attr_getstack' check when cross compiling
* configure.ac: Run the `pthread_attr_getstack' test only when building natively. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
ec20a3c86d
commit
b016e12e95
1 changed files with 31 additions and 27 deletions
58
configure.ac
58
configure.ac
|
@ -1410,39 +1410,43 @@ AM_CONDITIONAL([BUILD_PTHREAD_SUPPORT],
|
||||||
|
|
||||||
if test "$with_threads" = pthreads; then
|
if test "$with_threads" = pthreads; then
|
||||||
|
|
||||||
AC_MSG_CHECKING(whether pthread_attr_getstack works for the main thread)
|
AC_MSG_CHECKING([whether pthread_attr_getstack works for the main thread])
|
||||||
old_CFLAGS="$CFLAGS"
|
old_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
|
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
|
||||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
if test "$cross_compiling" = "no"; then
|
||||||
#if HAVE_PTHREAD_ATTR_GETSTACK
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <pthread.h>
|
#if HAVE_PTHREAD_ATTR_GETSTACK
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
void *start, *end;
|
void *start, *end;
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
||||||
pthread_getattr_np (pthread_self (), &attr);
|
pthread_getattr_np (pthread_self (), &attr);
|
||||||
pthread_attr_getstack (&attr, &start, &size);
|
pthread_attr_getstack (&attr, &start, &size);
|
||||||
end = (char *)start + size;
|
end = (char *)start + size;
|
||||||
|
|
||||||
if ((void *)&attr < start || (void *)&attr >= end)
|
if ((void *)&attr < start || (void *)&attr >= end)
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
int main ()
|
||||||
|
{
|
||||||
return 1;
|
return 1;
|
||||||
else
|
}
|
||||||
return 0;
|
#endif
|
||||||
}
|
]])],
|
||||||
#else
|
[works=yes
|
||||||
int main ()
|
AC_DEFINE([PTHREAD_ATTR_GETSTACK_WORKS], [1], [Define when pthread_att_get_stack works for the main thread])],
|
||||||
{
|
[works=no],
|
||||||
return 1;
|
[])
|
||||||
}
|
else
|
||||||
#endif
|
works="assuming it doesn't"
|
||||||
]])],
|
fi
|
||||||
[works=yes
|
|
||||||
AC_DEFINE([PTHREAD_ATTR_GETSTACK_WORKS], [1], [Define when pthread_att_get_stack works for the main thread])],
|
|
||||||
[works=no],
|
|
||||||
[])
|
|
||||||
CFLAGS="$old_CFLAGS"
|
CFLAGS="$old_CFLAGS"
|
||||||
AC_MSG_RESULT($works)
|
AC_MSG_RESULT($works)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue