From 52138d20148188f9694a50d7b44d5e4485da2e61 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Sat, 25 Jun 2005 11:06:24 +0000 Subject: [PATCH] We HAVE_PTHREADS even if we use our own pthreads implementation, this also induces availability of locking primitives. I will merge the !HAVE_PTHREADS case (a la Basilisk II) for EMULATED_PPC when I get back to home. --- SheepShaver/src/Unix/configure.ac | 10 ++++++---- SheepShaver/src/Unix/sysdeps.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/SheepShaver/src/Unix/configure.ac b/SheepShaver/src/Unix/configure.ac index db02e96b..5377a93e 100644 --- a/SheepShaver/src/Unix/configure.ac +++ b/SheepShaver/src/Unix/configure.ac @@ -185,7 +185,9 @@ no:linux*|no:netbsd*) AC_CHECK_LIB(pthread, pthread_create, , [ AC_CHECK_LIB(c_r, pthread_create, , [ AC_CHECK_LIB(PTL, pthread_create, , [ - AC_MSG_ERROR([You need pthreads to run Basilisk II.]) + dnl XXX remove when no pthreads case is merged + AC_MSG_ERROR([You need pthreads to run SheepShaver.]) + HAVE_PTHREADS=no ]) ]) ]) @@ -193,9 +195,6 @@ no:linux*|no:netbsd*) AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) AC_CHECK_FUNCS(pthread_mutexattr_settype) AC_CHECK_FUNCS(pthread_mutexattr_setpshared) - if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then - AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) - fi dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. SEMSRC= AC_CHECK_FUNCS(sem_init, , [ @@ -205,6 +204,9 @@ no:linux*|no:netbsd*) ]) ;; esac +if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then + AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) +fi dnl We use FBDev DGA if possible. if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then diff --git a/SheepShaver/src/Unix/sysdeps.h b/SheepShaver/src/Unix/sysdeps.h index b51bb225..e1d94b99 100644 --- a/SheepShaver/src/Unix/sysdeps.h +++ b/SheepShaver/src/Unix/sysdeps.h @@ -428,7 +428,7 @@ typedef struct timeval tm_time_t; extern uint64 GetTicks_usec(void); extern void Delay_usec(uint32 usec); -#if defined(HAVE_PTHREADS) || ((defined(__linux__) || defined(__NetBSD__)) && defined(__powerpc__)) +#ifdef HAVE_PTHREADS // Setup pthread attributes extern void Set_pthread_attr(pthread_attr_t *attr, int priority); #endif