Blame m4/threadlib.m4

Packit 709fb3
# threadlib.m4 serial 12
Packit 709fb3
dnl Copyright (C) 2005-2017 Free Software Foundation, Inc.
Packit 709fb3
dnl This file is free software; the Free Software Foundation
Packit 709fb3
dnl gives unlimited permission to copy and/or distribute it,
Packit 709fb3
dnl with or without modifications, as long as this notice is preserved.
Packit 709fb3
Packit 709fb3
dnl From Bruno Haible.
Packit 709fb3
Packit 709fb3
dnl gl_THREADLIB
Packit 709fb3
dnl ------------
Packit 709fb3
dnl Tests for a multithreading library to be used.
Packit 709fb3
dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
Packit 709fb3
dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
Packit 709fb3
dnl default is 'no', otherwise it is system dependent. In both cases, the user
Packit 709fb3
dnl can change the choice through the options --enable-threads=choice or
Packit 709fb3
dnl --disable-threads.
Packit 709fb3
dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
Packit 709fb3
dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
Packit 709fb3
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
Packit 709fb3
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
Packit 709fb3
dnl libtool).
Packit 709fb3
dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
Packit 709fb3
dnl programs that really need multithread functionality. The difference
Packit 709fb3
dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
Packit 709fb3
dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
Packit 709fb3
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
Packit 709fb3
dnl multithread-safe programs.
Packit 709fb3
Packit 709fb3
AC_DEFUN([gl_THREADLIB_EARLY],
Packit 709fb3
[
Packit 709fb3
  AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
Packit 709fb3
])
Packit 709fb3
Packit 709fb3
dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
Packit 709fb3
Packit 709fb3
AC_DEFUN([gl_THREADLIB_EARLY_BODY],
Packit 709fb3
[
Packit 709fb3
  dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
Packit 709fb3
  dnl influences the result of the autoconf tests that test for *_unlocked
Packit 709fb3
  dnl declarations, on AIX 5 at least. Therefore it must come early.
Packit 709fb3
  AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
Packit 709fb3
  AC_BEFORE([$0], [gl_ARGP])dnl
Packit 709fb3
Packit 709fb3
  AC_REQUIRE([AC_CANONICAL_HOST])
Packit 709fb3
  dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
Packit 709fb3
  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
Packit 709fb3
  dnl AC_GNU_SOURCE.
Packit 709fb3
  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
Packit 709fb3
    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
Packit 709fb3
    [AC_REQUIRE([AC_GNU_SOURCE])])
Packit 709fb3
  dnl Check for multithreading.
Packit 709fb3
  m4_ifdef([gl_THREADLIB_DEFAULT_NO],
Packit 709fb3
    [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
Packit 709fb3
    [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
Packit 709fb3
  AC_ARG_ENABLE([threads],
Packit 709fb3
AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
Packit 709fb3
AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
Packit 709fb3
    [gl_use_threads=$enableval],
Packit 709fb3
    [if test -n "$gl_use_threads_default"; then
Packit 709fb3
       gl_use_threads="$gl_use_threads_default"
Packit 709fb3
     else
Packit 709fb3
changequote(,)dnl
Packit 709fb3
       case "$host_os" in
Packit 709fb3
         dnl Disable multithreading by default on OSF/1, because it interferes
Packit 709fb3
         dnl with fork()/exec(): When msgexec is linked with -lpthread, its
Packit 709fb3
         dnl child process gets an endless segmentation fault inside execvp().
Packit 709fb3
         dnl Disable multithreading by default on Cygwin 1.5.x, because it has
Packit 709fb3
         dnl bugs that lead to endless loops or crashes. See
Packit 709fb3
         dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
Packit 709fb3
         osf*) gl_use_threads=no ;;
Packit 709fb3
         cygwin*)
Packit 709fb3
               case `uname -r` in
Packit 709fb3
                 1.[0-5].*) gl_use_threads=no ;;
Packit 709fb3
                 *)         gl_use_threads=yes ;;
Packit 709fb3
               esac
Packit 709fb3
               ;;
Packit 709fb3
         *)    gl_use_threads=yes ;;
Packit 709fb3
       esac
Packit 709fb3
changequote([,])dnl
Packit 709fb3
     fi
Packit 709fb3
    ])
Packit 709fb3
  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
Packit 709fb3
    # For using <pthread.h>:
Packit 709fb3
    case "$host_os" in
Packit 709fb3
      osf*)
Packit 709fb3
        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
Packit 709fb3
        # groks <pthread.h>. cc also understands the flag -pthread, but
Packit 709fb3
        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
Packit 709fb3
        # 2. putting a flag into CPPFLAGS that has an effect on the linker
Packit 709fb3
        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
Packit 709fb3
        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
Packit 709fb3
        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
Packit 709fb3
        ;;
Packit 709fb3
    esac
Packit 709fb3
    # Some systems optimize for single-threaded programs by default, and
Packit 709fb3
    # need special flags to disable these optimizations. For example, the
Packit 709fb3
    # definition of 'errno' in <errno.h>.
Packit 709fb3
    case "$host_os" in
Packit 709fb3
      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
Packit 709fb3
      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
Packit 709fb3
    esac
Packit 709fb3
  fi
Packit 709fb3
])
Packit 709fb3
Packit 709fb3
dnl The guts of gl_THREADLIB. Needs to be expanded only once.
Packit 709fb3
Packit 709fb3
AC_DEFUN([gl_THREADLIB_BODY],
Packit 709fb3
[
Packit 709fb3
  AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
Packit 709fb3
  gl_threads_api=none
Packit 709fb3
  LIBTHREAD=
Packit 709fb3
  LTLIBTHREAD=
Packit 709fb3
  LIBMULTITHREAD=
Packit 709fb3
  LTLIBMULTITHREAD=
Packit 709fb3
  if test "$gl_use_threads" != no; then
Packit 709fb3
    dnl Check whether the compiler and linker support weak declarations.
Packit 709fb3
    AC_CACHE_CHECK([whether imported symbols can be declared weak],
Packit 709fb3
      [gl_cv_have_weak],
Packit 709fb3
      [gl_cv_have_weak=no
Packit 709fb3
       dnl First, test whether the compiler accepts it syntactically.
Packit 709fb3
       AC_LINK_IFELSE(
Packit 709fb3
         [AC_LANG_PROGRAM(
Packit 709fb3
            [[extern void xyzzy ();
Packit 709fb3
#pragma weak xyzzy]],
Packit 709fb3
            [[xyzzy();]])],
Packit 709fb3
         [gl_cv_have_weak=maybe])
Packit 709fb3
       if test $gl_cv_have_weak = maybe; then
Packit 709fb3
         dnl Second, test whether it actually works. On Cygwin 1.7.2, with
Packit 709fb3
         dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
Packit 709fb3
         AC_RUN_IFELSE(
Packit 709fb3
           [AC_LANG_SOURCE([[
Packit 709fb3
#include <stdio.h>
Packit 709fb3
#pragma weak fputs
Packit 709fb3
int main ()
Packit 709fb3
{
Packit 709fb3
  return (fputs == NULL);
Packit 709fb3
}]])],
Packit 709fb3
           [gl_cv_have_weak=yes],
Packit 709fb3
           [gl_cv_have_weak=no],
Packit 709fb3
           [dnl When cross-compiling, assume that only ELF platforms support
Packit 709fb3
            dnl weak symbols.
Packit 709fb3
            AC_EGREP_CPP([Extensible Linking Format],
Packit 709fb3
              [#ifdef __ELF__
Packit 709fb3
               Extensible Linking Format
Packit 709fb3
               #endif
Packit 709fb3
              ],
Packit 709fb3
              [gl_cv_have_weak="guessing yes"],
Packit 709fb3
              [gl_cv_have_weak="guessing no"])
Packit 709fb3
           ])
Packit 709fb3
       fi
Packit 709fb3
      ])
Packit 709fb3
    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
Packit 709fb3
      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
Packit 709fb3
      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
Packit 709fb3
      AC_CHECK_HEADER([pthread.h],
Packit 709fb3
        [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
Packit 709fb3
      if test "$gl_have_pthread_h" = yes; then
Packit 709fb3
        # Other possible tests:
Packit 709fb3
        #   -lpthreads (FSU threads, PCthreads)
Packit 709fb3
        #   -lgthreads
Packit 709fb3
        gl_have_pthread=
Packit 709fb3
        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
Packit 709fb3
        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
Packit 709fb3
        # the second one only in libpthread, and lock.c needs it.
Packit 709fb3
        #
Packit 709fb3
        # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
Packit 709fb3
        # needs -pthread for some reason.  See:
Packit 709fb3
        # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
Packit 709fb3
        save_LIBS=$LIBS
Packit 709fb3
        for gl_pthread in '' '-pthread'; do
Packit 709fb3
          LIBS="$LIBS $gl_pthread"
Packit 709fb3
          AC_LINK_IFELSE(
Packit 709fb3
            [AC_LANG_PROGRAM(
Packit 709fb3
               [[#include <pthread.h>
Packit 709fb3
                 pthread_mutex_t m;
Packit 709fb3
                 pthread_mutexattr_t ma;
Packit 709fb3
               ]],
Packit 709fb3
               [[pthread_mutex_lock (&m);
Packit 709fb3
                 pthread_mutexattr_init (&ma);]])],
Packit 709fb3
            [gl_have_pthread=yes
Packit 709fb3
             LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
Packit 709fb3
             LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread])
Packit 709fb3
          LIBS=$save_LIBS
Packit 709fb3
          test -n "$gl_have_pthread" && break
Packit 709fb3
        done
Packit 709fb3
Packit 709fb3
        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
Packit 709fb3
        # since it is defined as a macro on OSF/1.)
Packit 709fb3
        if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then
Packit 709fb3
          # The program links fine without libpthread. But it may actually
Packit 709fb3
          # need to link with libpthread in order to create multiple threads.
Packit 709fb3
          AC_CHECK_LIB([pthread], [pthread_kill],
Packit 709fb3
            [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
Packit 709fb3
             # On Solaris and HP-UX, most pthread functions exist also in libc.
Packit 709fb3
             # Therefore pthread_in_use() needs to actually try to create a
Packit 709fb3
             # thread: pthread_create from libc will fail, whereas
Packit 709fb3
             # pthread_create will actually create a thread.
Packit 709fb3
             # On Solaris 10 or newer, this test is no longer needed, because
Packit 709fb3
             # libc contains the fully functional pthread functions.
Packit 709fb3
             case "$host_os" in
Packit 709fb3
               solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
Packit 709fb3
                 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
Packit 709fb3
                   [Define if the pthread_in_use() detection is hard.])
Packit 709fb3
             esac
Packit 709fb3
            ])
Packit 709fb3
        elif test -z "$gl_have_pthread"; then
Packit 709fb3
          # Some library is needed. Try libpthread and libc_r.
Packit 709fb3
          AC_CHECK_LIB([pthread], [pthread_kill],
Packit 709fb3
            [gl_have_pthread=yes
Packit 709fb3
             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
Packit 709fb3
             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
Packit 709fb3
          if test -z "$gl_have_pthread"; then
Packit 709fb3
            # For FreeBSD 4.
Packit 709fb3
            AC_CHECK_LIB([c_r], [pthread_kill],
Packit 709fb3
              [gl_have_pthread=yes
Packit 709fb3
               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
Packit 709fb3
               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
Packit 709fb3
          fi
Packit 709fb3
        fi
Packit 709fb3
        if test -n "$gl_have_pthread"; then
Packit 709fb3
          gl_threads_api=posix
Packit 709fb3
          AC_DEFINE([USE_POSIX_THREADS], [1],
Packit 709fb3
            [Define if the POSIX multithreading library can be used.])
Packit 709fb3
          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
Packit 709fb3
            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
Packit 709fb3
              AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
Packit 709fb3
                [Define if references to the POSIX multithreading library should be made weak.])
Packit 709fb3
              LIBTHREAD=
Packit 709fb3
              LTLIBTHREAD=
Packit 709fb3
            fi
Packit 709fb3
          fi
Packit 709fb3
        fi
Packit 709fb3
      fi
Packit 709fb3
    fi
Packit 709fb3
    if test -z "$gl_have_pthread"; then
Packit 709fb3
      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
Packit 709fb3
        gl_have_solaristhread=
Packit 709fb3
        gl_save_LIBS="$LIBS"
Packit 709fb3
        LIBS="$LIBS -lthread"
Packit 709fb3
        AC_LINK_IFELSE(
Packit 709fb3
          [AC_LANG_PROGRAM(
Packit 709fb3
             [[
Packit 709fb3
#include <thread.h>
Packit 709fb3
#include <synch.h>
Packit 709fb3
             ]],
Packit 709fb3
             [[thr_self();]])],
Packit 709fb3
          [gl_have_solaristhread=yes])
Packit 709fb3
        LIBS="$gl_save_LIBS"
Packit 709fb3
        if test -n "$gl_have_solaristhread"; then
Packit 709fb3
          gl_threads_api=solaris
Packit 709fb3
          LIBTHREAD=-lthread
Packit 709fb3
          LTLIBTHREAD=-lthread
Packit 709fb3
          LIBMULTITHREAD="$LIBTHREAD"
Packit 709fb3
          LTLIBMULTITHREAD="$LTLIBTHREAD"
Packit 709fb3
          AC_DEFINE([USE_SOLARIS_THREADS], [1],
Packit 709fb3
            [Define if the old Solaris multithreading library can be used.])
Packit 709fb3
          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
Packit 709fb3
            AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
Packit 709fb3
              [Define if references to the old Solaris multithreading library should be made weak.])
Packit 709fb3
            LIBTHREAD=
Packit 709fb3
            LTLIBTHREAD=
Packit 709fb3
          fi
Packit 709fb3
        fi
Packit 709fb3
      fi
Packit 709fb3
    fi
Packit 709fb3
    if test "$gl_use_threads" = pth; then
Packit 709fb3
      gl_save_CPPFLAGS="$CPPFLAGS"
Packit 709fb3
      AC_LIB_LINKFLAGS([pth])
Packit 709fb3
      gl_have_pth=
Packit 709fb3
      gl_save_LIBS="$LIBS"
Packit 709fb3
      LIBS="$LIBS $LIBPTH"
Packit 709fb3
      AC_LINK_IFELSE(
Packit 709fb3
        [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
Packit 709fb3
        [gl_have_pth=yes])
Packit 709fb3
      LIBS="$gl_save_LIBS"
Packit 709fb3
      if test -n "$gl_have_pth"; then
Packit 709fb3
        gl_threads_api=pth
Packit 709fb3
        LIBTHREAD="$LIBPTH"
Packit 709fb3
        LTLIBTHREAD="$LTLIBPTH"
Packit 709fb3
        LIBMULTITHREAD="$LIBTHREAD"
Packit 709fb3
        LTLIBMULTITHREAD="$LTLIBTHREAD"
Packit 709fb3
        AC_DEFINE([USE_PTH_THREADS], [1],
Packit 709fb3
          [Define if the GNU Pth multithreading library can be used.])
Packit 709fb3
        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
Packit 709fb3
          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
Packit 709fb3
            AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
Packit 709fb3
              [Define if references to the GNU Pth multithreading library should be made weak.])
Packit 709fb3
            LIBTHREAD=
Packit 709fb3
            LTLIBTHREAD=
Packit 709fb3
          fi
Packit 709fb3
        fi
Packit 709fb3
      else
Packit 709fb3
        CPPFLAGS="$gl_save_CPPFLAGS"
Packit 709fb3
      fi
Packit 709fb3
    fi
Packit 709fb3
    if test -z "$gl_have_pthread"; then
Packit 709fb3
      case "$gl_use_threads" in
Packit 709fb3
        yes | windows | win32) # The 'win32' is for backward compatibility.
Packit 709fb3
          if { case "$host_os" in
Packit 709fb3
                 mingw*) true;;
Packit 709fb3
                 *) false;;
Packit 709fb3
               esac
Packit 709fb3
             }; then
Packit 709fb3
            gl_threads_api=windows
Packit 709fb3
            AC_DEFINE([USE_WINDOWS_THREADS], [1],
Packit 709fb3
              [Define if the native Windows multithreading API can be used.])
Packit 709fb3
          fi
Packit 709fb3
          ;;
Packit 709fb3
      esac
Packit 709fb3
    fi
Packit 709fb3
  fi
Packit 709fb3
  AC_MSG_CHECKING([for multithread API to use])
Packit 709fb3
  AC_MSG_RESULT([$gl_threads_api])
Packit 709fb3
  AC_SUBST([LIBTHREAD])
Packit 709fb3
  AC_SUBST([LTLIBTHREAD])
Packit 709fb3
  AC_SUBST([LIBMULTITHREAD])
Packit 709fb3
  AC_SUBST([LTLIBMULTITHREAD])
Packit 709fb3
])
Packit 709fb3
Packit 709fb3
AC_DEFUN([gl_THREADLIB],
Packit 709fb3
[
Packit 709fb3
  AC_REQUIRE([gl_THREADLIB_EARLY])
Packit 709fb3
  AC_REQUIRE([gl_THREADLIB_BODY])
Packit 709fb3
])
Packit 709fb3
Packit 709fb3
Packit 709fb3
dnl gl_DISABLE_THREADS
Packit 709fb3
dnl ------------------
Packit 709fb3
dnl Sets the gl_THREADLIB default so that threads are not used by default.
Packit 709fb3
dnl The user can still override it at installation time, by using the
Packit 709fb3
dnl configure option '--enable-threads'.
Packit 709fb3
Packit 709fb3
AC_DEFUN([gl_DISABLE_THREADS], [
Packit 709fb3
  m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
Packit 709fb3
])
Packit 709fb3
Packit 709fb3
Packit 709fb3
dnl Survey of platforms:
Packit 709fb3
dnl
Packit 709fb3
dnl Platform           Available  Compiler    Supports   test-lock
Packit 709fb3
dnl                    flavours   option      weak       result
Packit 709fb3
dnl ---------------    ---------  ---------   --------   ---------
Packit 709fb3
dnl Linux 2.4/glibc    posix      -lpthread       Y      OK
Packit 709fb3
dnl
Packit 709fb3
dnl GNU Hurd/glibc     posix
Packit 709fb3
dnl
Packit 709fb3
dnl Ubuntu 14.04       posix      -pthread        Y      OK
Packit 709fb3
dnl
Packit 709fb3
dnl FreeBSD 5.3        posix      -lc_r           Y
Packit 709fb3
dnl                    posix      -lkse ?         Y
Packit 709fb3
dnl                    posix      -lpthread ?     Y
Packit 709fb3
dnl                    posix      -lthr           Y
Packit 709fb3
dnl
Packit 709fb3
dnl FreeBSD 5.2        posix      -lc_r           Y
Packit 709fb3
dnl                    posix      -lkse           Y
Packit 709fb3
dnl                    posix      -lthr           Y
Packit 709fb3
dnl
Packit 709fb3
dnl FreeBSD 4.0,4.10   posix      -lc_r           Y      OK
Packit 709fb3
dnl
Packit 709fb3
dnl NetBSD 1.6         --
Packit 709fb3
dnl
Packit 709fb3
dnl OpenBSD 3.4        posix      -lpthread       Y      OK
Packit 709fb3
dnl
Packit 709fb3
dnl Mac OS X 10.[123]  posix      -lpthread       Y      OK
Packit 709fb3
dnl
Packit 709fb3
dnl Solaris 7,8,9      posix      -lpthread       Y      Sol 7,8: 0.0; Sol 9: OK
Packit 709fb3
dnl                    solaris    -lthread        Y      Sol 7,8: 0.0; Sol 9: OK
Packit 709fb3
dnl
Packit 709fb3
dnl HP-UX 11           posix      -lpthread       N (cc) OK
Packit 709fb3
dnl                                               Y (gcc)
Packit 709fb3
dnl
Packit 709fb3
dnl IRIX 6.5           posix      -lpthread       Y      0.5
Packit 709fb3
dnl
Packit 709fb3
dnl AIX 4.3,5.1        posix      -lpthread       N      AIX 4: 0.5; AIX 5: OK
Packit 709fb3
dnl
Packit 709fb3
dnl OSF/1 4.0,5.1      posix      -pthread (cc)   N      OK
Packit 709fb3
dnl                               -lpthread (gcc) Y
Packit 709fb3
dnl
Packit 709fb3
dnl Cygwin             posix      -lpthread       Y      OK
Packit 709fb3
dnl
Packit 709fb3
dnl Any of the above   pth        -lpth                  0.0
Packit 709fb3
dnl
Packit 709fb3
dnl Mingw              windows                    N      OK
Packit 709fb3
dnl
Packit 709fb3
dnl BeOS 5             --
Packit 709fb3
dnl
Packit 709fb3
dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
Packit 709fb3
dnl turned off:
Packit 709fb3
dnl   OK if all three tests terminate OK,
Packit 709fb3
dnl   0.5 if the first test terminates OK but the second one loops endlessly,
Packit 709fb3
dnl   0.0 if the first test already loops endlessly.