1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-06 20:20:20 +02:00

Added check that defines PTHREAD_ATTR_GETSTACK_WORKS when

pthread_attr_getstack works for the main thread.
This commit is contained in:
Marius Vollmer 2006-03-25 22:06:25 +00:00
parent 1e85890c0e
commit d48f1dffa7
2 changed files with 44 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2006-03-26 Marius Vollmer <mvo@zagadka.de>
* configure.in: Added check that defines
PTHREAD_ATTR_GETSTACK_WORKS when pthread_attr_getstack works for
the main thread.
2006-02-26 Kevin Ryde <user42@zip.com.au> 2006-02-26 Kevin Ryde <user42@zip.com.au>
* configure.in (AC_CHECK_FUNCS): Add dirfd. * configure.in (AC_CHECK_FUNCS): Add dirfd.

View file

@ -1026,6 +1026,44 @@ esac
AC_MSG_CHECKING(what kind of threads to support) AC_MSG_CHECKING(what kind of threads to support)
AC_MSG_RESULT($with_threads) AC_MSG_RESULT($with_threads)
## Check whether pthread_attr_getstack works for the main thread
AC_MSG_CHECKING(whether pthread_attr_getstack works for the main thread)
old_CFLAGS="$CFLAGS"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
AC_TRY_RUN(
[
#if HAVE_PTHREAD_ATTR_GETSTACK
#include <pthread.h>
int main ()
{
pthread_attr_t attr;
void *start, *end;
size_t size;
pthread_getattr_np (pthread_self (), &attr);
pthread_attr_getstack (&attr, &start, &size);
end = (char *)start + size;
if ((void *)&attr < start || (void *)&attr >= end)
return 1;
else
return 0;
}
#else
int main ()
{
return 1;
}
#endif
],
[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"
AC_MSG_RESULT($works)
## Cross building ## Cross building
if test "$cross_compiling" = "yes"; then if test "$cross_compiling" = "yes"; then
AC_MSG_CHECKING(cc for build) AC_MSG_CHECKING(cc for build)