Fixed pthreads build problems on OpenBSD (Bugzilla bug #20529) and FreeBSD.

Modified files: _freebsd.h, _openbsd.h, ptio.c, ptsynch.c,
pr/tests/Makefile
This commit is contained in:
wtc%netscape.com 1999-12-22 23:39:09 +00:00
Родитель 17da1b8e04
Коммит ce35f2bc20
5 изменённых файлов: 23 добавлений и 20 удалений

Просмотреть файл

@ -59,6 +59,8 @@
#define _PR_USE_POLL
#endif
#endif
#define _PR_HAVE_SYSV_SEMAPHORES
#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
#define USE_SETJMP

Просмотреть файл

@ -50,6 +50,10 @@
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_NO_LARGE_FILES
#define _PR_STAT_HAS_ST_ATIMESPEC
#define _PR_POLL_AVAILABLE
#define _PR_USE_POLL
#define _PR_HAVE_SYSV_SEMAPHORES
#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
#define USE_SETJMP
@ -204,6 +208,7 @@ struct _MDCPU {
* unwrapped version.
*/
#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
#include <poll.h>
#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
#if OpenBSD1_3 == 1L

Просмотреть файл

@ -123,7 +123,7 @@ static ssize_t (*pt_aix_sendfile_fptr)() = NULL;
#define _PRSockOptVal_t char *
#elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(HPUX) \
|| defined(LINUX) || defined(FREEBSD) || defined(BSDI) || defined(VMS) \
|| defined(NTO)
|| defined(NTO) || defined(OPENBSD)
#define _PRSockOptVal_t void *
#else
#error "Cannot determine architecture"

Просмотреть файл

@ -760,7 +760,8 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char *name)
/*
* From the semctl(2) man page in glibc 2.0
*/
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
#if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
|| defined(FREEBSD) || defined(OPENBSD)
/* union semun is defined by including <sys/sem.h> */
#else
/* according to X/OPEN we have to define it ourselves */

Просмотреть файл

@ -397,6 +397,12 @@ endif
LDOPTS += -Xlinker -R $(ABSOLUTE_LIB_DIR)
endif
ifeq ($(OS_ARCH),OpenBSD)
ifeq ($(USE_PTHREADS),1)
LDOPTS += -pthread
endif
endif
ifeq ($(OS_ARCH),BSD_OS)
ifneq ($(OS_RELEASE),1.1)
EXTRA_LIBS = -ldl
@ -404,26 +410,15 @@ endif
endif
ifeq ($(USE_PTHREADS),1)
LIBPTHREAD = -lpthread
ifeq ($(OS_ARCH),AIX)
LIBPTHREAD = -lpthreads
else
ifeq ($(OS_ARCH),FreeBSD)
LIBPTHREAD =
else
ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)
LIBPTHREAD = -ldce
else
ifeq ($(OS_ARCH),BSD_OS)
LIBPTHREAD =
else
ifeq ($(OS_ARCH),NTO)
LIBPTHREAD =
else
LIBPTHREAD = -lpthread
endif
endif
endif
endif
endif
ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS NTO,$(OS_ARCH)))
LIBPTHREAD =
endif
ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)
LIBPTHREAD = -ldce
endif
endif