diff options
author | wtc%netscape.com <devnull@localhost> | 1999-12-22 23:39:09 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 1999-12-22 23:39:09 +0000 |
commit | 3c35a7d0cd25cc27ec5e371a53671f6889eebc45 (patch) | |
tree | 94024f94aed28d7a9d97bd0886af86001c9a16bc | |
parent | 11dfaaa64d58404b52b565a02d5d0041a0e749ff (diff) | |
download | nspr-hg-3c35a7d0cd25cc27ec5e371a53671f6889eebc45.tar.gz |
Fixed pthreads build problems on OpenBSD (Bugzilla bug #20529) and FreeBSD.
Modified files: _freebsd.h, _openbsd.h, ptio.c, ptsynch.c,
pr/tests/Makefile
-rw-r--r-- | pr/include/md/_freebsd.h | 2 | ||||
-rw-r--r-- | pr/include/md/_openbsd.h | 5 | ||||
-rw-r--r-- | pr/src/pthreads/ptio.c | 2 | ||||
-rw-r--r-- | pr/src/pthreads/ptsynch.c | 3 | ||||
-rw-r--r-- | pr/tests/Makefile | 31 |
5 files changed, 23 insertions, 20 deletions
diff --git a/pr/include/md/_freebsd.h b/pr/include/md/_freebsd.h index 6a199aca..22dfa668 100644 --- a/pr/include/md/_freebsd.h +++ b/pr/include/md/_freebsd.h @@ -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 diff --git a/pr/include/md/_openbsd.h b/pr/include/md/_openbsd.h index ef615836..5d8d3e20 100644 --- a/pr/include/md/_openbsd.h +++ b/pr/include/md/_openbsd.h @@ -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 diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c index a1f4695e..c33fa5a5 100644 --- a/pr/src/pthreads/ptio.c +++ b/pr/src/pthreads/ptio.c @@ -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" diff --git a/pr/src/pthreads/ptsynch.c b/pr/src/pthreads/ptsynch.c index 119e9e47..0731786e 100644 --- a/pr/src/pthreads/ptsynch.c +++ b/pr/src/pthreads/ptsynch.c @@ -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 */ diff --git a/pr/tests/Makefile b/pr/tests/Makefile index 347dd5ba..b3138a06 100644 --- a/pr/tests/Makefile +++ b/pr/tests/Makefile @@ -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 |