Skip to content

Commit

Permalink
Bug 180294: moved the OpenVMS build from the POSIX subsystem to native
Browse files Browse the repository at this point in the history
VMS (GNV).  The patch is contributed by Colin Blakes <colin@theblakes.com>.
Modified files: OpenVMS.mk config.mk rules.mk nsinstall/nsinstall.c
  • Loading branch information
wtc%netscape.com committed Dec 10, 2002
1 parent 6e25638 commit f6bb05e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
23 changes: 8 additions & 15 deletions security/coreconf/OpenVMS.mk
Expand Up @@ -21,23 +21,15 @@

include $(CORE_DEPTH)/coreconf/UNIX.mk

ifdef INTERNAL_TOOLS
CC = c89
CC = cc
CCC = cxx
OPTIMIZER = -O
else
CC = ccc
CCC = ccc
endif

RANLIB = /bin/true
RANLIB = /gnu/bin/true

CPU_ARCH := $(shell uname -Wh)

OS_CFLAGS = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
-DGENERIC_PTHREAD_REDEFINES -DNO_UDSOCK
OS_CXXFLAGS = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
-DGENERIC_PTHREAD_REDEFINES -DNO_UDSOCK
OS_CFLAGS = -DVMS
OS_CXXFLAGS = -DVMS

# Maybe this should go into rules.mk or something?
ifdef NSPR_INCLUDE_DIR
Expand All @@ -52,13 +44,14 @@ endif
#
XCFLAGS += $(OPTIMIZER)

# The command to build a shared library in POSIX on OpenVMS.
MKSHLIB = vmsld_psm OBJDIR=$(OBJDIR) $(OPTIMIZER)
DSO_LDOPTS = -shared -auto_symvec
MKSHLIB = $(CC) $(OPTIMIZER) $(LDFLAGS) $(DSO_LDOPTS)

ifdef MAPFILE
# Add LD options to restrict exported symbols to those in the map file
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = copy $(LIBRARY_NAME).def $@
PROCESS_MAP_FILE = cp $(LIBRARY_NAME).def $@


#
Expand Down
3 changes: 2 additions & 1 deletion security/coreconf/config.mk
Expand Up @@ -58,7 +58,8 @@ endif
# one for each OS release. #
#######################################################################

TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD
TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
OpenVMS

ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
Expand Down
16 changes: 16 additions & 0 deletions security/coreconf/nsinstall/nsinstall.c
Expand Up @@ -403,6 +403,11 @@ main(int argc, char **argv)

if (ftruncate(tofd, sb.st_size) < 0)
fail("cannot truncate %s", toname);
/*
** On OpenVMS we can't chmod() until the file is closed, and we
** have to utime() last since fchown/chmod alter the timestamps.
*/
#ifndef VMS
if (dotimes) {
utb.actime = sb.st_atime;
utb.modtime = sb.st_mtime;
Expand All @@ -415,13 +420,24 @@ main(int argc, char **argv)
if (chmod(toname, mode) < 0)
#endif
fail("cannot change mode of %s", toname);
#endif
if ((owner || group) && fchown(tofd, uid, gid) < 0)
fail("cannot change owner of %s", toname);

/* Must check for delayed (NFS) write errors on close. */
if (close(tofd) < 0)
fail("close reports write error on %s", toname);
close(fromfd);
#ifdef VMS
if (chmod(toname, mode) < 0)
fail("cannot change mode of %s", toname);
if (dotimes) {
utb.actime = sb.st_atime;
utb.modtime = sb.st_mtime;
if (utime(toname, &utb) < 0)
fail("cannot set times of %s", toname);
}
#endif
}

free(toname);
Expand Down
8 changes: 1 addition & 7 deletions security/coreconf/rules.mk
Expand Up @@ -110,9 +110,6 @@ ifdef LIBRARY
endif
ifdef SHARED_LIBRARY
$(INSTALL) -m 775 $(SHARED_LIBRARY) $(SOURCE_LIB_DIR)
ifeq ($(OS_TARGET),OpenVMS)
$(INSTALL) -m 775 $(SHARED_LIBRARY:$(DLL_SUFFIX)=vms) $(SOURCE_LIB_DIR)
endif
endif
ifdef IMPORT_LIBRARY
$(INSTALL) -m 775 $(IMPORT_LIBRARY) $(SOURCE_LIB_DIR)
Expand Down Expand Up @@ -365,9 +362,6 @@ else
$(MKSHLIB) -o $@ $(OBJS) $(SUB_SHLOBJS) $(LD_LIBS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS)
endif
chmod +x $@
ifeq ($(OS_TARGET),OpenVMS)
@echo "`translate $@`" > $(@:$(DLL_SUFFIX)=vms)
endif
ifeq ($(OS_TARGET),Darwin)
ifdef MAPFILE
nmedit -s $(MAPFILE) $@
Expand Down Expand Up @@ -855,7 +849,7 @@ endif

-include $(DEPENDENCIES)

ifneq (,$(filter-out OS2 WIN%,$(OS_TARGET)))
ifneq (,$(filter-out OpenVMS OS2 WIN%,$(OS_TARGET)))
# Can't use sed because of its 4000-char line length limit, so resort to perl
.DEFAULT:
@perl -e ' \
Expand Down

0 comments on commit f6bb05e

Please sign in to comment.