Patch #497098: build support for GNU/Hurd.

This commit is contained in:
Martin v. Löwis 2002-01-01 18:41:33 +00:00
parent 65293680aa
commit a6e975801e
7 changed files with 342 additions and 255 deletions

View File

@ -301,6 +301,7 @@ Dom Mitchell
Doug Moen
The Dragon De Monsyne
Skip Montanaro
James A Morrison
Sape Mullender
Sjoerd Mullender
Michael Muller

View File

@ -30,6 +30,8 @@ C API
New platforms
- GNU/Hurd is now supported.
Tests
Windows

View File

@ -1,6 +1,11 @@
#ifdef MACH_C_THREADS
#include <mach/cthreads.h>
#endif
#ifdef HURD_C_THREADS
#include <cthreads.h>
#endif
/*
* Initialization.
@ -8,7 +13,14 @@
static void
PyThread__init_thread(void)
{
cthread_init();
#ifndef HURD_C_THREADS
/* Roland McGrath said this should not be used since this is
done while linking to threads */
cthread_init();
#else
/* do nothing */
;
#endif
}
/*
@ -127,10 +139,10 @@ PyThread_acquire_lock(PyThread_type_lock lock, int waitflag)
dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
if (waitflag) { /* blocking */
mutex_lock(lock);
mutex_lock((mutex_t)lock);
success = TRUE;
} else { /* non blocking */
success = mutex_try_lock(lock);
success = mutex_try_lock((mutex_t)lock);
}
dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
return success;

View File

@ -19,6 +19,12 @@
/* Define if you have the Mach cthreads package */
#undef C_THREADS
/* Define if you are using Mach cthreads under mach / */
#undef MACH_C_THREADS
/* Define if you are using Mach cthreads directly under /include */
#undef HURD_C_THREADS
/* Define to `long' if <time.h> doesn't define. */
#undef clock_t
@ -47,6 +53,9 @@
/* struct addrinfo (netdb.h) */
#undef HAVE_ADDRINFO
/* Define if you have the getaddrinfo function. */
#undef HAVE_GETADDRINFO
/* struct sockaddr_storage (sys/socket.h) */
#undef HAVE_SOCKADDR_STORAGE

541
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -796,7 +796,7 @@ then
# No framework. Ignore undefined symbols, assuming they come from Python
LDSHARED="$LDSHARED -flat_namespace -undefined suppress"
fi ;;
Linux*) LDSHARED="gcc -shared";;
Linux*|GNU*) LDSHARED="gcc -shared";;
dgux*) LDSHARED="ld -G";;
BSD/OS*/4*) LDSHARED="gcc -shared";;
OpenBSD*|NetBSD*|FreeBSD*)
@ -832,7 +832,7 @@ then
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
Linux*) CCSHARED="-fPIC";;
Linux*|GNU*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
@ -860,7 +860,7 @@ then
hp*|HP*)
LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
Linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
# -u __dummy makes the linker aware of the objc runtime
@ -1033,8 +1033,14 @@ else
AC_MSG_RESULT($unistd_defines_pthreads)
AC_DEFINE(_REENTRANT)
AC_CHECK_HEADER(cthreads.h, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(C_THREADS)
AC_DEFINE(HURD_C_THREADS)
LIBS="$LIBS -lthreads"
LIBOBJS="$LIBOBJS thread.o"],[
AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
AC_DEFINE(C_THREADS)
AC_DEFINE(MACH_C_THREADS)
LIBOBJS="$LIBOBJS thread.o"],[
AC_MSG_CHECKING(for --with-pth)
AC_ARG_WITH(pth,
@ -1088,7 +1094,7 @@ pthread_create (NULL, NULL, start_routine, NULL)], [
LIBS="$LIBS -lcma"
LIBOBJS="$LIBOBJS thread.o"],[
USE_THREAD_MODULE="#"])
])])])])])])])])])
])])])])])])])])])])
if test "$posix_threads" = "yes"; then
if test "$unistd_defines_pthreads" = "no"; then

View File

@ -93,6 +93,12 @@
/* Define if you have the Mach cthreads package */
#undef C_THREADS
/* Define if you are using Mach cthreads under mach / */
#undef MACH_C_THREADS
/* Define if you are using Mach cthreads directly under /include */
#undef HURD_C_THREADS
/* Define to `long' if <time.h> doesn't define. */
#undef clock_t
@ -121,6 +127,9 @@
/* struct addrinfo (netdb.h) */
#undef HAVE_ADDRINFO
/* Define if you have the getaddrinfo function. */
#undef HAVE_GETADDRINFO
/* struct sockaddr_storage (sys/socket.h) */
#undef HAVE_SOCKADDR_STORAGE
@ -402,9 +411,6 @@
/* Define if you have the gai_strerror function. */
#undef HAVE_GAI_STRERROR
/* Define if you have the getaddrinfo function. */
#undef HAVE_GETADDRINFO
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD