diff --git a/nsprpub/config/OpenVMS.mk b/nsprpub/config/OpenVMS.mk index 12ba6178a76..ba822eac47a 100644 --- a/nsprpub/config/OpenVMS.mk +++ b/nsprpub/config/OpenVMS.mk @@ -37,4 +37,4 @@ CPU_ARCH_TAG = _$(CPU_ARCH) OS_CFLAGS = -DVMS # The command to build a shared library in POSIX on OpenVMS. -XXXMKSHLIB = c89 -Wl,share +MKSHLIB = vmsld $(OPTIMIZER) diff --git a/nsprpub/config/rules.mk b/nsprpub/config/rules.mk index f19aeb1fa06..8aff5b8d04f 100644 --- a/nsprpub/config/rules.mk +++ b/nsprpub/config/rules.mk @@ -287,7 +287,7 @@ ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1) | sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms $(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \ -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS) -else +else # AIX 4.1 ifeq ($(OS_ARCH), WINNT) ifeq ($(OS_TARGET), WIN16) echo system windows dll initinstance >w16link @@ -305,7 +305,7 @@ ifeq ($(OS_TARGET), WIN16) echo libfile libentry >>w16link $(LINK) @w16link. rm w16link -else +else # WIN16 ifeq ($(OS_TARGET), OS2) # append ( >> ) doesn't seem to be working under OS/2 gmake. Run through OS/2 shell instead. @cmd /C "echo LIBRARY $(notdir $(basename $(SHARED_LIBRARY))) INITINSTANCE TERMINSTANCE >$@.def" @@ -317,12 +317,22 @@ ifeq ($(OS_TARGET), OS2) $(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $@.def else $(LINK_DLL) -MAP $(DLLBASE) $(OS_LIBS) $(EXTRA_LIBS) $(OBJS) -endif -endif -else +endif # OS2 +endif # WIN16 +else # WINNT +ifeq ($(OS_TARGET), OpenVMS) + @if test ! -f $(OBJDIR)/VMSuni.opt; then \ + echo "Creating universal symbol option file $(OBJDIR)/VMSuni.opt";\ + create_opt_uni $(OBJS); \ + mv VMSuni.opt $(OBJDIR); \ + fi + $(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(OBJDIR)/VMSuni.opt + @echo "`translate $@`" > $(@:.$(DLL_SUFFIX)=.vms) +else # OpenVMS $(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) -endif -endif +endif # OpenVMS +endif # WINNT +endif # AIX 4.1 $(PURE_LIBRARY): rm -f $@ diff --git a/nsprpub/lib/ds/Makefile b/nsprpub/lib/ds/Makefile index 3e166b083cf..a45a1446bff 100644 --- a/nsprpub/lib/ds/Makefile +++ b/nsprpub/lib/ds/Makefile @@ -160,6 +160,9 @@ export:: $(TARGETS) $(INSTALL) -m 444 $(TARGETS) $(DIST)/lib ifdef SHARED_LIBRARY $(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/bin +ifeq ($(OS_ARCH), OpenVMS) + $(INSTALL) -m 444 $(SHARED_LIBRARY:.$(DLL_SUFFIX)=.vms) $(DIST)/lib +endif endif ifeq ($(MOZ_BITS),16) $(INSTALL) -m 444 $(HEADERS) $(MOZ_INCL) diff --git a/nsprpub/lib/ds/plevent.c b/nsprpub/lib/ds/plevent.c index a939d9e33f4..2ffe4d8a6d6 100644 --- a/nsprpub/lib/ds/plevent.c +++ b/nsprpub/lib/ds/plevent.c @@ -52,6 +52,17 @@ typedef MPARAM WPARAM,LPARAM; #if defined(VMS) /* +** If MOTIF is being used then XtAppAddInput is used as the notification +** method and so event flags must be used, so you need to define +** VMS_EVENTS_USE_EF. If gdk is being used then select is used for +** notification, and then VMS_EVENTS_USE_SOCKETS should be defined. +*/ +#undef VMS_EVENTS_USE_EF +#define VMS_EVENTS_USE_SOCKETS +#endif + +#if defined(VMS_EVENTS_USE_EF) +/* ** On OpenVMS, XtAppAddInput doesn't want a regular fd, instead it ** wants an event flag. So, we don't create and use a pipe for ** notification of when an event queue has something ready, instead @@ -61,7 +72,12 @@ typedef MPARAM WPARAM,LPARAM; #include #include #include -#endif /* VMS */ +#endif /* VMS_EVENTS_USE_EF */ + +#if defined(VMS_EVENTS_USE_SOCKETS) +#include +#endif /* VMS_EVENTS_USE_SOCKETS */ + static PRLogModuleInfo *event_lm = NULL; @@ -87,7 +103,7 @@ struct PLEventQueue { PRThread* handlerThread; EventQueueType type; PRBool processingEvents; -#if defined(VMS) +#if defined(VMS_EVENTS_USE_EF) int efn; int notifyCount; #elif defined(XP_UNIX) @@ -602,7 +618,7 @@ _pl_SetupNativeNotifier(PLEventQueue* self) #pragma unused (self) #endif -#if defined(VMS) +#if defined(VMS_EVENTS_USE_EF) { #ifdef VMS_USE_GETEF unsigned int status; @@ -625,7 +641,11 @@ _pl_SetupNativeNotifier(PLEventQueue* self) int err; int flags; +#if defined(VMS_EVENTS_USE_SOCKETS) + err = socketpair(AF_INET,SOCK_STREAM,0,self->eventPipe); +#else err = pipe(self->eventPipe); +#endif if (err != 0) { return PR_FAILURE; } @@ -687,7 +707,7 @@ _pl_CleanupNativeNotifier(PLEventQueue* self) #pragma unused (self) #endif -#if defined(VMS) +#if defined(VMS_EVENTS_USE_EF) #ifdef VMS_USE_GETEF { unsigned int status; @@ -720,7 +740,7 @@ _pl_NativeNotify(PLEventQueue* self) }/* --- end _pl_NativeNotify() --- */ #endif /* XP_OS2 */ -#if defined(VMS) +#if defined(VMS_EVENTS_USE_EF) /* Just set the event flag */ static PRStatus _pl_NativeNotify(PLEventQueue* self) @@ -779,7 +799,7 @@ _pl_NativeNotify(PLEventQueue* self) static PRStatus _pl_AcknowledgeNativeNotify(PLEventQueue* self) { -#if defined(VMS) +#if defined(VMS_EVENTS_USE_EF) /* Clear the event flag if we're all done */ /* NOTE that we might want to always clear the event flag, even if the */ /* notifyCount says we shouldn't. */ @@ -822,7 +842,7 @@ PL_GetEventQueueSelectFD(PLEventQueue* self) if (self == NULL) return -1; -#if defined(VMS) +#if defined(VMS_EVENTS_USE_EF) return self->efn; #elif defined(XP_UNIX) return self->eventPipe[0]; diff --git a/nsprpub/lib/libc/src/Makefile b/nsprpub/lib/libc/src/Makefile index cc92f303200..aaab3930dd5 100644 --- a/nsprpub/lib/libc/src/Makefile +++ b/nsprpub/lib/libc/src/Makefile @@ -158,6 +158,9 @@ export:: $(TARGETS) $(INSTALL) -m 444 $(TARGETS) $(DIST)/lib ifdef SHARED_LIBRARY $(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/bin +ifeq ($(OS_ARCH), OpenVMS) + $(INSTALL) -m 444 $(SHARED_LIBRARY:.$(DLL_SUFFIX)=.vms) $(DIST)/lib +endif endif ifeq ($(MOZ_BITS),16) $(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/lib diff --git a/nsprpub/lib/prstreams/Makefile b/nsprpub/lib/prstreams/Makefile index b0f53ca6213..3cc32b16400 100644 --- a/nsprpub/lib/prstreams/Makefile +++ b/nsprpub/lib/prstreams/Makefile @@ -177,5 +177,11 @@ endif export:: $(TARGETS) $(HEADERS) $(INSTALL) -m 444 $(HEADERS) $(DIST)/include $(INSTALL) -m 444 $(TARGETS) $(DIST)/lib +ifeq ($(OS_ARCH),OpenVMS) + $(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/lib +ifdef SHARED_LIBRARY + $(INSTALL) -m 444 $(SHARED_LIBRARY:.$(DLL_SUFFIX)=.vms) $(DIST)/lib +endif +endif install:: export diff --git a/nsprpub/pr/include/md/_openvms.h b/nsprpub/pr/include/md/_openvms.h index 050e158a4b9..a7959521a51 100644 --- a/nsprpub/pr/include/md/_openvms.h +++ b/nsprpub/pr/include/md/_openvms.h @@ -73,8 +73,8 @@ struct ip_mreq { #define NEED_TIME_R -#undef HAVE_DLL -#undef USE_DLFCN +#define HAVE_DLL +#define USE_DLFCN #define _PR_POLL_AVAILABLE #define _PR_USE_POLL diff --git a/nsprpub/pr/src/Makefile b/nsprpub/pr/src/Makefile index ae988c03b15..a6f7f01f66d 100644 --- a/nsprpub/pr/src/Makefile +++ b/nsprpub/pr/src/Makefile @@ -91,10 +91,6 @@ endif endif endif -ifeq ($(OS_ARCH),OpenVMS) -OS_LIBS = -lvms_jackets -endif - ifeq ($(OS_ARCH),OSF1) ifeq ($(USE_PTHREADS), 1) OS_LIBS = -lpthread -lrt @@ -395,6 +391,9 @@ export:: $(TARGETS) $(INSTALL) -m 444 $(TARGETS) $(DIST)/lib ifdef SHARED_LIBRARY $(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/bin +ifeq ($(OS_ARCH), OpenVMS) + $(INSTALL) -m 444 $(SHARED_LIBRARY:.$(DLL_SUFFIX)=.vms) $(DIST)/lib +endif endif ifeq ($(MOZ_BITS),16) $(INSTALL) -m 444 $(TARGETS) $(MOZ_DIST)/lib diff --git a/nsprpub/pr/src/md/unix/openvms.c b/nsprpub/pr/src/md/unix/openvms.c index d81abecadb0..e1c73ca61a7 100644 --- a/nsprpub/pr/src/md/unix/openvms.c +++ b/nsprpub/pr/src/md/unix/openvms.c @@ -187,3 +187,30 @@ int thread_resume(PRThread *thr_id) { return 0; } + + +#ifdef AS_IS +/* +** These are here because of the problems we have when +** compiling AS_IS. After much trying to fix this problem +** with macro definitions in _pth.h, I finally gave up +** and put these jackets here. So now these two calls both +** map onto their lowercase version, and the lowercase +** version here just calls the uppercase version. +*/ + +#undef PTHREAD_MUTEX_INIT +#undef PTHREAD_COND_INIT + +int pthread_mutex_init ( + pthread_mutex_t *mutex, + const pthread_mutexattr_t *attr) { + return PTHREAD_MUTEX_INIT(mutex,attr); +} + +int pthread_cond_init ( + pthread_cond_t *cond, + const pthread_condattr_t *attr){ + return PTHREAD_COND_INIT (cond,attr); +} +#endif