From fa4ff6d0290cf4f48d5ad10df57a5bfa96f9436f Mon Sep 17 00:00:00 2001 From: "larryh%netscape.com" Date: Mon, 29 Nov 1999 19:42:11 +0000 Subject: [PATCH] BugZilla: 19247. Add support for VMS, QNX, NTO --- nsprpub/build/autoconf/config.guess | 3 ++ nsprpub/build/autoconf/config.sub | 8 ++--- nsprpub/config/NTO.mk | 46 ++++++++++++++++++++++------- nsprpub/config/arch.mk | 4 +++ nsprpub/pr/include/md/_nto.h | 2 ++ nsprpub/pr/src/md/unix/objs.mk | 3 ++ nsprpub/pr/src/md/unix/uxrng.c | 22 ++++++++++++-- nsprpub/pr/tests/Makefile | 6 +++- 8 files changed, 76 insertions(+), 18 deletions(-) diff --git a/nsprpub/build/autoconf/config.guess b/nsprpub/build/autoconf/config.guess index 0917917b1ee..441894dcfe6 100755 --- a/nsprpub/build/autoconf/config.guess +++ b/nsprpub/build/autoconf/config.guess @@ -756,6 +756,9 @@ EOF *:QNX:*:*) echo i386-pc-qnx`${UNAME_VERSION} | cut -c1-1` exit 0 ;; + *:*nto:*:*) + echo `uname -p`-pc-nto + exit 0 ;; BePC:BeOS:*:*) echo i386-pc-beos${UNAME_RELEASE} exit 0 ;; diff --git a/nsprpub/build/autoconf/config.sub b/nsprpub/build/autoconf/config.sub index 8dcf30728e3..2e016f1ff81 100755 --- a/nsprpub/build/autoconf/config.sub +++ b/nsprpub/build/autoconf/config.sub @@ -144,11 +144,11 @@ case $os in os=-psos ;; -qnx*) - basic_machine=i386-pc + basic_machine=x6-pc os=-qnx`uname -v | cut -c1-1` ;; -nto*) - basic_machine=i386-pc + basic_machine=`uname -p`-pc os=-nto ;; -rhapsody*) @@ -518,11 +518,11 @@ case $basic_machine in basic_machine=i386-ibm ;; *qnx*) - basic_machine=i386-pc + basic_machine=x86-pc os=-qnx`uname -v | cut -c1-1` ;; *nto*) - basic_machine=i386-pc + basic_machine=`uname -p`-pc os=-nto ;; rm[46]00) diff --git a/nsprpub/config/NTO.mk b/nsprpub/config/NTO.mk index 27d9f1a4ce2..a0b53ecd28b 100644 --- a/nsprpub/config/NTO.mk +++ b/nsprpub/config/NTO.mk @@ -21,30 +21,54 @@ include $(MOD_DEPTH)/config/UNIX.mk -CPU_ARCH = x86 +# +# XXX +# Temporary define for the Client; to be removed when binary release is used +# +ifdef MOZILLA_CLIENT +ifneq ($(USE_PTHREADS),1) +CLASSIC_NSPR = 1 +endif +endif + +# +# The default implementation strategy for Linux is pthreads. +# +ifeq ($(CLASSIC_NSPR),1) +IMPL_STRATEGY = _EMU +DEFINES += -D_PR_LOCAL_THREADS_ONLY +else +USE_PTHREADS = 1 +IMPL_STRATEGY = _PTH +DEFINES += -D_REENTRANT +endif + + AR = qcc -Vgcc_ntox86 -M -a $@ -CC = qcc -Vgcc_ntox86 -shared +CC = qcc -Vgcc_ntox86 LD = $(CC) CCC = $(CC) -OS_CFLAGS = -Wc,-Wall -Wc,-Wno-parentheses -DNTO -DNTO2 -Di386 \ - -D_QNX_SOURCE -DNO_REGEX \ - -DSTRINGS_ALIGNED -D__i386__ -D__QNXNTO__ -DPIC \ - -DHAVE_POINTER_LOCALTIME_R + +# Old Flags -DNO_REGEX -DSTRINGS_ALIGNED + +OS_CFLAGS = -Wc,-Wall -Wc,-Wno-parentheses -DNTO \ + -D_QNX_SOURCE -DHAVE_POINTER_LOCALTIME_R -shared + COMPILER_TAG = _qcc MKSHLIB = qcc -Vgcc_ntox86 -shared -Wl,-h$(@:$(OBJDIR)/%.so=%.so) -g2 -M RANLIB = ranlib G++INCLUDES = OS_LIBS = -XLDOPTS = +EXTRA_LIBS = -lsocket -ifdef USE_PTHREADS - IMPL_STRATEGY = _PTH +ifdef BUILD_OPT +OPTIMIZER = -O2 else - IMPL_STRATEGY = _EMU +OPTIMIZER = -O2 -gdwarf-2 endif NOSUCHFILE = /no-such-file -GARBAGE = $(wildcard *.err) +GARBAGE += *.map diff --git a/nsprpub/config/arch.mk b/nsprpub/config/arch.mk index 592a351333c..10dfc6a906a 100644 --- a/nsprpub/config/arch.mk +++ b/nsprpub/config/arch.mk @@ -57,6 +57,10 @@ endif ifeq ($(OS_ARCH),NCR) OS_RELEASE := $(shell awk '{print $$3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$$/\2.\3/') endif +ifeq ($(OS_ARCH),procnto) +OS_ARCH := NTO +OS_RELEASE := _$(OS_TEST)$(OS_RELEASE) +endif ifeq ($(OS_ARCH),UNIX_System_V) OS_ARCH := NEC endif diff --git a/nsprpub/pr/include/md/_nto.h b/nsprpub/pr/include/md/_nto.h index 394d9bacd23..c3720ab33bb 100644 --- a/nsprpub/pr/include/md/_nto.h +++ b/nsprpub/pr/include/md/_nto.h @@ -43,6 +43,8 @@ #define HAVE_FCNTL_FILE_LOCKING #define _PR_NO_LARGE_FILES #define _PR_STAT_HAS_ONLY_ST_ATIME +#define PR_HAVE_POSIX_NAMED_SHARED_MEMORY +#define _PR_HAVE_POSIX_SEMAPHORES #include diff --git a/nsprpub/pr/src/md/unix/objs.mk b/nsprpub/pr/src/md/unix/objs.mk index cf00e237ab6..d8196c81236 100644 --- a/nsprpub/pr/src/md/unix/objs.mk +++ b/nsprpub/pr/src/md/unix/objs.mk @@ -199,6 +199,9 @@ endif ifeq ($(OS_ARCH),DGUX) CSRCS += $(DGUX_CSRCS) endif +ifeq ($(OS_ARCH),NTO) +CSRCS += $(NTO_CSRCS) +endif ifeq ($(OS_ARCH),QNX) ifeq ($(OS_TARGET),NTO) CSRCS += $(NTO_CSRCS) diff --git a/nsprpub/pr/src/md/unix/uxrng.c b/nsprpub/pr/src/md/unix/uxrng.c index f93cddf409a..f9d953edd39 100644 --- a/nsprpub/pr/src/md/unix/uxrng.c +++ b/nsprpub/pr/src/md/unix/uxrng.c @@ -98,6 +98,24 @@ GetHighResClock(void *buf, size_t maxbytes) return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t)); } +#elif defined(VMS) + +#include + +/* + * Use the "get the cycle counter" instruction on the alpha. + * The low 32 bits completely turn over in less than a minute. + * The high 32 bits are some non-counter gunk that changes sometimes. + */ +static size_t +GetHighResClock(void *buf, size_t maxbytes) +{ + uint64 t; + + t = __RPCC(); + return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t)); +} + #elif defined(AIX) static size_t @@ -278,7 +296,7 @@ GetHighResClock(void *buf, size_t maxbytes) { return 0; } -#elif defined(SCO) || defined(UNIXWARE) || defined(BSDI) +#elif defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(NTO) || defined(QNX) #include static size_t @@ -291,7 +309,7 @@ GetHighResClock(void *buf, size_t maxbytes) return _pr_CopyLowBits(buf, maxbytes, &ticks, sizeof(ticks)); } #else -error! Platform undefined +#error! Platform undefined #endif /* defined(SOLARIS) */ extern PRSize _PR_MD_GetRandomNoise( void *buf, PRSize size ) diff --git a/nsprpub/pr/tests/Makefile b/nsprpub/pr/tests/Makefile index 5c582bdd645..347dd5ba5ec 100644 --- a/nsprpub/pr/tests/Makefile +++ b/nsprpub/pr/tests/Makefile @@ -416,7 +416,11 @@ else ifeq ($(OS_ARCH),BSD_OS) LIBPTHREAD = else - LIBPTHREAD = -lpthread + ifeq ($(OS_ARCH),NTO) + LIBPTHREAD = + else + LIBPTHREAD = -lpthread + endif endif endif endif