Made nsprpub build on BSD/OS. Some makefiles need to change: the NSPRPUB_19980421_BRANCH
authorwtc
Wed, 22 Apr 1998 22:00:58 +0000
branchNSPRPUB_19980421_BRANCH
changeset 57 d5c6a396068890049f94b33c6d0ecffba2db9176
parent 55 96763b5d836a4ec73a6081b2c300e2ed192ff8f5
child 61 71afad180ce62ea7e0cd18c7fcacc64079acbc99
push idunknown
push userunknown
push dateunknown
Made nsprpub build on BSD/OS. Some makefiles need to change: the value of OS_ARCH should change from BSD_386 to BSD_OS. In unix.c, we now conditionalize on O_SYNC/O_FSYNC instead of the platform macros like BSDI and FREEBSD.
lib/msgc/tests/Makefile
pr/include/md/Makefile
pr/src/md/unix/Makefile
pr/src/md/unix/objs.mk
pr/src/md/unix/unix.c
pr/tests/Makefile
--- a/lib/msgc/tests/Makefile
+++ b/lib/msgc/tests/Makefile
@@ -198,17 +198,17 @@ EXTRA_LIBS = -lsocket -lnsl -lgen -ldl -
 # option for ld on other platforms.
 export LD_RUN_PATH = $(PWD)/$(DIST)/lib
 endif
 
 ifeq ($(OS_ARCH), UNIXWARE)
 export LD_RUN_PATH = $(PWD)/$(DIST)/lib
 endif
 
-ifeq ($(OS_ARCH),BSD_386)
+ifeq ($(OS_ARCH),BSD_OS)
 EXTRA_LIBS = -ldl
 endif
 
 #####################################################
 #
 # The rules
 #
 #####################################################
--- a/pr/include/md/Makefile
+++ b/pr/include/md/Makefile
@@ -42,17 +42,17 @@ endif
 endif
 endif
 endif
 
 ifeq ($(OS_ARCH),AIX)
 MDCPUCFG_H = _aix.cfg
 endif
 
-ifeq ($(OS_ARCH),BSD_386)
+ifeq ($(OS_ARCH),BSD_OS)
 MDCPUCFG_H = _bsdi.cfg
 endif
 
 ifeq ($(OS_ARCH),FreeBSD)
 MDCPUCFG_H = _freebsd.cfg
 endif
 
 ifeq ($(OS_ARCH),HP-UX)
--- a/pr/src/md/unix/Makefile
+++ b/pr/src/md/unix/Makefile
@@ -114,17 +114,17 @@ endif
 endif
 
 ifeq ($(OS_ARCH),AIX)
 CSRCS += $(AIX_CSRCS)
 endif
 ifeq ($(OS_ARCH),FreeBSD)
 CSRCS += $(FREEBSD_CSRCS)
 endif
-ifeq ($(OS_ARCH),BSD_386)
+ifeq ($(OS_ARCH),BSD_OS)
 CSRCS += $(BSDI_CSRCS)
 endif
 ifeq ($(OS_ARCH),HP-UX)
 CSRCS += $(HPUX_CSRCS)
 endif
 ifeq ($(OS_ARCH),OSF1)
 CSRCS += $(OSF1_CSRCS)
 endif
@@ -169,17 +169,17 @@ ifeq ($(OS_ARCH),SunOS)
 	endif
     endif
 endif
 
 ifeq ($(OS_ARCH), ReliantUNIX)
     ASFILES   = os_$(OS_ARCH).s
 endif
 
-ifeq ($(OS_ARCH)$(OS_RELEASE),BSD_3862.1)
+ifeq ($(OS_ARCH)$(OS_RELEASE),BSD_OS2.1)
     ASFILES = os_BSD_386_2.s
 endif
 
 TARGETS		= $(OBJS)
 
 ifeq ($(OS_ARCH),AIX)
 ifneq ($(OS_RELEASE),4.2)
 ifneq ($(USE_PTHREADS), 1)
--- a/pr/src/md/unix/objs.mk
+++ b/pr/src/md/unix/objs.mk
@@ -107,17 +107,17 @@ endif
 endif
 
 ifeq ($(OS_ARCH),AIX)
 CSRCS += $(AIX_CSRCS)
 endif
 ifeq ($(OS_ARCH),FreeBSD)
 CSRCS += $(FREEBSD_CSRCS)
 endif
-ifeq ($(OS_ARCH),BSD_386)
+ifeq ($(OS_ARCH),BSD_OS)
 CSRCS += $(BSDI_CSRCS)
 endif
 ifeq ($(OS_ARCH),HP-UX)
 CSRCS += $(HPUX_CSRCS)
 endif
 ifeq ($(OS_ARCH),OSF1)
 CSRCS += $(OSF1_CSRCS)
 endif
@@ -162,15 +162,15 @@ ifeq ($(OS_ARCH),SunOS)
 	endif
     endif
 endif
 
 ifeq ($(OS_ARCH), ReliantUNIX)
     ASFILES   = os_$(OS_ARCH).s
 endif
 
-ifeq ($(OS_ARCH)$(OS_RELEASE),BSD_3862.1)
+ifeq ($(OS_ARCH)$(OS_RELEASE),BSD_OS2.1)
     ASFILES = os_BSD_386_2.s
 endif
 	
 OBJS += $(addprefix md/unix/$(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX)))  \
 	$(addprefix md/unix/$(OBJDIR)/,$(ASFILES:.s=.$(OBJ_SUFFIX)))
 
--- a/pr/src/md/unix/unix.c
+++ b/pr/src/md/unix/unix.c
@@ -2626,20 +2626,22 @@ PRInt32 _MD_open(const char *name, PRInt
 		osflags = O_RDONLY;
 	}
 
 	if (flags & PR_APPEND)
 		osflags |= O_APPEND;
 	if (flags & PR_TRUNCATE)
 		osflags |= O_TRUNC;
 	if (flags & PR_SYNC) {
-#if defined(BSDI) || defined(FREEBSD)
+#if defined(O_SYNC)
+		osflags |= O_SYNC;
+#elif defined(O_FSYNC)
 		osflags |= O_FSYNC;
 #else
-		osflags |= O_SYNC;
+#error "Neither O_SYNC nor O_FSYNC is defined on this platform"
 #endif
 	}
 
     /*
     ** On creations we hold the 'create' lock in order to enforce
     ** the semantics of PR_Rename. (see the latter for more details)
     */
 	if (flags & PR_CREATE_FILE)
--- a/pr/tests/Makefile
+++ b/pr/tests/Makefile
@@ -292,17 +292,17 @@ export LD_RUN_PATH = $(PWD)/$(DIST)/lib
 endif
 
 ifeq ($(OS_ARCH),FreeBSD)
 ifeq ($(USE_PTHREADS),1)
 EXTRA_LIBS = -lc_r
 endif
 endif
 
-ifeq ($(OS_ARCH),BSD_386)
+ifeq ($(OS_ARCH),BSD_OS)
 EXTRA_LIBS = -ldl
 endif
 
 #####################################################
 #
 # The rules
 #
 #####################################################