mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
(ACX_PTHREAD): Update to latest definition from
autoconf macro archive, to fix pthread linking problem on Solaris 10, reported by Charles Gagnon.
This commit is contained in:
parent
a844aadfcc
commit
8b3fbac12a
3 changed files with 38 additions and 33 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-06-06 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
|
* acinclude.m4 (ACX_PTHREAD): Update to latest definition from
|
||||||
|
autoconf macro archive, to fix pthread linking problem on Solaris
|
||||||
|
10, reported by Charles Gagnon.
|
||||||
|
|
||||||
2006-05-28 Kevin Ryde <user42@zip.com.au>
|
2006-05-28 Kevin Ryde <user42@zip.com.au>
|
||||||
|
|
||||||
* configure.in (isnan): Remove "#ifdef __MINGW32__, #define isnan
|
* configure.in (isnan): Remove "#ifdef __MINGW32__, #define isnan
|
||||||
|
|
1
THANKS
1
THANKS
|
@ -31,6 +31,7 @@ For fixes or providing information which led to a fix:
|
||||||
Alexandre Duret-Lutz
|
Alexandre Duret-Lutz
|
||||||
John W Eaton
|
John W Eaton
|
||||||
Clinton Ebadi
|
Clinton Ebadi
|
||||||
|
Charles Gagnon
|
||||||
Peter Gavin
|
Peter Gavin
|
||||||
Eric Gillespie, Jr
|
Eric Gillespie, Jr
|
||||||
John Goerzen
|
John Goerzen
|
||||||
|
|
64
acinclude.m4
64
acinclude.m4
|
@ -111,8 +111,8 @@ fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dnl Available from the GNU Autoconf Macro Archive at:
|
dnl Available from the Autoconf Macro Archive at:
|
||||||
dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
|
dnl http://autoconf-archive.cryp.to/acx_pthread.html
|
||||||
dnl
|
dnl
|
||||||
AC_DEFUN([ACX_PTHREAD], [
|
AC_DEFUN([ACX_PTHREAD], [
|
||||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||||
|
@ -170,6 +170,7 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m
|
||||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||||
# also defines -D_REENTRANT)
|
# also defines -D_REENTRANT)
|
||||||
|
# ... -mt is also the pthreads flag for HP/aCC
|
||||||
# pthread: Linux, etcetera
|
# pthread: Linux, etcetera
|
||||||
# --thread-safe: KAI C++
|
# --thread-safe: KAI C++
|
||||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||||
|
@ -179,13 +180,13 @@ case "${host_cpu}-${host_os}" in
|
||||||
|
|
||||||
# On Solaris (at least, for some versions), libc contains stubbed
|
# On Solaris (at least, for some versions), libc contains stubbed
|
||||||
# (non-functional) versions of the pthreads routines, so link-based
|
# (non-functional) versions of the pthreads routines, so link-based
|
||||||
# tests will erroneously succeed. (We need to link with -pthread or
|
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||||
# a function called by this macro, so we could check for that, but
|
# a function called by this macro, so we could check for that, but
|
||||||
# who knows whether they'll stub that too in a future libc.) So,
|
# who knows whether they'll stub that too in a future libc.) So,
|
||||||
# we'll just look for -pthreads and -lpthread first:
|
# we'll just look for -pthreads and -lpthread first:
|
||||||
|
|
||||||
acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
|
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -202,12 +203,12 @@ for flag in $acx_pthread_flags; do
|
||||||
PTHREAD_CFLAGS="$flag"
|
PTHREAD_CFLAGS="$flag"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pthread-config)
|
pthread-config)
|
||||||
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
|
||||||
if test x"$acx_pthread_config" = xno; then continue; fi
|
if test x"$acx_pthread_config" = xno; then continue; fi
|
||||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||||
|
@ -255,43 +256,40 @@ if test "x$acx_pthread_ok" = xyes; then
|
||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
|
||||||
# Detect AIX lossage: threads are created detached by default
|
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||||
# and the JOINABLE attribute has a nonstandard name (UNDETACHED).
|
|
||||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||||
AC_TRY_LINK([#include <pthread.h>],
|
attr_name=unknown
|
||||||
[int attr=PTHREAD_CREATE_JOINABLE;],
|
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||||
ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
|
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
|
||||||
if test x"$ok" = xunknown; then
|
[attr_name=$attr; break])
|
||||||
AC_TRY_LINK([#include <pthread.h>],
|
done
|
||||||
[int attr=PTHREAD_CREATE_UNDETACHED;],
|
AC_MSG_RESULT($attr_name)
|
||||||
ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
|
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||||
fi
|
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
|
||||||
if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
|
[Define to necessary symbol if this constant
|
||||||
AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
|
uses a non-standard name on your system.])
|
||||||
[Define to the necessary symbol if this constant
|
|
||||||
uses a non-standard name on your system.])
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT(${ok})
|
|
||||||
if test x"$ok" = xunknown; then
|
|
||||||
AC_MSG_WARN([we do not know how to create joinable pthreads])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||||
flag=no
|
flag=no
|
||||||
case "${host_cpu}-${host_os}" in
|
case "${host_cpu}-${host_os}" in
|
||||||
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
|
||||||
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
|
||||||
esac
|
esac
|
||||||
AC_MSG_RESULT(${flag})
|
AC_MSG_RESULT(${flag})
|
||||||
if test "x$flag" != xno; then
|
if test "x$flag" != xno; then
|
||||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBS="$save_LIBS"
|
LIBS="$save_LIBS"
|
||||||
CFLAGS="$save_CFLAGS"
|
CFLAGS="$save_CFLAGS"
|
||||||
|
|
||||||
# More AIX lossage: must compile with cc_r
|
# More AIX lossage: must compile with xlc_r or cc_r
|
||||||
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
|
if test x"$GCC" != xyes; then
|
||||||
|
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
|
||||||
|
else
|
||||||
|
PTHREAD_CC=$CC
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
PTHREAD_CC="$CC"
|
PTHREAD_CC="$CC"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue