summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrelyea%netscape.com <devnull@localhost>2000-09-20 00:16:31 +0000
committerrelyea%netscape.com <devnull@localhost>2000-09-20 00:16:31 +0000
commit9cb7dd6fff2f6614bd9d4ab6ff93be3d3ea6f825 (patch)
treeebb6b3acfdaca97ccccd7d6af6eeee6e6f145b32
parent5ae97f5f182ae67570a4f64f91dcc08a1229f7de (diff)
downloadnss-hg-9cb7dd6fff2f6614bd9d4ab6ff93be3d3ea6f825.tar.gz
Integrate OS/2 changes from IBM.
-rw-r--r--security/coreconf/OS2.mk162
-rw-r--r--security/coreconf/arch.mk9
-rw-r--r--security/coreconf/suffix.mk8
-rw-r--r--security/nss/Makefile2
-rw-r--r--security/nss/cmd/Makefile42
-rw-r--r--security/nss/cmd/certutil/keystuff.c2
-rw-r--r--security/nss/cmd/crmf-cgi/Makefile2
-rw-r--r--security/nss/cmd/crmftest/Makefile2
-rw-r--r--security/nss/cmd/pk12util/Makefile4
-rw-r--r--security/nss/cmd/platlibs.mk42
-rw-r--r--security/nss/cmd/signtool/Makefile4
-rw-r--r--security/nss/cmd/swfort/Makefile42
-rw-r--r--security/nss/cmd/swfort/newuser/Makefile2
-rw-r--r--security/nss/lib/fortcrypt/fpkmem.h2
-rw-r--r--security/nss/lib/fortcrypt/swfort/pkcs11/Makefile16
-rw-r--r--security/nss/lib/fortcrypt/swfort/swfutl.c18
-rw-r--r--security/nss/lib/freebl/Makefile2
-rw-r--r--security/nss/lib/ssl/Makefile4
-rw-r--r--security/nss/lib/ssl/os2_err.c310
-rw-r--r--security/nss/lib/ssl/os2_err.h83
-rw-r--r--security/nss/lib/util/manifest.mn2
-rw-r--r--security/nss/lib/util/os2_rand.c3
-rw-r--r--security/nss/lib/util/secport.c2
23 files changed, 679 insertions, 86 deletions
diff --git a/security/coreconf/OS2.mk b/security/coreconf/OS2.mk
new file mode 100644
index 000000000..c3b7c83c2
--- /dev/null
+++ b/security/coreconf/OS2.mk
@@ -0,0 +1,162 @@
+#
+# The contents of this file are subject to the Mozilla Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code is the Netscape security libraries.
+#
+# The Initial Developer of the Original Code is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1994-2000 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the
+# terms of the GNU General Public License Version 2 or later (the
+# "GPL"), in which case the provisions of the GPL are applicable
+# instead of those above. If you wish to allow use of your
+# version of this file only under the terms of the GPL and not to
+# allow others to use your version of this file under the MPL,
+# indicate your decision by deleting the provisions above and
+# replace them with the notice and other provisions required by
+# the GPL. If you do not delete the provisions above, a recipient
+# may use your version of this file under either the MPL or the
+# GPL.
+#
+
+MOZ_WIDGET_TOOLKIT = os2
+
+# Specify toolset. Default to EMX.
+ifeq ($(MOZ_OS2_TOOLS),VACPP)
+XP_OS2_VACPP = 1
+else
+ifeq ($(MOZ_OS2_TOOLS),PGCC)
+XP_OS2_EMX = 1
+else
+MOZ_OS2_TOOLS = EMX
+XP_OS2_EMX = 1
+endif
+endif
+
+# XP_PC is for Window and OS2 on Intel X86
+# XP_OS2 is strictly for OS2 only
+XP_DEFINE += -DXP_PC=1 -DXP_OS2=1
+
+# Override suffix in suffix.mk
+LIB_SUFFIX = lib
+DLL_SUFFIX = dll
+OBJ_SUFFIX = .obj
+ASM_SUFFIX = .asm
+PROG_SUFFIX = .exe
+
+
+#
+# On OS/2 we proudly support gbash...
+#
+SHELL = GBASH.EXE
+CCC = icc -q -DXP_OS2 -DOS2=4 -N10
+LINK = ilink
+AR = emxomfar -p256 r $@
+# Keep AR_FLAGS blank so that we do not have to change rules.mk
+AR_FLAGS =
+RANLIB = @echo OS2 RANLIB
+BSDECHO = @echo OS2 BSDECHO
+
+ifndef NO_SHARED_LIB
+WRAP_MALLOC_LIB =
+WRAP_MALLOC_CFLAGS =
+DSO_CFLAGS =
+DSO_PIC_CFLAGS =
+MKSHLIB = $(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@
+MKCSHLIB = $(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@
+MKSHLIB_FORCE_ALL =
+MKSHLIB_UNFORCE_ALL =
+DSO_LDOPTS = -Zomf -Zdll -Zmt -Zcrtdll -Zlinker /NOO
+# DLL_SUFFIX = .dll
+SHLIB_LDSTARTFILE =
+SHLIB_LDENDFILE =
+endif
+
+# HCT Include from Mozilla client build.
+INCLUDES = -I$(CORE_DEPTH)/../dist/include -I$(CORE_DEPTH)/../include
+
+# This is where Mozilla Client build DIST & INCLUDE.
+# while DIST is where Security build put it LIB & INCLUDE
+MOZ_DIST = $(CORE_DEPTH)/../dist
+MOZ_LIB = $(CORE_DEPTH)/../dist/lib
+
+OS_CFLAGS = -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Zmtd -Zomf -Zmt -DDEBUG -DDEBUG_wintrinh -DTRACING -g
+
+# Where the libraries are
+MOZ_COMPONENT_NSPR_LIBS=-L$(DIST)/lib $(NSPR_LIBS)
+NSPR_LIBS = -lplds4 -lplc4 -lnspr4
+NSPR_INCLUDE_DIR =
+
+
+
+ifdef BUILD_OPT
+OPTIMIZER = -O+ -Oi
+DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
+DLLFLAGS = -DLL -OUT:$@ -MAP:$(@:.dll=.map)
+EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
+OBJDIR_TAG = _OPT
+else
+#OPTIMIZER = -O+ -Oi
+DEFINES += -DDEBUG -D_DEBUG -DDEBUGPRINTS #HCT Need += to avoid overidding manifest.mn
+DLLFLAGS = -DEBUG -DLL -OUT:$@ -MAP:$(@:.dll=.map)
+EXEFLAGS = -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
+OBJDIR_TAG = _DBG
+LDFLAGS = -DEBUG
+endif
+
+# OS/2 use nsinstall that is included in the toolkit.
+# since we do not wish to support and maintain 3 version of nsinstall in mozilla, nspr and nss
+
+NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
+# NSINSTALL = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall
+NSINSTALL = nsinstall # HCT4OS2
+INSTALL = $(NSINSTALL)
+
+MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
+MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend
+MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk
+
+####################################################################
+#
+# One can define the makefile variable NSDISTMODE to control
+# how files are published to the 'dist' directory. If not
+# defined, the default is "install using relative symbolic
+# links". The two possible values are "copy", which copies files
+# but preserves source mtime, and "absolute_symlink", which
+# installs using absolute symbolic links. The "absolute_symlink"
+# option requires NFSPWD.
+# - THIS IS NOT PART OF THE NEW BINARY RELEASE PLAN for 9/30/97
+# - WE'RE KEEPING IT ONLY FOR BACKWARDS COMPATIBILITY
+####################################################################
+
+ifeq ($(NSDISTMODE),copy)
+ # copy files, but preserve source mtime
+ INSTALL = $(NSINSTALL)
+ INSTALL += -t
+else
+ ifeq ($(NSDISTMODE),absolute_symlink)
+ # install using absolute symbolic links
+ INSTALL = $(NSINSTALL)
+ INSTALL += -L `$(NFSPWD)`
+ else
+ # install using relative symbolic links
+ INSTALL = $(NSINSTALL)
+ INSTALL += -R
+ endif
+endif
+
+define MAKE_OBJDIR
+if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
+endef
diff --git a/security/coreconf/arch.mk b/security/coreconf/arch.mk
index 691acb856..57af21a2d 100644
--- a/security/coreconf/arch.mk
+++ b/security/coreconf/arch.mk
@@ -290,3 +290,12 @@ endif
endif
endif
+#
+# For OS/2
+#
+ifeq ($(OS_ARCH), OS_2)
+OS_ARCH := OS2
+OS_RELEASE := $(shell uname -v)
+OS_CONFIG := $(OS_ARCH)
+endif
+
diff --git a/security/coreconf/suffix.mk b/security/coreconf/suffix.mk
index e1db4ed7d..9c741cce1 100644
--- a/security/coreconf/suffix.mk
+++ b/security/coreconf/suffix.mk
@@ -43,7 +43,11 @@ ifndef OBJ_SUFFIX
ifeq ($(OS_ARCH), WINNT)
OBJ_SUFFIX = .obj
else
+ ifeq ($(OS_ARCH), OS2)
+ OBJ_SUFFIX = .obj
+ else
OBJ_SUFFIX = .o
+ endif
endif
endif
@@ -127,6 +131,10 @@ ifndef PROG_SUFFIX
ifeq ($(OS_ARCH), WINNT)
PROG_SUFFIX = .exe
else
+ ifeq ($(OS_ARCH), OS2)
+ PROG_SUFFIX = .exe
+ else
PROG_SUFFIX =
+ endif
endif
endif
diff --git a/security/nss/Makefile b/security/nss/Makefile
index b7fc0ad25..3671b10e6 100644
--- a/security/nss/Makefile
+++ b/security/nss/Makefile
@@ -79,7 +79,7 @@ include $(CORE_DEPTH)/coreconf/rules.mk
moz_import::
$(NSINSTALL) -L ../../../dist include $(DIST)
$(NSINSTALL) -L ../../../dist lib $(DIST)
- cp $(DIST)/lib/libmozdbm_s.a $(DIST)/lib/libdbm.a
+ cp $(DIST)/lib/libmozdbm_s.$(LIB_SUFFIX) $(DIST)/lib/libdbm.$(LIB_SUFFIX)
nsm:: all
cd ssm/lib/protocol; gmake
diff --git a/security/nss/cmd/Makefile b/security/nss/cmd/Makefile
index 7265e3919..dd012940e 100644
--- a/security/nss/cmd/Makefile
+++ b/security/nss/cmd/Makefile
@@ -100,34 +100,34 @@ US_FLAGS = -DEXPORT_VERSION
EXPORT_FLAGS = -DEXPORT_VERSION
BASE_LIBS = \
- $(DIST)/lib/libdbm.a \
- $(DIST)/lib/libxp.a \
- $(DIST)/lib/libnspr.a \
+ $(DIST)/lib/libdbm.$(LIB_SUFFIX) \
+ $(DIST)/lib/libxp.$(LIB_SUFFIX) \
+ $(DIST)/lib/libnspr.$(LIB_SUFFIX) \
$(NULL)
-# $(DIST)/lib/libpurenspr.a \
+# $(DIST)/lib/libpurenspr.$(LIB_SUFFIX) \
#There is a circular dependancy in security/lib, and here is a gross fix
SEC_LIBS = \
- $(DIST)/lib/libsecnav.a \
- $(DIST)/lib/libssl.a \
- $(DIST)/lib/libpkcs7.a \
- $(DIST)/lib/libcert.a \
- $(DIST)/lib/libkey.a \
- $(DIST)/lib/libsecmod.a \
- $(DIST)/lib/libcrypto.a \
- $(DIST)/lib/libsecutil.a \
- $(DIST)/lib/libssl.a \
- $(DIST)/lib/libpkcs7.a \
- $(DIST)/lib/libcert.a \
- $(DIST)/lib/libkey.a \
- $(DIST)/lib/libsecmod.a \
- $(DIST)/lib/libcrypto.a \
- $(DIST)/lib/libsecutil.a \
- $(DIST)/lib/libhash.a \
+ $(DIST)/lib/libsecnav.$(LIB_SUFFIX) \
+ $(DIST)/lib/libssl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcert.$(LIB_SUFFIX) \
+ $(DIST)/lib/libkey.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecmod.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcrypto.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
+ $(DIST)/lib/libssl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcert.$(LIB_SUFFIX) \
+ $(DIST)/lib/libkey.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecmod.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcrypto.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
+ $(DIST)/lib/libhash.$(LIB_SUFFIX) \
$(NULL)
-MYLIB = lib/$(OBJDIR)/libsectool.a
+MYLIB = lib/$(OBJDIR)/libsectool.$(LIB_SUFFIX)
US_LIBS = $(MYLIB) $(SEC_LIBS) $(BASE_LIBS) $(MYLIB) $(BASE_LIBS)
EX_LIBS = $(MYLIB) $(SEC_LIBS) $(BASE_LIBS) $(MYLIB) $(BASE_LIBS)
diff --git a/security/nss/cmd/certutil/keystuff.c b/security/nss/cmd/certutil/keystuff.c
index 5b023f27e..b39c58936 100644
--- a/security/nss/cmd/certutil/keystuff.c
+++ b/security/nss/cmd/certutil/keystuff.c
@@ -41,7 +41,7 @@
#include <termios.h>
#endif
-#if defined(XP_WIN)
+#if defined(XP_WIN) || defined (XP_PC)
#include <time.h>
#include <conio.h>
#endif
diff --git a/security/nss/cmd/crmf-cgi/Makefile b/security/nss/cmd/crmf-cgi/Makefile
index e9b03eaf1..29f3357c3 100644
--- a/security/nss/cmd/crmf-cgi/Makefile
+++ b/security/nss/cmd/crmf-cgi/Makefile
@@ -67,7 +67,7 @@ endif
ifeq ($(OS_ARCH), WINNT)
EXTRA_LIBS += $(DIST)/lib/crmf.lib
else
-EXTRA_LIBS += $(DIST)/lib/libcrmf.a
+EXTRA_LIBS += $(DIST)/lib/libcrmf.$(LIB_SUFFIX)
endif
include ../platlibs.mk
diff --git a/security/nss/cmd/crmftest/Makefile b/security/nss/cmd/crmftest/Makefile
index 3c393e58d..9eae3715a 100644
--- a/security/nss/cmd/crmftest/Makefile
+++ b/security/nss/cmd/crmftest/Makefile
@@ -66,7 +66,7 @@ endif
ifeq ($(OS_ARCH), WINNT)
EXTRA_LIBS += $(DIST)/lib/crmf.lib
else
-EXTRA_LIBS += $(DIST)/lib/libcrmf.a
+EXTRA_LIBS += $(DIST)/lib/libcrmf.$(LIB_SUFFIX)
endif
include ../platlibs.mk
diff --git a/security/nss/cmd/pk12util/Makefile b/security/nss/cmd/pk12util/Makefile
index 183d8a607..4b1e82238 100644
--- a/security/nss/cmd/pk12util/Makefile
+++ b/security/nss/cmd/pk12util/Makefile
@@ -67,8 +67,8 @@ EXTRA_LIBS = \
else
EXTRA_LIBS += \
- $(DIST)/lib/libpkcs12.a \
- $(DIST)/lib/libpkcs7.a \
+ $(DIST)/lib/libpkcs12.$(LIB_SUFFIX) \
+ $(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
$(NULL)
endif
diff --git a/security/nss/cmd/platlibs.mk b/security/nss/cmd/platlibs.mk
index c32653f91..2c08e6d0d 100644
--- a/security/nss/cmd/platlibs.mk
+++ b/security/nss/cmd/platlibs.mk
@@ -75,32 +75,32 @@ else
# $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
ifdef MOZILLA_SECURITY_BUILD
- CRYPTOLIB=$(DIST)/lib/libcrypto.a
+ CRYPTOLIB=$(DIST)/lib/libcrypto.$(LIB_SUFFIX)
endif
ifdef MOZILLA_BSAFE_BUILD
- CRYPTOLIB=$(DIST)/lib/libbsafe.a
+ CRYPTOLIB=$(DIST)/lib/libbsafe.$(LIB_SUFFIX)
endif
EXTRA_LIBS += \
- $(DIST)/lib/libssl.a \
- $(DIST)/lib/libjar.a \
- $(DIST)/lib/libzlib.a \
- $(DIST)/lib/libnss.a \
- $(DIST)/lib/libssl.a \
- $(DIST)/lib/libsectool.a \
- $(DIST)/lib/libpkcs7.a \
- $(DIST)/lib/libcerthi.a \
- $(DIST)/lib/libpk11wrap.a \
- $(DIST)/lib/libcryptohi.a \
- $(DIST)/lib/libcerthi.a \
- $(DIST)/lib/libpk11wrap.a \
- $(DIST)/lib/libsoftoken.a \
- $(DIST)/lib/libcertdb.a \
- $(DIST)/lib/libswfci.a \
- $(DIST)/lib/libfreebl.a \
+ $(DIST)/lib/libssl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libjar.$(LIB_SUFFIX) \
+ $(DIST)/lib/libzlib.$(LIB_SUFFIX) \
+ $(DIST)/lib/libnss.$(LIB_SUFFIX) \
+ $(DIST)/lib/libssl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsectool.$(LIB_SUFFIX) \
+ $(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcerthi.$(LIB_SUFFIX) \
+ $(DIST)/lib/libpk11wrap.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcryptohi.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcerthi.$(LIB_SUFFIX) \
+ $(DIST)/lib/libpk11wrap.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsoftoken.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcertdb.$(LIB_SUFFIX) \
+ $(DIST)/lib/libswfci.$(LIB_SUFFIX) \
+ $(DIST)/lib/libfreebl.$(LIB_SUFFIX) \
$(CRYPTOLIB) \
- $(DIST)/lib/libfreebl.a \
- $(DIST)/lib/libsecutil.a \
- $(DIST)/lib/libdbm.a \
+ $(DIST)/lib/libfreebl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
+ $(DIST)/lib/libdbm.$(LIB_SUFFIX) \
$(NULL)
# $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
diff --git a/security/nss/cmd/signtool/Makefile b/security/nss/cmd/signtool/Makefile
index 966fafd6f..a5e8f46ef 100644
--- a/security/nss/cmd/signtool/Makefile
+++ b/security/nss/cmd/signtool/Makefile
@@ -69,8 +69,8 @@ EXTRA_LIBS = \
else
EXTRA_LIBS += \
- $(DIST)/lib/libjar.a \
- $(DIST)/lib/libzlib.a \
+ $(DIST)/lib/libjar.$(LIB_SUFFIX) \
+ $(DIST)/lib/libzlib.$(LIB_SUFFIX) \
$(NULL)
endif
diff --git a/security/nss/cmd/swfort/Makefile b/security/nss/cmd/swfort/Makefile
index a483a2463..a5b4350a6 100644
--- a/security/nss/cmd/swfort/Makefile
+++ b/security/nss/cmd/swfort/Makefile
@@ -55,35 +55,35 @@ US_FLAGS = -DEXPORT_VERSION
EXPORT_FLAGS = -DEXPORT_VERSION
BASE_LIBS = \
- $(DIST)/lib/libdbm.a \
- $(DIST)/lib/libxp.a \
- $(DIST)/lib/libnspr.a \
+ $(DIST)/lib/libdbm.$(LIB_SUFFIX) \
+ $(DIST)/lib/libxp.$(LIB_SUFFIX) \
+ $(DIST)/lib/libnspr.$(LIB_SUFFIX) \
$(NULL)
-# $(DIST)/lib/libpurenspr.a \
+# $(DIST)/lib/libpurenspr.$(LIB_SUFFIX) \
#There are a circular dependancies in security/lib, and we deal with it by
# double linking some libraries
SEC_LIBS = \
- $(DIST)/lib/libsecnav.a \
- $(DIST)/lib/libssl.a \
- $(DIST)/lib/libpkcs7.a \
- $(DIST)/lib/libcert.a \
- $(DIST)/lib/libkey.a \
- $(DIST)/lib/libsecmod.a \
- $(DIST)/lib/libcrypto.a \
- $(DIST)/lib/libsecutil.a \
- $(DIST)/lib/libssl.a \
- $(DIST)/lib/libpkcs7.a \
- $(DIST)/lib/libcert.a \
- $(DIST)/lib/libkey.a \
- $(DIST)/lib/libsecmod.a \
- $(DIST)/lib/libcrypto.a \
- $(DIST)/lib/libsecutil.a \
- $(DIST)/lib/libhash.a \
+ $(DIST)/lib/libsecnav.$(LIB_SUFFIX) \
+ $(DIST)/lib/libssl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcert.$(LIB_SUFFIX) \
+ $(DIST)/lib/libkey.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecmod.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcrypto.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
+ $(DIST)/lib/libssl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcert.$(LIB_SUFFIX) \
+ $(DIST)/lib/libkey.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecmod.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcrypto.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
+ $(DIST)/lib/libhash.$(LIB_SUFFIX) \
$(NULL)
-MYLIB = lib/$(OBJDIR)/libsectool.a
+MYLIB = lib/$(OBJDIR)/libsectool.$(LIB_SUFFIX)
US_LIBS = $(MYLIB) $(SEC_LIBS) $(BASE_LIBS) $(MYLIB) $(BASE_LIBS)
EX_LIBS = $(MYLIB) $(SEC_LIBS) $(BASE_LIBS) $(MYLIB) $(BASE_LIBS)
diff --git a/security/nss/cmd/swfort/newuser/Makefile b/security/nss/cmd/swfort/newuser/Makefile
index 907b29e6f..d65b21949 100644
--- a/security/nss/cmd/swfort/newuser/Makefile
+++ b/security/nss/cmd/swfort/newuser/Makefile
@@ -60,7 +60,7 @@ EXTRA_LIBS = \
else
EXTRA_LIBS += \
- ../../../lib/fortcrypt/$(OBJDIR)/cilib.a \
+ ../../../lib/fortcrypt/$(OBJDIR)/cilib.$(LIB_SUFFIX) \
$(NULL)
endif
diff --git a/security/nss/lib/fortcrypt/fpkmem.h b/security/nss/lib/fortcrypt/fpkmem.h
index f0530dbcb..c35370be0 100644
--- a/security/nss/lib/fortcrypt/fpkmem.h
+++ b/security/nss/lib/fortcrypt/fpkmem.h
@@ -41,7 +41,7 @@
#define NUM_SLOTS 32
-#if !defined (XP_UNIX) && !defined (_WINDOWS)
+#if !defined (XP_UNIX) && !defined (_WINDOWS) && !defined(XP_OS2)
#define XP_MAC 1 /*Make sure we get this define in for Mac builds*/
#endif
diff --git a/security/nss/lib/fortcrypt/swfort/pkcs11/Makefile b/security/nss/lib/fortcrypt/swfort/pkcs11/Makefile
index 9595d91fe..af6311bee 100644
--- a/security/nss/lib/fortcrypt/swfort/pkcs11/Makefile
+++ b/security/nss/lib/fortcrypt/swfort/pkcs11/Makefile
@@ -71,22 +71,22 @@ else
#
ifneq ($(OS_ARCH), OSF1)
-CRYPTO_LIBS = $(DIST)/lib/libfreebl.a
+CRYPTO_LIBS = $(DIST)/lib/libfreebl.$(LIB_SUFFIX)
ifdef MOZILLA_SECURITY_BUILD
-CRYPTO_LIBS += $(DIST)/lib/libcrypto.a
+CRYPTO_LIBS += $(DIST)/lib/libcrypto.$(LIB_SUFFIX)
endif
ifdef MOZILLA_BSAFE_BUILD
-CRYPTO_LIBS += $(DIST)/lib/libbsafe.a
+CRYPTO_LIBS += $(DIST)/lib/libbsafe.$(LIB_SUFFIX)
endif
EXTRA_LIBS += \
- $(DIST)/lib/libswfci.a \
- $(DIST)/lib/libsoftoken.a \
+ $(DIST)/lib/libswfci.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsoftoken.$(LIB_SUFFIX) \
$(CRYPTO_LIBS) \
- $(DIST)/lib/libsecutil.a \
- $(DIST)/lib/libplc4.a \
- $(DIST)/lib/libplds4.a \
+ $(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
+ $(DIST)/lib/libplc4.$(LIB_SUFFIX) \
+ $(DIST)/lib/libplds4.$(LIB_SUFFIX) \
$(NULL)
endif
diff --git a/security/nss/lib/fortcrypt/swfort/swfutl.c b/security/nss/lib/fortcrypt/swfort/swfutl.c
index 740444c3a..db5a97b67 100644
--- a/security/nss/lib/fortcrypt/swfort/swfutl.c
+++ b/security/nss/lib/fortcrypt/swfort/swfutl.c
@@ -44,6 +44,9 @@
#include "maci.h"
#include "secport.h"
#include "secrng.h"
+#ifdef XP_OS2
+#include <stat.h> /* Needed for OS/2 emx */
+#endif
#ifdef XP_WIN
#include <windows.h>
@@ -395,10 +398,19 @@ fort_GenerateRandom(unsigned char *buf, int bytes)
/*
* NOTE: that MAC is missing below.
*/
+#if defined (XP_UNIX) || defined (XP_OS2)
#ifdef XP_UNIX
#define NS_PATH_SEP ':'
#define NS_DIR_SEP '/'
#define NS_DEFAULT_PATH ".:/bin/netscape:/etc/netscape/:/etc"
+#endif
+
+#ifdef XP_OS2 /* for OS/2 */
+#define NS_PATH_SEP ';'
+#define NS_DIR_SEP '\\'
+#define NS_DEFAULT_PATH ".:\\bin\\netscape:\\etc\\netscape\\:\\etc"
+#endif
+
PRInt32
local_getFileInfo(const char *fn, PRFileInfo *info)
{
@@ -428,7 +440,8 @@ local_getFileInfo(const char *fn, PRFileInfo *info)
}
return rv;
}
-#endif
+#endif /* UNIX & OS/2 */
+
#ifdef XP_WIN
#define NS_PATH_SEP ';'
#define NS_DIR_SEP '\\'
@@ -609,7 +622,8 @@ local_getFileInfo(const char *fn, PRFileInfo *info)
return 0;
}
-#endif
+#endif /* XP_WIN */
+
#ifdef XP_MAC
#error Need to write fort_FindFileInPath for Mac
#define NS_PATH_SEP ','
diff --git a/security/nss/lib/freebl/Makefile b/security/nss/lib/freebl/Makefile
index 712a0516a..1680ee361 100644
--- a/security/nss/lib/freebl/Makefile
+++ b/security/nss/lib/freebl/Makefile
@@ -78,7 +78,7 @@ ifdef MOZILLA_BSAFE_BUILD
ifeq ($(OS_ARCH),WINNT)
libbsafe=bsafe41.lib
else
-libbsafe=libbsafe.a
+libbsafe=libbsafe.$(LIB_SUFFIX)
endif
private_export::
diff --git a/security/nss/lib/ssl/Makefile b/security/nss/lib/ssl/Makefile
index 577dc8ac6..421eb355f 100644
--- a/security/nss/lib/ssl/Makefile
+++ b/security/nss/lib/ssl/Makefile
@@ -59,8 +59,12 @@ include config.mk
ifeq ($(OS_ARCH),WINNT)
CSRCS += win32err.c
else
+ifeq ($(OS_ARCH),OS2)
+CSRCS += os2err.c
+else
CSRCS += unix_err.c
endif
+endif
#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
diff --git a/security/nss/lib/ssl/os2_err.c b/security/nss/lib/ssl/os2_err.c
new file mode 100644
index 000000000..77d49df2f
--- /dev/null
+++ b/security/nss/lib/ssl/os2_err.c
@@ -0,0 +1,310 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * This file essentially replicates NSPR's source for the functions that
+ * map system-specific error codes to NSPR error codes. We would use
+ * NSPR's functions, instead of duplicating them, but they're private.
+ * As long as SSL's server session cache code must do platform native I/O
+ * to accomplish its job, and NSPR's error mapping functions remain private,
+ * this code will continue to need to be replicated.
+ *
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code is the Netscape security libraries.
+ *
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1994-2000 Netscape Communications Corporation. All
+ * Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License Version 2 or later (the
+ * "GPL"), in which case the provisions of the GPL are applicable
+ * instead of those above. If you wish to allow use of your
+ * version of this file only under the terms of the GPL and not to
+ * allow others to use your version of this file under the MPL,
+ * indicate your decision by deleting the provisions above and
+ * replace them with the notice and other provisions required by
+ * the GPL. If you do not delete the provisions above, a recipient
+ * may use your version of this file under either the MPL or the
+ * GPL.
+ *
+ * $Id$
+ */
+
+#include "prerror.h"
+#include "prlog.h"
+#include <errno.h>
+
+
+/*
+ * Based on win32err.c
+ * OS2TODO Stub everything for now to build. HCT
+ */
+
+/* forward declaration. */
+void nss_MD_os2_map_default_error(PRInt32 err);
+
+void nss_MD_os2_map_opendir_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_closedir_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_readdir_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_delete_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+/* The error code for stat() is in errno. */
+void nss_MD_os2_map_stat_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_fstat_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_rename_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+/* The error code for access() is in errno. */
+void nss_MD_os2_map_access_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_mkdir_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_rmdir_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_read_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_transmitfile_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_write_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_lseek_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_fsync_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+/*
+ * For both CloseHandle() and closesocket().
+ */
+void nss_MD_os2_map_close_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_socket_error(PRInt32 err)
+{
+// PR_ASSERT(err != WSANOTINITIALISED);
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_recv_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_recvfrom_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_send_error(PRInt32 err)
+{
+ PRErrorCode prError;
+ switch (err) {
+// case WSAEMSGSIZE: prError = PR_INVALID_ARGUMENT_ERROR; break;
+ default: nss_MD_os2_map_default_error(err); return;
+ }
+ PR_SetError(prError, err);
+}
+
+void nss_MD_os2_map_sendto_error(PRInt32 err)
+{
+ PRErrorCode prError;
+ switch (err) {
+// case WSAEMSGSIZE: prError = PR_INVALID_ARGUMENT_ERROR; break;
+ default: nss_MD_os2_map_default_error(err); return;
+ }
+ PR_SetError(prError, err);
+}
+
+void nss_MD_os2_map_accept_error(PRInt32 err)
+{
+ PRErrorCode prError;
+ switch (err) {
+// case WSAEOPNOTSUPP: prError = PR_NOT_TCP_SOCKET_ERROR; break;
+// case WSAEINVAL: prError = PR_INVALID_STATE_ERROR; break;
+ default: nss_MD_os2_map_default_error(err); return;
+ }
+ PR_SetError(prError, err);
+}
+
+void nss_MD_os2_map_acceptex_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_connect_error(PRInt32 err)
+{
+ PRErrorCode prError;
+ switch (err) {
+// case WSAEWOULDBLOCK: prError = PR_IN_PROGRESS_ERROR; break;
+// case WSAEINVAL: prError = PR_ALREADY_INITIATED_ERROR; break;
+// case WSAETIMEDOUT: prError = PR_IO_TIMEOUT_ERROR; break;
+ default: nss_MD_os2_map_default_error(err); return;
+ }
+ PR_SetError(prError, err);
+}
+
+void nss_MD_os2_map_bind_error(PRInt32 err)
+{
+ PRErrorCode prError;
+ switch (err) {
+// case WSAEINVAL: prError = PR_SOCKET_ADDRESS_IS_BOUND_ERROR; break;
+ default: nss_MD_os2_map_default_error(err); return;
+ }
+ PR_SetError(prError, err);
+}
+
+void nss_MD_os2_map_listen_error(PRInt32 err)
+{
+ PRErrorCode prError;
+ switch (err) {
+// case WSAEOPNOTSUPP: prError = PR_NOT_TCP_SOCKET_ERROR; break;
+// case WSAEINVAL: prError = PR_INVALID_STATE_ERROR; break;
+ default: nss_MD_os2_map_default_error(err); return;
+ }
+ PR_SetError(prError, err);
+}
+
+void nss_MD_os2_map_shutdown_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_getsockname_error(PRInt32 err)
+{
+ PRErrorCode prError;
+ switch (err) {
+// case WSAEINVAL: prError = PR_INVALID_STATE_ERROR; break;
+ default: nss_MD_os2_map_default_error(err); return;
+ }
+ PR_SetError(prError, err);
+}
+
+void nss_MD_os2_map_getpeername_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_getsockopt_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_setsockopt_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_open_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+void nss_MD_os2_map_gethostname_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+/* Win32 select() only works on sockets. So in this
+** context, WSAENOTSOCK is equivalent to EBADF on Unix.
+*/
+void nss_MD_os2_map_select_error(PRInt32 err)
+{
+ PRErrorCode prError;
+ switch (err) {
+// case WSAENOTSOCK: prError = PR_BAD_DESCRIPTOR_ERROR; break;
+ default: nss_MD_os2_map_default_error(err); return;
+ }
+ PR_SetError(prError, err);
+}
+
+void nss_MD_os2_map_lockf_error(PRInt32 err)
+{
+ nss_MD_os2_map_default_error(err);
+}
+
+
+
+void nss_MD_os2_map_default_error(PRInt32 err)
+{
+ PRErrorCode prError;
+
+ switch (err) {
+// case ENOENT: prError = PR_FILE_NOT_FOUND_ERROR; break;
+// case ERROR_ACCESS_DENIED: prError = PR_NO_ACCESS_RIGHTS_ERROR; break;
+// case ERROR_ALREADY_EXISTS: prError = PR_FILE_EXISTS_ERROR; break;
+// case ERROR_DISK_CORRUPT: prError = PR_IO_ERROR; break;
+// case ERROR_DISK_FULL: prError = PR_NO_DEVICE_SPACE_ERROR; break;
+// case ERROR_DISK_OPERATION_FAILED: prError = PR_IO_ERROR; break;
+// case ERROR_DRIVE_LOCKED: prError = PR_FILE_IS_LOCKED_ERROR; break;
+// case ERROR_FILENAME_EXCED_RANGE: prError = PR_NAME_TOO_LONG_ERROR; break;
+// case ERROR_FILE_CORRUPT: prError = PR_IO_ERROR; break;
+// case ERROR_FILE_EXISTS: prError = PR_FILE_EXISTS_ERROR; break;
+// case ERROR_FILE_INVALID: prError = PR_BAD_DESCRIPTOR_ERROR; break;
+#if ERROR_FILE_NOT_FOUND != ENOENT
+// case ERROR_FILE_NOT_FOUND: prError = PR_FILE_NOT_FOUND_ERROR; break;
+#endif
+ default: prError = PR_UNKNOWN_ERROR; break;
+ }
+ PR_SetError(prError, err);
+}
+
diff --git a/security/nss/lib/ssl/os2_err.h b/security/nss/lib/ssl/os2_err.h
new file mode 100644
index 000000000..7f80c0177
--- /dev/null
+++ b/security/nss/lib/ssl/os2_err.h
@@ -0,0 +1,83 @@
+/*
+ * This file essentially replicates NSPR's source for the functions that
+ * map system-specific error codes to NSPR error codes. We would use
+ * NSPR's functions, instead of duplicating them, but they're private.
+ * As long as SSL's server session cache code must do platform native I/O
+ * to accomplish its job, and NSPR's error mapping functions remain private,
+ * This code will continue to need to be replicated.
+ *
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code is the Netscape security libraries.
+ *
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1994-2000 Netscape Communications Corporation. All
+ * Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License Version 2 or later (the
+ * "GPL"), in which case the provisions of the GPL are applicable
+ * instead of those above. If you wish to allow use of your
+ * version of this file only under the terms of the GPL and not to
+ * allow others to use your version of this file under the MPL,
+ * indicate your decision by deleting the provisions above and
+ * replace them with the notice and other provisions required by
+ * the GPL. If you do not delete the provisions above, a recipient
+ * may use your version of this file under either the MPL or the
+ * GPL.
+ *
+ * $Id$
+ */
+
+/* NSPR doesn't make these functions public, so we have to duplicate
+** them in NSS.
+*/
+
+//HCT Based on Win32err.h
+extern void nss_MD_os2_map_accept_error(PRInt32 err);
+extern void nss_MD_os2_map_acceptex_error(PRInt32 err);
+extern void nss_MD_os2_map_access_error(PRInt32 err);
+extern void nss_MD_os2_map_bind_error(PRInt32 err);
+extern void nss_MD_os2_map_close_error(PRInt32 err);
+extern void nss_MD_os2_map_closedir_error(PRInt32 err);
+extern void nss_MD_os2_map_connect_error(PRInt32 err);
+extern void nss_MD_os2_map_default_error(PRInt32 err);
+extern void nss_MD_os2_map_delete_error(PRInt32 err);
+extern void nss_MD_os2_map_fstat_error(PRInt32 err);
+extern void nss_MD_os2_map_fsync_error(PRInt32 err);
+extern void nss_MD_os2_map_gethostname_error(PRInt32 err);
+extern void nss_MD_os2_map_getpeername_error(PRInt32 err);
+extern void nss_MD_os2_map_getsockname_error(PRInt32 err);
+extern void nss_MD_os2_map_getsockopt_error(PRInt32 err);
+extern void nss_MD_os2_map_listen_error(PRInt32 err);
+extern void nss_MD_os2_map_lockf_error(PRInt32 err);
+extern void nss_MD_os2_map_lseek_error(PRInt32 err);
+extern void nss_MD_os2_map_mkdir_error(PRInt32 err);
+extern void nss_MD_os2_map_open_error(PRInt32 err);
+extern void nss_MD_os2_map_opendir_error(PRInt32 err);
+extern void nss_MD_os2_map_read_error(PRInt32 err);
+extern void nss_MD_os2_map_readdir_error(PRInt32 err);
+extern void nss_MD_os2_map_recv_error(PRInt32 err);
+extern void nss_MD_os2_map_recvfrom_error(PRInt32 err);
+extern void nss_MD_os2_map_rename_error(PRInt32 err);
+extern void nss_MD_os2_map_rmdir_error(PRInt32 err);
+extern void nss_MD_os2_map_select_error(PRInt32 err);
+extern void nss_MD_os2_map_send_error(PRInt32 err);
+extern void nss_MD_os2_map_sendto_error(PRInt32 err);
+extern void nss_MD_os2_map_setsockopt_error(PRInt32 err);
+extern void nss_MD_os2_map_shutdown_error(PRInt32 err);
+extern void nss_MD_os2_map_socket_error(PRInt32 err);
+extern void nss_MD_os2_map_stat_error(PRInt32 err);
+extern void nss_MD_os2_map_transmitfile_error(PRInt32 err);
+extern void nss_MD_os2_map_write_error(PRInt32 err);
diff --git a/security/nss/lib/util/manifest.mn b/security/nss/lib/util/manifest.mn
index 0dd2f3d7e..1ff25e6a4 100644
--- a/security/nss/lib/util/manifest.mn
+++ b/security/nss/lib/util/manifest.mn
@@ -86,7 +86,7 @@ CSRCS = \
utf8.c \
$(NULL)
-ifeq ($(subst /,_,$(shell uname -s)),OS2)
+ifeq ($(subst /,,$(shell uname -s)),OS2)
CSRCS += os2_rand.c
endif
diff --git a/security/nss/lib/util/os2_rand.c b/security/nss/lib/util/os2_rand.c
index cbe20a205..7ee06f854 100644
--- a/security/nss/lib/util/os2_rand.c
+++ b/security/nss/lib/util/os2_rand.c
@@ -36,6 +36,9 @@
#include <os2.h>
#include <secrng.h>
#include <stdlib.h>
+#include <time.h>
+#include <stdio.h>
+#include <stat.h>
static BOOL clockTickTime(unsigned long *phigh, unsigned long *plow)
{
diff --git a/security/nss/lib/util/secport.c b/security/nss/lib/util/secport.c
index 76b0b195b..fd448cec1 100644
--- a/security/nss/lib/util/secport.c
+++ b/security/nss/lib/util/secport.c
@@ -58,7 +58,7 @@
#include "prthread.h"
#endif /* THREADMARK */
-#if defined(XP_UNIX) || defined(XP_MAC)
+#if defined(XP_UNIX) || defined(XP_MAC) || defined(XP_OS2)
#include <stdlib.h>
#else
#include "wtypes.h"