BugZilla: 19247. Add support for VMS, QNX, NTO
authorlarryh%netscape.com
Mon, 29 Nov 1999 19:42:11 +0000
changeset 973 b2c5f265343bbbf1a725a13fc344bd0c853b318d
parent 972 1d8ed35aaf0c5abae0fd64b116323105798d7d3f
child 974 564d9535d59cef6dc2d46fe0af4683b44f8980b1
push idunknown
push userunknown
push dateunknown
bugs19247
BugZilla: 19247. Add support for VMS, QNX, NTO
build/autoconf/config.guess
build/autoconf/config.sub
config/NTO.mk
config/arch.mk
pr/include/md/_nto.h
pr/src/md/unix/objs.mk
pr/src/md/unix/uxrng.c
pr/tests/Makefile
--- a/build/autoconf/config.guess
+++ b/build/autoconf/config.guess
@@ -751,16 +751,19 @@ EOF
 	        echo mips-nec-sysv${UNAME_RELEASE}
 	else
 	        echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
         exit 0 ;;
     *: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 ;;
     BeMac:BeOS:*:*)
         echo ppc-apple-beos${UNAME_RELEASE}
         exit 0 ;;
     BeBox:BeOS:*:*)
         echo ppc-be-beos${UNAME_RELEASE}
--- a/build/autoconf/config.sub
+++ b/build/autoconf/config.sub
@@ -139,21 +139,21 @@ case $os in
 		;;
 	-windowsnt*)
 		os=`echo $os | sed -e 's/windowsnt/winnt/'`
 		;;
 	-psos*)
 		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*)
 		basic_machine=ppc-apple
 		os=-rhapsody`uname -r`
 		;;
 esac
 
@@ -513,21 +513,21 @@ case $basic_machine in
 	        ;;
 	ppcle-* | powerpclittle-*)
 		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ps2)
 		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)
 		basic_machine=mips-siemens
 		;;
 	rtpc | rtpc-*)
 		basic_machine=romp-ibm
 		;;
--- a/config/NTO.mk
+++ b/config/NTO.mk
@@ -16,35 +16,59 @@
 #
 
 ######################################################################
 # Config stuff for Neutrino
 ######################################################################
 
 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
 
--- a/config/arch.mk
+++ b/config/arch.mk
@@ -52,16 +52,20 @@ endif
 endif
 ifeq ($(OS_ARCH),ncr)
 OS_ARCH		:= NCR
 endif
 # This is the only way to correctly determine the actual OS version on NCR boxes.
 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
 ifneq (,$(findstring POSIX_for_OpenVMS,$(OS_ARCH)))
 OS_ARCH		:= OpenVMS
 CPU_ARCH	:= $(shell uname -Wh)
 OS_RELEASE	:= $(shell uname -v)
 endif
--- a/pr/include/md/_nto.h
+++ b/pr/include/md/_nto.h
@@ -38,16 +38,18 @@
 
 #undef  _PR_POLL_AVAILABLE
 #undef  _PR_USE_POLL
 #define _PR_HAVE_SOCKADDR_LEN
 #undef  HAVE_BSD_FLOCK
 #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 <sys/select.h>
 
 #undef  HAVE_STACK_GROWING_UP
 #define	HAVE_DLL
 #define	USE_DLFCN
 #define NEED_STRFTIME_LOCK
 #define NEED_TIME_R
--- a/pr/src/md/unix/objs.mk
+++ b/pr/src/md/unix/objs.mk
@@ -194,16 +194,19 @@ ifeq ($(OS_ARCH),NCR)
 CSRCS += $(NCR_CSRCS)
 endif
 ifeq ($(OS_ARCH),SCOOS)
 CSRCS += $(SCOOS_CSRCS)
 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)
 else
 CSRCS += $(QNX_CSRCS)
 endif
 endif
  
--- a/pr/src/md/unix/uxrng.c
+++ b/pr/src/md/unix/uxrng.c
@@ -93,16 +93,34 @@ static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
     unsigned long t;
 
     t = asm("rpcc %v0");
     return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t));
 }
 
+#elif defined(VMS)
+
+#include <ints.h>
+
+/*
+ * 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
 GetHighResClock(void *buf, size_t maxbytes)
 {
     return 0;
 }
 
@@ -273,30 +291,30 @@ GetHighResClock(void *buf, size_t maxbyt
 #elif defined(NEC)
 #include <sys/systeminfo.h>
 
 static size_t
 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 <sys/times.h>
 
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
     int ticks;
     struct tms buffer;
 
     ticks=times(&buffer);
     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 )
 {
     struct timeval tv;
     int n = 0;
     int s;
 
--- a/pr/tests/Makefile
+++ b/pr/tests/Makefile
@@ -411,17 +411,21 @@ else
   LIBPTHREAD =
   else
     ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)
     LIBPTHREAD = -ldce
     else
       ifeq ($(OS_ARCH),BSD_OS)
       LIBPTHREAD =
       else
-      LIBPTHREAD = -lpthread
+        ifeq ($(OS_ARCH),NTO)
+         LIBPTHREAD =
+        else
+         LIBPTHREAD = -lpthread
+        endif
       endif
     endif
   endif
 endif
 endif
 
 #####################################################
 #