Check in mach cthread fixes. Should make non-pthread detection

work better.
This commit is contained in:
Kurt Zeilenga 1998-11-01 18:11:11 +00:00
parent 222ffb4a4a
commit 1c0f451699
3 changed files with 292 additions and 214 deletions

462
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -439,16 +439,45 @@ int argc; char **argv;
fi
fi
if test $ol_with_threads = auto -o $ol_with_threads = cthreads ; then
if test $ol_with_threads = auto -o $ol_with_threads = mach ; then
dnl check for Mach CThreads
AC_CHECK_HEADERS(mach/cthreads.h)
if test $ac_cv_header_lwp_lwp_h = yes ; then
AC_CHECK_LIB(lwp, cthread_fork, [have_cthreads=yes], [have_cthreads=no])
if test $ac_cv_header_mach_cthreads_h = yes ; then
ol_with_threads=found
if test $have_cthreads = yes ; then
AC_DEFINE(HAVE_MACH_CTHREADS)
LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
dnl A few platforms have cthread support in standard libraries
AC_CHECK_FUNC(cthread_fork,[ol_link_threads=yes])
if test $ol_link_threads = no ; then
dnl try -all_load
dnl this test needs work
AC_CACHE_CHECK([for cthread_fork with -all_load],
[ol_cv_cthread_all_load], [
dnl save the CPPFLAGS
save_LIBS="$LIBS"
LIBS="-all_load $LIBS"
AC_TRY_LINK([#include <mach/cthreads.h>],[
cthread_fork((void *)0, (void *)0);
], ol_cv_cthread_all_load=yes, ol_cv_cthread_all_load=no)
dnl restore the LIBS
LIBS="$save_LIBS"
])
if test $ol_cv_cthread_all_load = yes ; then
LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
ol_link_threads=mach
fi
fi
if test $ol_link_threads != no ; then
: check for cthread specific functionality here
else
AC_MSG_ERROR([could not link with Mach CThreads])
fi
fi
if test $ol_with_threads = mach ; then
AC_MSG_ERROR([could not locate Mach CThreads])
fi
fi

View File

@ -140,9 +140,6 @@ is provided ``as is'' without express or implied warranty.
/* define if you have NDBM */
#undef HAVE_NDBM
/* define if you have Mach CThreads */
#undef HAVE_MACH_CTHREADS
/* define if you have a preemptive POSIX Threads implementation */
#undef HAVE_PREEMPTIVE_PTHREADS