summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrinivas%netscape.com <devnull@localhost>1999-07-15 12:37:21 +0000
committersrinivas%netscape.com <devnull@localhost>1999-07-15 12:37:21 +0000
commit9307044eb3a5e41779ad6a5a612cf3fa81b9d7e2 (patch)
treed46e301e0c9aeb734cf22ec75c46375e89ddd805
parentcb5875d318e6e34607136c3b183c9beb8f2bdb50 (diff)
downloadnspr-hg-9307044eb3a5e41779ad6a5a612cf3fa81b9d7e2.tar.gz
OpenVMS port; checkin for "Colin R. Blake" <colin@theblakes.com>.
-rw-r--r--config/OpenVMS.mk2
-rw-r--r--config/rules.mk24
-rw-r--r--lib/ds/Makefile3
-rw-r--r--lib/ds/plevent.c34
-rw-r--r--lib/libc/src/Makefile3
-rw-r--r--lib/prstreams/Makefile6
-rw-r--r--pr/include/md/_openvms.h4
-rw-r--r--pr/src/Makefile7
-rw-r--r--pr/src/md/unix/openvms.c27
9 files changed, 89 insertions, 21 deletions
diff --git a/config/OpenVMS.mk b/config/OpenVMS.mk
index 12ba6178..ba822eac 100644
--- a/config/OpenVMS.mk
+++ b/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/config/rules.mk b/config/rules.mk
index f19aeb1f..8aff5b8d 100644
--- a/config/rules.mk
+++ b/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/lib/ds/Makefile b/lib/ds/Makefile
index 3e166b08..a45a1446 100644
--- a/lib/ds/Makefile
+++ b/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/lib/ds/plevent.c b/lib/ds/plevent.c
index a939d9e3..2ffe4d8a 100644
--- a/lib/ds/plevent.c
+++ b/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 <lib$routines.h>
#include <starlet.h>
#include <stsdef.h>
-#endif /* VMS */
+#endif /* VMS_EVENTS_USE_EF */
+
+#if defined(VMS_EVENTS_USE_SOCKETS)
+#include <socket.h>
+#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/lib/libc/src/Makefile b/lib/libc/src/Makefile
index cc92f303..aaab3930 100644
--- a/lib/libc/src/Makefile
+++ b/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/lib/prstreams/Makefile b/lib/prstreams/Makefile
index b0f53ca6..3cc32b16 100644
--- a/lib/prstreams/Makefile
+++ b/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/pr/include/md/_openvms.h b/pr/include/md/_openvms.h
index 050e158a..a7959521 100644
--- a/pr/include/md/_openvms.h
+++ b/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/pr/src/Makefile b/pr/src/Makefile
index ae988c03..a6f7f01f 100644
--- a/pr/src/Makefile
+++ b/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/pr/src/md/unix/openvms.c b/pr/src/md/unix/openvms.c
index d81abeca..e1c73ca6 100644
--- a/pr/src/md/unix/openvms.c
+++ b/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