There is a running bugzilla entry for integrating security into the UNIX build (http://bugzilla.mozilla.org/show_bug.cgi?id=60912 ). Get the latest patch provided by [EMAIL PROTECTED] there. You will need this.
1) cvs co mozilla/client.mk
2) Now, update this client.mk with the 60912 patch
3) gmake -f client.mk pull_all
4) Now update the remaining files from the 60912 patch.
5) Below are my OS/2 diffs for security. Apply these to the tree.
Some of the changes in my diffs will be changes from the 60912 patch.
6) Build mozilla
You can check if security build by:
- clicking on the picture of the lock in the bottom-right corner
- trying the tests on http://www.mozilla.org/quality/security/smoketest.html
Post your results to the newsgroup.
Javier Pedemonte
IBM
Index: nsPSMUICallbacks.cpp
===================================================================
RCS file: /cvsroot/mozilla/extensions/psm-glue/src/nsPSMUICallbacks.cpp,v
retrieving revision 1.24
diff -u -r1.24 nsPSMUICallbacks.cpp
--- nsPSMUICallbacks.cpp 2000/10/16 20:11:08 1.24
+++ nsPSMUICallbacks.cpp 2000/12/13 23:34:03
@@ -106,7 +106,7 @@
char buffer[256];
PR_snprintf(buffer,
sizeof(buffer),
-#ifdef WIN32
+#if defined(WIN32) || defined(XP_OS2)
modal ? "menubar=no,height=%d,width=%d,dependent,modal"
#else
(modal && win) ? "menubar=no,height=%d,width=%d,dependent"
@@ -119,7 +119,7 @@
if (argv) {
// open the window
nsIDOMWindowInternal *newWindow;
-#ifdef WIN32
+#if defined(WIN32) || defined(XP_OS2)
if (modal && win) {
parentWindow->OpenDialog(jsContext, argv, 3, &newWindow);
} else {
Index: nsPSMComponent.cpp
===================================================================
RCS file: /cvsroot/mozilla/extensions/psm-glue/src/nsPSMComponent.cpp,v
retrieving revision 1.34
diff -u -r1.34 nsPSMComponent.cpp
--- nsPSMComponent.cpp 2000/10/30 23:35:46 1.34
+++ nsPSMComponent.cpp 2000/12/13 23:34:25
@@ -66,7 +66,7 @@
#define PSM_VERSION_REG_KEY "/Netscape/Personal Security Manager"
-#ifdef WIN32
+#if defined(WIN32) || defined(XP_OS2)
#define PSM_FILE_NAME "psm.exe"
#elif XP_UNIX
#define PSM_FILE_NAME "start-psm"
Index: prinet.h
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/include/prinet.h,v
retrieving revision 3.7
diff -u -r3.7 prinet.h
--- prinet.h 1999/09/14 19:39:46 3.7
+++ prinet.h 2000/12/13 23:43:57
@@ -75,7 +75,7 @@
* socket headers.
*/
#if defined(OS2) && !defined(INADDR_LOOPBACK)
-#define INADDR_LOOPBACK gethostid()
+#define INADDR_LOOPBACK 0x7f000001
#endif
/*
Index: os2sock.c
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/os2/os2sock.c,v
retrieving revision 3.4
diff -u -r3.4 os2sock.c
--- os2sock.c 1999/04/21 21:39:21 3.4
+++ os2sock.c 2000/12/13 23:47:05
@@ -55,7 +55,7 @@
{
int rv = sock_errno();
soclose(sock);
- _PR_MD_MAP_SOCKET_ERROR(rv);
+ _PR_MD_MAP_SOCKET_ERROR(rv);
return (PRInt32) -1;
}
@@ -82,8 +82,8 @@
PRInt32 rv = -1;
rv = soclose((int) osfd );
- if (rv < 0)
- _PR_MD_MAP_SOCKET_ERROR(sock_errno());
+ if (rv < 0)
+ _PR_MD_MAP_SOCKET_ERROR(sock_errno());
return rv;
}
@@ -94,7 +94,7 @@
PRInt32 result;
if (ioctl(fd->secret->md.osfd, FIONREAD, (char *) &result, sizeof(result)) < 0) {
- PR_SetError(PR_BAD_DESCRIPTOR_ERROR, sock_errno());
+ PR_SetError(PR_BAD_DESCRIPTOR_ERROR, sock_errno());
return -1;
}
return result;
@@ -128,14 +128,14 @@
#else
if ((rv = select(socks, 1, 0, 0, -1)) == -1) {
#endif
- _PR_MD_MAP_SELECT_ERROR(sock_errno());
+ _PR_MD_MAP_SELECT_ERROR(sock_errno());
break;
- }
+ }
}
else {
- _PR_MD_MAP_ACCEPT_ERROR(err);
+ _PR_MD_MAP_ACCEPT_ERROR(err);
break;
- }
+ }
}
return(rv);
}
@@ -146,14 +146,14 @@
if (((err = sock_errno()) == EWOULDBLOCK)
&& (!fd->secret->nonblocking))
{
- PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
+ PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
}
else
{
_PR_MD_MAP_ACCEPT_ERROR(err);
}
}
- return(rv);
+ return(rv);
}
else
{
@@ -165,8 +165,7 @@
{
#ifdef BSD_SELECT
tv.tv_sec = PR_IntervalToSeconds(timeout);
- tv.tv_usec = PR_IntervalToMicroseconds(
- timeout - PR_SecondsToInterval(tv.tv_sec));
+ tv.tv_usec = PR_IntervalToMicroseconds(timeout -
+PR_SecondsToInterval(tv.tv_sec));
tvp = &tv;
rv = select(osfd + 1, &rd, NULL, NULL, tvp);
#else
@@ -178,13 +177,13 @@
}
else if (rv == 0)
{
- PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
+ PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
rv = -1;
} else {
- _PR_MD_MAP_SELECT_ERROR(sock_errno());
+ _PR_MD_MAP_SELECT_ERROR(sock_errno());
}
} else {
- _PR_MD_MAP_ACCEPT_ERROR(err);
+ _PR_MD_MAP_ACCEPT_ERROR(err);
}
}
}
@@ -201,7 +200,7 @@
PRInt32 rv;
int err, len;
#ifdef BSD_SELECT
- fd_set wd, ex;
+ fd_set wd;
struct timeval tv, *tvp;
#else
int socks[1];
@@ -219,16 +218,13 @@
else
{
tv.tv_sec = PR_IntervalToSeconds(timeout);
- tv.tv_usec = PR_IntervalToMicroseconds(
- timeout - PR_SecondsToInterval(tv.tv_sec));
+ tv.tv_usec = PR_IntervalToMicroseconds(timeout -
+PR_SecondsToInterval(tv.tv_sec));
tvp = &tv;
}
FD_ZERO(&wd);
FD_SET(osfd, &wd);
- FD_ZERO(&ex);
- FD_SET(osfd, &ex);
- rv = select(osfd + 1, NULL, &wd, &ex, tvp);
+ rv = select(osfd + 1, NULL, &wd, NULL, tvp);
#else
if (timeout == PR_INTERVAL_NO_TIMEOUT)
lTimeout = -1;
@@ -238,50 +234,62 @@
}
socks[0] = osfd;
- rv = select(socks, 0, 1, 1, lTimeout);
+ rv = select(socks, 0, 1, 0, lTimeout);
#endif
if (rv > 0)
{
#ifdef BSD_SELECT
- if (FD_ISSET(osfd, &ex))
- {
- DosSleep(0);
- len = sizeof(err);
- if (getsockopt(osfd, SOL_SOCKET, SO_ERROR,
+ if (FD_ISSET(osfd, &wd))
+ {
+ DosSleep(0);
+ len = sizeof(err);
+ if (getsockopt(osfd, SOL_SOCKET, SO_ERROR,
(char *) &err, &len) < 0)
- {
- _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno());
- return -1;
- }
- if (err != 0)
- _PR_MD_MAP_CONNECT_ERROR(err);
- else
- PR_SetError(PR_UNKNOWN_ERROR, 0);
- return -1;
- }
- if (FD_ISSET(osfd, &wd))
- {
- /* it's connected */
- return 0;
- }
+ {
+ _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno());
+ return -1;
+ }
+
+ if (err != 0)
+ {
+ _PR_MD_MAP_CONNECT_ERROR(err);
+ return -1;
+ }
+ else
+ return 0; /* it's connected */
+ }
+ else
+ return -1;
#else
- if (getsockopt(osfd, SOL_SOCKET, SO_ERROR,
- (char *) &err, &len) < 0)
- {
- _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno());
- return -1;
- }
- else
- return 0; /* It's connected ! */
+ if (socks[0] == osfd)
+ {
+ len = sizeof(err);
+ if (getsockopt(osfd, SOL_SOCKET, SO_ERROR,
+ (char *) &err, &len) < 0)
+ {
+ _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno());
+ return -1;
+ }
+
+ if (err != 0)
+ {
+ _PR_MD_MAP_CONNECT_ERROR(err);
+ return -1;
+ }
+ else
+ return 0; /* it's connected */
+ }
+ else
+ return -1;
#endif
- }
+ }
else if (rv == 0)
{
- PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
+ PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
return(-1);
} else if (rv < 0)
{
- _PR_MD_MAP_SELECT_ERROR(sock_errno());
+ _PR_MD_MAP_SELECT_ERROR(sock_errno());
return(-1);
}
}
@@ -354,19 +362,19 @@
if ((rv = select(socks, 1, 0, 0, lTimeout)) == -1)
#endif
{
- _PR_MD_MAP_SELECT_ERROR(sock_errno());
+ _PR_MD_MAP_SELECT_ERROR(sock_errno());
return -1;
}
else if (rv == 0)
{
- PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
+ PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
rv = -1;
break;
}
}
else
{
- _PR_MD_MAP_RECV_ERROR(err);
+ _PR_MD_MAP_RECV_ERROR(err);
break;
}
} /* end while() */
@@ -422,19 +430,19 @@
socks[0] = osfd;
if ((rv = select( socks, 0, 1, 0, lTimeout)) == -1) {
#endif
- _PR_MD_MAP_SELECT_ERROR(sock_errno());
+ _PR_MD_MAP_SELECT_ERROR(sock_errno());
break;
- }
+ }
if (rv == 0)
{
- PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
- return -1;
+ PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
+ return -1;
}
}
else {
- _PR_MD_MAP_SEND_ERROR(err);
+ _PR_MD_MAP_SEND_ERROR(err);
return -1;
- }
+ }
}
bytesSent += rv;
if (fd->secret->nonblocking)
@@ -470,13 +478,13 @@
socks[0] = osfd;
if ((rv = select(socks, 0, 1, 0,lTimeout)) == -1) {
#endif
- _PR_MD_MAP_SELECT_ERROR(sock_errno());
+ _PR_MD_MAP_SELECT_ERROR(sock_errno());
break;
- }
+ }
if (rv == 0)
{
- PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
- return -1;
+ PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
+ return -1;
}
}
}
@@ -533,19 +541,19 @@
socks[0] = osfd;
if ((rv = select(socks, 0, 1, 0, lTimeout)) == -1) {
#endif
- _PR_MD_MAP_SELECT_ERROR(sock_errno());
+ _PR_MD_MAP_SELECT_ERROR(sock_errno());
break;
- }
+ }
if (rv == 0)
{
- PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
- return -1;
+ PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
+ return -1;
}
}
else {
- _PR_MD_MAP_SENDTO_ERROR(err);
+ _PR_MD_MAP_SENDTO_ERROR(err);
return -1;
- }
+ }
}
bytesSent += rv;
if (fd->secret->nonblocking)
@@ -581,13 +589,13 @@
socks[0] = osfd;
if ((rv = select( socks, 0, 1, 0, lTimeout)) == -1) {
#endif
- _PR_MD_MAP_SELECT_ERROR(sock_errno());
+ _PR_MD_MAP_SELECT_ERROR(sock_errno());
break;
- }
+ }
if (rv == 0)
{
- PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
- return -1;
+ PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
+ return -1;
}
}
}
@@ -616,20 +624,20 @@
&& (!fd->secret->nonblocking))
{
#ifdef BSD_SELECT
- if (timeout == PR_INTERVAL_NO_TIMEOUT)
- {
- tvp = NULL;
- }
- else
- {
- tv.tv_sec = PR_IntervalToSeconds(timeout);
- tv.tv_usec = PR_IntervalToMicroseconds(
- timeout - PR_SecondsToInterval(tv.tv_sec));
- tvp = &tv;
- }
- FD_ZERO(&rd);
- FD_SET(osfd, &rd);
- if ((rv = select(osfd + 1, &rd, NULL, NULL, tvp)) == -1)
+ if (timeout == PR_INTERVAL_NO_TIMEOUT)
+ {
+ tvp = NULL;
+ }
+ else
+ {
+ tv.tv_sec = PR_IntervalToSeconds(timeout);
+ tv.tv_usec = PR_IntervalToMicroseconds(
+ timeout - PR_SecondsToInterval(tv.tv_sec));
+ tvp = &tv;
+ }
+ FD_ZERO(&rd);
+ FD_SET(osfd, &rd);
+ if ((rv = select(osfd + 1, &rd, NULL, NULL, tvp)) == -1)
#else
if (timeout == PR_INTERVAL_NO_TIMEOUT)
{
@@ -643,11 +651,11 @@
if ((rv = select(socks, 1, 0, 0, lTimeout)) == -1)
#endif
{
- _PR_MD_MAP_SELECT_ERROR(sock_errno());
+ _PR_MD_MAP_SELECT_ERROR(sock_errno());
return -1;
} else if (rv == 0)
{
- PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
+ PR_SetError(PR_IO_TIMEOUT_ERROR, 0);
rv = -1;
break;
}
@@ -657,7 +665,7 @@
}
else
{
- _PR_MD_MAP_RECVFROM_ERROR(err);
+ _PR_MD_MAP_RECVFROM_ERROR(err);
break;
}
}
@@ -702,12 +710,12 @@
PRInt32
_PR_MD_SHUTDOWN(PRFileDesc *fd, PRIntn how)
{
-PRInt32 rv;
+ PRInt32 rv;
rv = shutdown(fd->secret->md.osfd, how);
- if (rv < 0)
- _PR_MD_MAP_SHUTDOWN_ERROR(sock_errno());
- return rv;
+ if (rv < 0)
+ _PR_MD_MAP_SHUTDOWN_ERROR(sock_errno());
+ return rv;
}
PRStatus
@@ -717,11 +725,11 @@
rv = getsockname((int)fd->secret->md.osfd, (struct sockaddr *)addr, (int *) len);
if (rv==0)
- return PR_SUCCESS;
- else {
- _PR_MD_MAP_GETSOCKNAME_ERROR(sock_errno());
- return PR_FAILURE;
- }
+ return PR_SUCCESS;
+ else {
+ _PR_MD_MAP_GETSOCKNAME_ERROR(sock_errno());
+ return PR_FAILURE;
+ }
}
PRStatus
@@ -731,11 +739,11 @@
rv = getpeername((int)fd->secret->md.osfd, (struct sockaddr *)addr, (int *) len);
if (rv==0)
- return PR_SUCCESS;
- else {
- _PR_MD_MAP_GETPEERNAME_ERROR(sock_errno());
- return PR_FAILURE;
- }
+ return PR_SUCCESS;
+ else {
+ _PR_MD_MAP_GETPEERNAME_ERROR(sock_errno());
+ return PR_FAILURE;
+ }
}
PRStatus
@@ -745,11 +753,11 @@
rv = getsockopt((int)fd->secret->md.osfd, level, optname, optval, optlen);
if (rv==0)
- return PR_SUCCESS;
- else {
- _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno());
- return PR_FAILURE;
- }
+ return PR_SUCCESS;
+ else {
+ _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno());
+ return PR_FAILURE;
+ }
}
PRStatus
@@ -759,11 +767,11 @@
rv = setsockopt((int)fd->secret->md.osfd, level, optname, (char *) optval,
optlen);
if (rv==0)
- return PR_SUCCESS;
- else {
- _PR_MD_MAP_SETSOCKOPT_ERROR(sock_errno());
- return PR_FAILURE;
- }
+ return PR_SUCCESS;
+ else {
+ _PR_MD_MAP_SETSOCKOPT_ERROR(sock_errno());
+ return PR_FAILURE;
+ }
}
void
Index: prnetdb.c
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c,v
retrieving revision 3.12.2.1
diff -u -r3.12.2.1 prnetdb.c
--- prnetdb.c 2000/03/08 16:27:18 3.12.2.1
+++ prnetdb.c 2000/12/13 23:47:28
@@ -926,6 +926,9 @@
addr->inet.family = AF_INET;
addr->inet.port = htons(port);
+#ifdef XP_OS2
+ memset( addr->inet.pad, 0, sizeof(addr->inet.pad) );
+#endif
switch (val)
{
case PR_IpAddrNull:
Index: OS2.mk
===================================================================
RCS file: /cvsroot/mozilla/security/coreconf/OS2.mk,v
retrieving revision 1.3
diff -u -r1.3 OS2.mk
--- OS2.mk 2000/10/03 00:58:15 1.3
+++ OS2.mk 2000/12/13 23:09:29
@@ -57,6 +57,8 @@
PROG_SUFFIX = .exe
+ifdef XP_OS2_EMX
+
#
# On OS/2 we proudly support gbash...
#
@@ -82,7 +84,7 @@
# DLL_SUFFIX = .dll
SHLIB_LDSTARTFILE =
SHLIB_LDENDFILE =
-endif
+endif #NO_SHARED_LIB
OS_CFLAGS = -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Zmtd -Zomf
-Zmt -DDEBUG -DDEBUG_wintrinh -DTRACING -g
@@ -92,7 +94,6 @@
NSPR_INCLUDE_DIR =
-
ifdef BUILD_OPT
OPTIMIZER = -O+ -Oi
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
@@ -106,7 +107,64 @@
EXEFLAGS = -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
OBJDIR_TAG = _DBG
LDFLAGS = -DEBUG
-endif
+endif # BUILD_OPT
+
+else # XP_OS2_VACPP
+
+#
+# On OS/2 we proudly support gbash...
+#
+SHELL = GBASH.EXE
+CCC = icc -q -DXP_OS2 -DOS2=4 -N10
+LINK = -ilink
+AR = -ilib /NOL /NOI /O:$(subst /,\\,$@)
+# 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 = $(LD) $(DSO_LDOPTS)
+MKCSHLIB = $(LD) $(DSO_LDOPTS)
+MKSHLIB_FORCE_ALL =
+MKSHLIB_UNFORCE_ALL =
+DSO_LDOPTS =
+# DLL_SUFFIX = .dll
+SHLIB_LDSTARTFILE =
+SHLIB_LDENDFILE =
+endif #NO_SHARED_LIB
+
+OS_CFLAGS = /Q /qlibansi /Gd /Gm /Su4 /Mp /Tl-
+INCLUDES += -I$(CORE_DEPTH)/../dist/include
+DEFINES += -DXP_OS2_VACPP -DTCPV40HDRS
+
+# Where the libraries are
+NSPR_LIBS = $(DIST)/lib/nspr4.lib $(DIST)/lib/plc4.lib $(DIST)/lib/plds4.lib
+MOZ_COMPONENT_NSPR_LIBS=-L$(DIST)/lib $(NSPR_LIBS)
+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
+LDFLAGS = /FREE /NODEBUG /NOE /LINENUMBERS /nologo
+else
+OS_CFLAGS += /Ti+
+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 = /FREE /DE /NOE /LINENUMBERS /nologo
+endif # BUILD_OPT
+
+endif # XP_OS2_VACPP
# 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
Index: rules.mk
===================================================================
RCS file: /cvsroot/mozilla/security/coreconf/rules.mk,v
retrieving revision 1.2
diff -u -r1.2 rules.mk
--- rules.mk 2000/09/30 00:56:57 1.2
+++ rules.mk 2000/12/13 23:09:39
@@ -306,8 +306,12 @@
$(MKPROG) $(OBJS) -Fe$@ -link $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS)
$(OS_LIBS)
endif
else
+ifdef XP_OS2_VACPP
+ $(MKPROG) -Fe$@ $(CFLAGS) $(OBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
+else
$(MKPROG) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) $(EXTRA_LIBS)
$(EXTRA_SHARED_LIBS) $(OS_LIBS)
endif
+endif
ifneq ($(POLICY),)
-$(PLCYPATCH) $(PLCYPATCH_ARGS) $@
endif
@@ -353,7 +357,11 @@
$(LINK_DLL) -MAP $(DLLBASE) $(OBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS)
$(OS_LIBS) $(LD_LIBS)
endif
else
+ifdef XP_OS2_VACPP
+ $(MKSHLIB) $(DLLFLAGS) $(LDFLAGS) $(OBJS) $(LD_LIBS) $(EXTRA_LIBS)
+$(EXTRA_SHARED_LIBS)
+else
$(MKSHLIB) -o $@ $(OBJS) $(LD_LIBS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS)
+endif
chmod +x $@
endif
endif
@@ -410,8 +418,12 @@
$(CC) -Fo$@ -c $(CFLAGS) $*.c
endif
else
+ifeq ($(MOZ_OS2_TOOLS), VACPP)
+ $(CC) -Fo$@ -c $(CFLAGS) $*.c
+else
$(CC) -o $@ -c $(CFLAGS) $*.c
endif
+endif
ifneq ($(OS_ARCH), WINNT)
$(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.s
@@ -852,7 +864,7 @@
-include $(DEPENDENCIES)
-ifneq ($(OS_ARCH),WINNT)
+ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
# Can't use sed because of its 4000-char line length limit, so resort to perl
.DEFAULT:
@perl -e ' \
Index: suffix.mk
===================================================================
RCS file: /cvsroot/mozilla/security/coreconf/suffix.mk,v
retrieving revision 1.2
diff -u -r1.2 suffix.mk
--- suffix.mk 2000/09/20 17:20:23 1.2
+++ suffix.mk 2000/12/13 23:10:11
@@ -128,13 +128,9 @@
#
ifndef PROG_SUFFIX
- ifeq ($(OS_ARCH), WINNT)
+ ifeq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
PROG_SUFFIX = .exe
else
- ifeq ($(OS_ARCH), OS2)
- PROG_SUFFIX = .exe
- else
PROG_SUFFIX =
- endif
endif
endif
Index: arch.mk
===================================================================
RCS file: /cvsroot/mozilla/security/coreconf/arch.mk,v
retrieving revision 1.2
diff -u -r1.2 arch.mk
--- arch.mk 2000/09/20 17:20:23 1.2
+++ arch.mk 2000/12/13 23:10:25
@@ -138,6 +138,14 @@
OS_RELEASE := $(basename $(OS_RELEASE))
endif
+#
+# For OS/2
+#
+ifeq ($(OS_ARCH), OS_2)
+OS_ARCH := OS2
+OS_RELEASE := $(shell uname -v)
+endif
+
#######################################################################
# Master "Core Components" macros for getting the OS target #
#######################################################################
@@ -226,7 +234,11 @@
# This variable is used to get OS_CONFIG.mk.
#
+ifeq ($(OS_ARCH),OS2)
+OS_CONFIG = $(OS_ARCH)
+else
OS_CONFIG = $(OS_TARGET)$(OS_RELEASE)
+endif
#
# OBJDIR_TAG depends on the predefined variable BUILD_OPT,
@@ -288,14 +300,5 @@
endif
endif
endif
-endif
-
-#
-# For OS/2
-#
-ifeq ($(OS_ARCH), OS_2)
-OS_ARCH := OS2
-OS_RELEASE := $(shell uname -v)
-OS_CONFIG := $(OS_ARCH)
endif
Index: hashops.c
===================================================================
RCS file: /cvsroot/mozilla/security/nss/lib/base/hashops.c,v
retrieving revision 1.1
diff -u -r1.1 hashops.c
--- hashops.c 2000/03/31 19:50:13 1.1
+++ hashops.c 2000/12/13 23:11:38
@@ -45,7 +45,7 @@
#include "base.h"
#endif /* BASE_H */
-static PR_CALLBACK void *
+static void* PR_CALLBACK
nss_arena_hash_alloc_table
(
void *pool,
@@ -65,7 +65,7 @@
return nss_ZAlloc(arena, size);
}
-static PR_CALLBACK void
+static void PR_CALLBACK
nss_arena_hash_free_table
(
void *pool,
@@ -75,7 +75,7 @@
(void)nss_ZFreeIf(item);
}
-static PR_CALLBACK PLHashEntry *
+static PLHashEntry* PR_CALLBACK
nss_arena_hash_alloc_entry
(
void *pool,
@@ -95,7 +95,7 @@
return nss_ZNEW(arena, PLHashEntry);
}
-static PR_CALLBACK void
+static void PR_CALLBACK
nss_arena_hash_free_entry
(
void *pool,
Index: tracker.c
===================================================================
RCS file: /cvsroot/mozilla/security/nss/lib/base/tracker.c,v
retrieving revision 1.1
diff -u -r1.1 tracker.c
--- tracker.c 2000/03/31 19:51:11 1.1
+++ tracker.c 2000/12/13 23:12:02
@@ -155,7 +155,7 @@
* There are no possible errors.
*/
-static PR_CALLBACK PLHashNumber
+static PLHashNumber PR_CALLBACK
identity_hash
(
const void *key
Index: certt.h
===================================================================
RCS file: /cvsroot/mozilla/security/nss/lib/certdb/certt.h,v
retrieving revision 1.1
diff -u -r1.1 certt.h
--- certt.h 2000/03/31 19:42:35 1.1
+++ certt.h 2000/12/13 23:12:30
@@ -699,12 +699,12 @@
};
-typedef SECStatus PR_CALLBACK (*CERTStatusChecker) (CERTCertDBHandle *handle,
+typedef SECStatus (PR_CALLBACK *CERTStatusChecker) (CERTCertDBHandle *handle,
CERTCertificate *cert,
int64 time,
void *pwArg);
-typedef SECStatus PR_CALLBACK (*CERTStatusDestroy) (CERTStatusConfig *handle);
+typedef SECStatus (PR_CALLBACK *CERTStatusDestroy) (CERTStatusConfig *handle);
struct CERTStatusConfigStr {
CERTStatusChecker statusChecker; /* NULL means no checking enabled */
Index: swfutl.c
===================================================================
RCS file: /cvsroot/mozilla/security/nss/lib/fortcrypt/swfort/swfutl.c,v
retrieving revision 1.2
diff -r1.2 swfutl.c
47,48c47,50
< #ifdef XP_OS2
< #include <stat.h> /* Needed for OS/2 emx */
---
> #ifdef XP_OS2_EMX
> #include <stat.h>
> #elif defined( XP_OS2_VACPP )
> #include <sys/stat.h>
Index: jarevil.c
===================================================================
RCS file: /cvsroot/mozilla/security/nss/lib/jar/jarevil.c,v
retrieving revision 1.2
diff -u -r1.2 jarevil.c
--- jarevil.c 2000/08/02 18:41:31 1.2
+++ jarevil.c 2000/12/13 23:13:26
@@ -57,7 +57,7 @@
/* Special macros facilitate running on Win 16 */
-#if defined(XP_PC) && !defined(_WIN32) /* then we are win 16 */
+#if defined(XP_WIN) && !defined(_WIN32) /* then we are win 16 */
/*
* Allocate the data passed to the callback functions from the heap...
Index: os2_rand.c
===================================================================
RCS file: /cvsroot/mozilla/security/nss/lib/util/os2_rand.c,v
retrieving revision 1.2
diff -u -r1.2 os2_rand.c
--- os2_rand.c 2000/09/20 17:07:22 1.2
+++ os2_rand.c 2000/12/13 23:13:39
@@ -38,7 +38,11 @@
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
+#ifdef XP_OS2_VACPP
+#include <sys/stat.h>
+#else
#include <stat.h>
+#endif
static BOOL clockTickTime(unsigned long *phigh, unsigned long *plow)
{
@@ -106,6 +110,94 @@
return n;
}
+static BOOL
+EnumSystemFiles(void (*func)(char *))
+{
+ APIRET rc;
+ ULONG sysInfo = 0;
+ char bootLetter[2];
+ char sysDir[_MAX_PATH] = "";
+ char filename[_MAX_PATH];
+ HDIR hdir = HDIR_CREATE;
+ ULONG numFiles = 1;
+ FILEFINDBUF3 fileBuf = {0};
+ ULONG buflen = sizeof(FILEFINDBUF3);
+
+ if (DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, (PVOID)&sysInfo,
+ sizeof(ULONG)) == NO_ERROR)
+ {
+ bootLetter[0] = sysInfo + 'A' -1;
+ strcpy(sysDir, bootLetter);
+ strcpy(sysDir+1, ":\\OS2\\");
+
+ strcpy( filename, sysDir );
+ strcat( filename, "*.*" );
+ }
+
+ rc =DosFindFirst( filename, &hdir, FILE_NORMAL, &fileBuf, buflen,
+ &numFiles, FIL_STANDARD );
+ if( rc == NO_ERROR )
+ {
+ do {
+ // pass the full pathname to the callback
+ sprintf( filename, "%s\\%s", sysDir, fileBuf.achName );
+ (*func)(filename);
+
+ numFiles = 1;
+ rc = DosFindNext( hdir, &fileBuf, buflen, &numFiles );
+ if( rc != NO_ERROR && rc != ERROR_NO_MORE_FILES )
+ printf( "DosFindNext errod code = %d\n", rc );
+ } while ( rc == NO_ERROR );
+
+ rc = DosFindClose(hdir);
+ if( rc != NO_ERROR )
+ printf( "DosFindClose error code = %d", rc );
+ }
+ else
+ printf( "DosFindFirst error code = %d", rc );
+
+ return TRUE;
+}
+
+static int dwNumFiles, dwReadEvery;
+
+static void
+CountFiles(char *file)
+{
+ dwNumFiles++;
+}
+
+static void
+ReadFiles(char *file)
+{
+ if ((dwNumFiles % dwReadEvery) == 0)
+ RNG_FileForRNG(file);
+
+ dwNumFiles++;
+}
+
+static void
+ReadSystemFiles()
+{
+ // first count the number of files
+ dwNumFiles = 0;
+ if (!EnumSystemFiles(CountFiles))
+ return;
+
+ RNG_RandomUpdate(&dwNumFiles, sizeof(dwNumFiles));
+
+ // now read 10 files
+ if (dwNumFiles == 0)
+ return;
+
+ dwReadEvery = dwNumFiles / 10;
+ if (dwReadEvery == 0)
+ dwReadEvery = 1; // less than 10 files
+
+ dwNumFiles = 0;
+ EnumSystemFiles(ReadFiles);
+}
+
void RNG_SystemInfoForRNG(void)
{
unsigned long *plong = 0;
@@ -113,16 +205,17 @@
PPIB ppib;
APIRET rc = NO_ERROR;
DATETIME dt;
- COUNTRYCODE cc;
- COUNTRYINFO ci;
- unsigned long actual;
+ COUNTRYCODE cc = {0};
+ COUNTRYINFO ci = {0};
+ unsigned long actual = 0;
char path[_MAX_PATH]="";
+ char fullpath[_MAX_PATH]="";
unsigned long pathlength = sizeof(path);
FSALLOCATE fsallocate;
FILESTATUS3 fstatus;
unsigned long defaultdrive = 0;
unsigned long logicaldrives = 0;
- unsigned long counter = 0;
+ unsigned long sysInfo[QSV_MAX] = {0};
char buffer[20];
int nBytes = 0;
@@ -161,11 +254,13 @@
/* current directory */
rc = DosQueryCurrentDir(0, path, &pathlength);
+ strcat(fullpath, "\\");
+ strcat(fullpath, path);
if (rc == NO_ERROR)
{
- RNG_RandomUpdate(path, strlen(path));
+ RNG_RandomUpdate(fullpath, strlen(fullpath));
// path info
- rc = DosQueryPathInfo(path, FIL_STANDARD, &fstatus, sizeof(fstatus));
+ rc = DosQueryPathInfo(fullpath, FIL_STANDARD, &fstatus, sizeof(fstatus));
if (rc == NO_ERROR)
{
RNG_RandomUpdate(&fstatus, sizeof(fstatus));
@@ -188,11 +283,14 @@
}
/* system info */
- rc = DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &counter, sizeof(counter));
+ rc = DosQuerySysInfo(1L, QSV_MAX, (PVOID)&sysInfo, sizeof(ULONG)*QSV_MAX);
if (rc == NO_ERROR)
{
- RNG_RandomUpdate(&counter, sizeof(counter));
+ RNG_RandomUpdate(&sysInfo, sizeof(sysInfo));
}
+
+ // now let's do some files
+ ReadSystemFiles();
/* more noise */
nBytes = RNG_GetNoise(buffer, sizeof(buffer));
Index: platlibs.mk
===================================================================
RCS file: /cvsroot/mozilla/security/nss/cmd/platlibs.mk,v
retrieving revision 1.8
diff -u -r1.8 platlibs.mk
--- platlibs.mk 2000/09/29 02:15:42 1.8
+++ platlibs.mk 2000/12/13 23:14:23
@@ -107,11 +107,18 @@
# $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
# $(EXTRA_SHARED_LIBS) come before $(OS_LIBS), except on AIX.
+ifeq ($(OS_ARCH),OS2)
EXTRA_SHARED_LIBS += \
-L$(DIST)/lib/ \
+ $(NSPR_LIBS) \
+ $(NULL)
+else
+EXTRA_SHARED_LIBS += \
+ -L$(DIST)/lib/ \
-lplc4 \
-lplds4 \
-lnspr4 \
$(NULL)
+endif
endif
Index: selfserv.c
===================================================================
RCS file: /cvsroot/mozilla/security/nss/cmd/selfserv/selfserv.c,v
retrieving revision 1.6
diff -u -r1.6 selfserv.c
--- selfserv.c 2000/10/05 04:14:44 1.6
+++ selfserv.c 2000/12/13 23:15:34
@@ -62,6 +62,10 @@
#include "ssl.h"
#include "sslproto.h"
+#ifdef XP_OS2_VACPP
+#include <Process.h>
+#endif
+
#ifndef PORT_Sprintf
#define PORT_Sprintf sprintf
#endif
@@ -1314,10 +1318,13 @@
privKey[kt_fortezza] = PK11_FindKeyByAnyCert(cert[kt_fortezza], NULL);
}
+/* OS2TODO */
+#ifndef XP_OS2
rv = SSL_ConfigMPServerSIDCache(256, 0, 0, NULL);
if (rv != SECSuccess) {
errExit("SSL_ConfigMPServerSIDCache");
}
+#endif
server_main(port, requestCert, privKey, cert);
Index: Makefile
===================================================================
RCS file: /cvsroot/mozilla/security/nss/Makefile,v
retrieving revision 1.12
diff -u -r1.12 Makefile
--- Makefile 2000/10/05 04:12:30 1.12
+++ Makefile 2000/12/13 23:16:40
@@ -76,6 +76,15 @@
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################
+ifneq ($(OS_ARCH),WINNT)
+ifndef MOZ_DIST
+MOZ_DIST=../../dist
+endif
+ifndef MOZ_IMPORT_DIR
+MOZ_IMPORT_DIR=$(DIST)
+endif
+endif
+
moz_import::
ifeq ($(OS_ARCH),WINNT)
cp $(DIST)/../include/* $(DIST)/include
@@ -87,13 +96,13 @@
mv $(DIST)/lib/dbm32.lib $(DIST)/lib/dbm.lib
else
ifeq ($(OS_ARCH),OS2)
- cp -r $(DIST)/../include $(DIST)
- cp -r $(DIST)/../lib $(DIST)
- mv $(DIST)/lib/libmozdbm_s.$(LIB_SUFFIX) $(DIST)/lib/libdbm.$(LIB_SUFFIX)
+ cp -rf $(DIST)/../include $(DIST)
+ cp -rf $(DIST)/../lib $(DIST)
+ cp -f $(DIST)/lib/libmozdbm_s.$(LIB_SUFFIX) $(DIST)/lib/libdbm.$(LIB_SUFFIX)
else
- $(NSINSTALL) -L ../../dist include $(DIST)
- $(NSINSTALL) -L ../../dist lib $(DIST)
- cp $(DIST)/lib/libmozdbm_s.$(LIB_SUFFIX) $(DIST)/lib/libdbm.$(LIB_SUFFIX)
+ $(NSINSTALL) -L $(MOZ_DIST) include $(MOZ_IMPORT_DIR)
+ $(NSINSTALL) -L $(MOZ_DIST) lib $(MOZ_IMPORT_DIR)
+ cp $(MOZ_DIST)/lib/libmozdbm_s.$(LIB_SUFFIX)
+$(MOZ_IMPORT_DIR)/lib/libdbm.$(LIB_SUFFIX)
endif
endif
Index: cmtcmn.h
===================================================================
RCS file: /cvsroot/mozilla/security/psm/lib/client/cmtcmn.h,v
retrieving revision 1.11
diff -u -r1.11 cmtcmn.h
--- cmtcmn.h 2000/08/31 18:31:25 1.11
+++ cmtcmn.h 2000/12/13 23:24:46
@@ -63,6 +63,14 @@
#endif /* vacpp */
#endif
#endif
+
+#ifdef XP_OS2_VACPP
+#define INCL_DOSSESMGR
+#define INCL_DOSERRORS
+#define INCL_DOSPROCESS
+#include "os2.h"
+#endif
+
#include "cmtclist.h"
typedef void (*void_fun) (void);
Index: cmtinit.c
===================================================================
RCS file: /cvsroot/mozilla/security/psm/lib/client/cmtinit.c,v
retrieving revision 1.8
diff -u -r1.8 cmtinit.c
--- cmtinit.c 2000/09/08 21:42:04 1.8
+++ cmtinit.c 2000/12/13 23:25:30
@@ -51,6 +51,10 @@
#endif
#endif
+#ifdef XP_OS2_VACPP
+#include <libc/direct.h>
+#endif
+
#include "messages.h"
#include "cmtcmn.h"
#include "cmtutils.h"
@@ -86,7 +90,7 @@
{
#if defined WIN32
return _getcwd(buf, maxLen);
-#elif defined(XP_UNIX) || defined(XP_BEOS)
+#elif defined(XP_UNIX) || defined(XP_BEOS) || defined(XP_OS2)
return getcwd(buf, maxLen);
#else
return NULL;
@@ -98,7 +102,7 @@
{
#if defined WIN32
_chdir(path);
-#elif defined(XP_UNIX) || defined(XP_BEOS)
+#elif defined(XP_UNIX) || defined(XP_BEOS) || defined(XP_OS2)
chdir(path);
#else
return;
@@ -153,6 +157,25 @@
return CMTSuccess;
loser:
return CMTFailure;
+#elif defined(XP_OS2)
+ STARTDATA sd;
+ ULONG sid;
+ PID pid;
+ APIRET rc;
+
+ memset(&sd, 0, 50);
+ sd.Length = 50;
+ sd.InheritOpt = SSF_INHERTOPT_PARENT;
+ sd.SessionType = SSF_TYPE_PM;
+ sd.PgmName = executable;
+
+ rc = DosStartSession( &sd, &sid, &pid );
+ if( rc != NO_ERROR && rc != ERROR_SMG_START_IN_BACKGROUND ) {
+ printf( "DosStartSession error: return code = %u\n", rc );
+ return CMTFailure;
+ }
+ else
+ return CMTSuccess;
#else
return CMTFailure;
#endif
@@ -171,6 +194,7 @@
#endif
int i;
char *path = NULL;
+ int rc;
/* On the Mac, we do special magic in the Seamonkey PSM component, so
if PSM isn't launched by the time we reach this point, we're not doing well. */
@@ -216,10 +240,13 @@
goto loser;
}
setWorkingDir(newWorkingDir);
- if (launch_psm(executable) != CMTSuccess) {
+ rc = launch_psm(executable);
+
+ setWorkingDir(oldWorkingDir);
+
+ if (rc != CMTSuccess) {
goto loser;
}
- setWorkingDir(oldWorkingDir);
#endif
/*
@@ -229,6 +256,14 @@
#ifdef WIN32
for (i=0; i<30; i++) {
Sleep(1000);
+ control = CMT_ControlConnect(mutex, sockFuncs);
+ if (control != NULL) {
+ break;
+ }
+ }
+#elif defined(XP_OS2)
+ for (i=0; i<30; i++) {
+ DosSleep(1000);
control = CMT_ControlConnect(mutex, sockFuncs);
if (control != NULL) {
break;
Index: cmtpkcs7.c
===================================================================
RCS file: /cvsroot/mozilla/security/psm/lib/client/cmtpkcs7.c,v
retrieving revision 1.8
diff -u -r1.8 cmtpkcs7.c
--- cmtpkcs7.c 2000/08/31 18:31:25 1.8
+++ cmtpkcs7.c 2000/12/13 23:25:58
@@ -259,8 +259,13 @@
numTries++;
goto poll_sockets;
}
-#endif
-#ifdef XP_UNIX
+#elif defined(XP_OS2)
+ if (numTries < 20) {
+ DosSleep(100);
+ numTries++;
+ goto poll_sockets;
+ }
+#elif defined(XP_UNIX)
if (numTries < 25) {
numTries += sleep(1);
goto poll_sockets;
Index: cmtutils.c
===================================================================
RCS file: /cvsroot/mozilla/security/psm/lib/client/cmtutils.c,v
retrieving revision 1.8
diff -u -r1.8 cmtutils.c
--- cmtutils.c 2000/09/08 21:42:04 1.8
+++ cmtutils.c 2000/12/13 23:26:33
@@ -206,7 +206,7 @@
/*Try printing out 8 bytes at a time. */
LOG("\n**********************************************************\n");
LOG("About to pretty Print Message\n\n");
- curBuffer[9] = '\0';
+ curBuffer[8] = '\0';
hexArray[24] = '\0';
hexVal[2] = '\0';
string[1] = '\0';
@@ -368,7 +368,7 @@
response->type = ntohl(header.type);
response->len = ntohl(header.len);
response->data = (unsigned char *) malloc(response->len);
- if (response->data == NULL) {
+ if (response->data == NULL && response->len != 0) {
goto loser;
}
Index: main.c
===================================================================
RCS file: /cvsroot/mozilla/security/psm/server/main.c,v
retrieving revision 1.5
diff -u -r1.5 main.c
--- main.c 2000/06/16 22:21:16 1.5
+++ main.c 2000/12/13 23:27:01
@@ -414,7 +414,7 @@
}
#endif
-#if defined(XP_PC) && !defined(DEBUG)
+#if defined(XP_WIN) && !defined(DEBUG)
int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
LPSTR lpszLine, int nShow)
#elif defined(XP_MAC)
@@ -432,7 +432,7 @@
int main(int argc, char ** argv)
#endif
{
-#if (defined(XP_PC) && !defined(DEBUG)) || (defined(XP_MAC))
+#if (defined(XP_WIN) && !defined(DEBUG)) || (defined(XP_MAC))
/* substitute argc and argv for NSPR */
int argc = 0;
char *argv[] = {"", NULL};
Index: p12res.c
===================================================================
RCS file: /cvsroot/mozilla/security/psm/server/p12res.c,v
retrieving revision 1.11
diff -u -r1.11 p12res.c
--- p12res.c 2000/09/15 01:27:06 1.11
+++ p12res.c 2000/12/13 23:27:27
@@ -556,7 +556,7 @@
#if defined(XP_UNIX)
filePathSep = "/";
-#elif defined(WIN32)
+#elif defined(WIN32) || defined(XP_OS2)
filePathSep = "\\";
#elif defined(XP_MAC)
filePathSep = "";
Index: Makefile
===================================================================
RCS file: /cvsroot/mozilla/security/psm/server/Makefile,v
retrieving revision 1.37
diff -u -r1.37 Makefile
--- Makefile 2000/11/22 19:59:11 1.37
+++ Makefile 2000/12/13 23:28:29
@@ -162,36 +162,47 @@
XPCOM_LINK_LIBS = $(XPCOM_LIBS)
endif
+PROTOCOL_LIBS = -L$(CORE_DEPTH)/../dist/lib -lprotocol
+
# Adding HP-UX Specific Fixes
ifeq ($(OS_ARCH), HP-UX)
NSPR_LINK_LIBS = -L$(DIST)/lib -shared -lnspr4 -lplc4 -lplds4
XPCOM_LINK_LIBS = -lxpcom
endif
+ifeq ($(OS_ARCH),OS2)
+NSPR_LINK_LIBS = \
+ $(DIST)/lib/plc4.lib \
+ $(DIST)/lib/plds4.lib \
+ $(DIST)/lib/nspr4.lib
+
+XPCOM_LINK_LIBS = $(DIST)/lib/xpcom.lib
+CPLUSPLUSRUNTIME = so32dll.lib tcp32dll.lib
+PROTOCOL_LIBS = $(DIST)/lib/protocol.lib
+endif
+
EXTRA_LIBS += \
- $(DIST)/lib/libssl.a \
- $(DIST)/lib/libnss.a \
- $(DIST)/lib/libssl.a \
- $(DIST)/lib/libcrmf.a \
- $(DIST)/lib/libpkcs12.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/libcrypto.a \
- $(DIST)/lib/libfreebl.a \
- $(DIST)/lib/libsecutil.a \
- $(DIST)/lib/libcrypto.a \
- $(DIST)/lib/libdbm.a \
- $(DIST)/lib/libprotocol.a \
- $(DIST)/lib/libnlslayer.a \
+ $(DIST)/lib/libssl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libnss.$(LIB_SUFFIX) \
+ $(DIST)/lib/libssl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libcrmf.$(LIB_SUFFIX) \
+ $(DIST)/lib/libpkcs12.$(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/libfreebl.$(LIB_SUFFIX) \
+ $(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
+ $(DIST)/lib/libdbm.$(LIB_SUFFIX) \
+ $(DIST)/lib/libnlslayer.$(LIB_SUFFIX) \
$(NSPR_LINK_LIBS) \
$(XPCOM_LINK_LIBS) \
$(CPLUSPLUSRUNTIME) \
+ $(PROTOCOL_LIBS) \
$(NULL)
endif
@@ -206,10 +217,29 @@
install::
+ifeq ($(OS_ARCH),OS2)
+ $(NSINSTALL) -m 644 ../ui/$(PLATFORM)/psm_bin.properties $(DIST)/bin/psmdata/ui
+ $(NSINSTALL) -m 644 ../ui/$(PLATFORM)/psm_doc.properties $(DIST)/bin/psmdata/ui
+ $(NSINSTALL) -m 644 ../ui/$(PLATFORM)/psm_text.properties
+$(DIST)/bin/psmdata/ui
+ $(NSINSTALL) -m 644 ../ui/$(PLATFORM)/psm_ui.properties $(DIST)/bin/psmdata/ui
+ $(NSINSTALL) -m 644 ../doc/04digsgn.gif $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/06pcrypt.gif $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/bannerrn.gif $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/cartbanner.gif $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/next.gif $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/prev.gif $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/cmcjavascriptapi.html $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/psmtest.html $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/release_notes.html $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/contents.htm $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/glossary.htm $(DIST)/bin/psmdata/doc
+ $(NSINSTALL) -m 644 ../doc/help.htm $(DIST)/bin/psmdata/doc
+else
$(NSINSTALL) -m 644 ../ui/$(PLATFORM)/psm*.properties $(DIST)/bin/psmdata/ui
$(NSINSTALL) -m 644 ../doc/*.gif ../doc/*.html ../doc/*.htm
$(DIST)/bin/psmdata/doc
- $(NSINSTALL) -m 644 $(DIST)/lib/nssckbi.$(DLL_SUFFIX) $(DIST)/bin
-ifneq ($(OS_ARCH), WINNT)
+endif
+ $(NSINSTALL) -m 644 $(DIST)/lib/$(DLL_PREFIX)nssckbi.$(DLL_SUFFIX) $(DIST)/bin
+ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
$(NSINSTALL) -m 775 start-psm $(DIST)/bin
endif
Index: Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/security/psm/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- Makefile.in 2000/03/01 02:02:14 1.1
+++ Makefile.in 2000/12/13 23:32:14
@@ -24,8 +24,78 @@
srcdir = @srcdir@
VPATH = @srcdir@
+
+CORE_DEPTH=..
+
+include $(topsrcdir)/security/coreconf/arch.mk
+ifeq (,$(filter-out NetBSD,$(OS_TARGET)))
+include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
+else
+include $(CORE_DEPTH)/coreconf/$(OS_CONFIG).mk
+endif
+include $(topsrcdir)/security/coreconf/prefix.mk
+
+ifneq (,$(CPU_ARCH))
+CPU_TAG = _$(CPU_ARCH)
+endif
+
+LOADABLE_ROOT_MODULE = $(DLL_PREFIX)nssckbi$(DLL_SUFFIX)
+
include $(DEPTH)/config/autoconf.mk
+DEFAULT_GMAKE_FLAGS = -f Makefile
+ifneq ($(MOZ_DEBUG),1)
+DEFAULT_GMAKE_FLAGS += BUILD_OPT=1
+BUILD_OPT=1
+OBJDIR_TAG=_OPT
+endif
+
+ifeq ($(OS_ARCH),OS2)
+COMPILER_TAG = _$(CC)
+endif
+
+CORECONF_OBJDIR =
+$(OS_CONFIG)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
+
+
DIRS = lib
include $(topsrcdir)/config/rules.mk
+
+install::
+ifneq ($(OS_ARCH),OS2)
+ cd $(DEPTH)/security/coreconf; gmake $(DEFAULT_GMAKE_FLAGS)
+endif
+ cd $(DEPTH)/security/nss; gmake $(DEFAULT_GMAKE_FLAGS) moz_import
+ cd $(DEPTH)/security/nss; gmake $(DEFAULT_GMAKE_FLAGS)
+ cd $(DEPTH)/security/psm/ui; gmake $(DEFAULT_GMAKE_FLAGS)
+ cd $(DEPTH)/security/psm/server; gmake $(DEFAULT_GMAKE_FLAGS)
+ $(INSTALL) -m 755 $(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psm$(PROG_SUFFIX)
+$(DIST)/bin
+ifeq ($(OS_ARCH),OS2)
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/04digsgn.gif $(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/06pcrypt.gif $(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/bannerrn.gif $(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/cartbanner.gif
+$(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/cmcjavascriptapi.html
+$(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/contents.htm $(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/glossary.htm $(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755 $(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/help.htm
+$(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755 $(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/next.gif
+$(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755 $(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/prev.gif
+$(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/psmtest.html $(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/doc/release_notes.html
+$(DIST)/bin/psmdata/doc
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/ui/psm_bin.properties
+$(DIST)/bin/psmdata/ui
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/ui/psm_doc.properties
+$(DIST)/bin/psmdata/ui
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/ui/psm_text.properties
+$(DIST)/bin/psmdata/ui
+ $(INSTALL) -m 755
+$(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata/ui/psm_ui.properties
+$(DIST)/bin/psmdata/ui
+else
+ $(INSTALL) -m 755 $(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/psmdata $(DIST)/bin
+ $(INSTALL) -m 755 $(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/start-psm $(DIST)/bin
+endif
+ $(INSTALL) -m 755 $(DEPTH)/dist/$(CORECONF_OBJDIR)/bin/$(LOADABLE_ROOT_MODULE)
+$(DIST)/bin
+
+
+clean::
+ cd $(DEPTH)/security/coreconf; gmake $(DEFAULT_GMAKE_FLAGS) clean
+ cd $(DEPTH)/security/nss; gmake $(DEFAULT_GMAKE_FLAGS) clean
+ cd $(DEPTH)/security/psm/ui; gmake $(DEFAULT_GMAKE_FLAGS) clean
+ cd $(DEPTH)/security/psm/server; gmake $(DEFAULT_GMAKE_FLAGS) clean
Index: config.mk
===================================================================
RCS file: /cvsroot/mozilla/config/config.mk,v
retrieving revision 3.176
diff -u -r3.176 config.mk
--- config.mk 2000/12/11 07:25:45 3.176
+++ config.mk 2000/12/13 23:32:33
@@ -157,7 +157,11 @@
endif
+ifeq ($(OS_ARCH),OS2)
+OS_CONFIG := $(OS_ARCH)
+else
OS_CONFIG := $(OS_ARCH)$(OS_RELEASE)
+endif
# determine debug-related options
DEBUG_FLAGS :=
Index: autoconf.mk.in
===================================================================
RCS file: /cvsroot/mozilla/directory/c-sdk/ldap/build/Attic/autoconf.mk.in,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 autoconf.mk.in
--- autoconf.mk.in 2000/10/21 00:16:02 1.1.2.3
+++ autoconf.mk.in 2000/12/13 23:35:46
@@ -60,3 +60,9 @@
MOD_DEPTH = $(NSPR_TREE)
endif
+
+# BIN_SUFFIX not getting defined for os/2
+ifeq ($(MOZ_OS2_TOOLS),VACPP)
+BIN_SUFFIX = .exe
+MKSHLIB = ilink
+endif
Index: Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/directory/c-sdk/ldap/build/Attic/Makefile.in,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 Makefile.in
--- Makefile.in 2000/10/21 00:16:01 1.1.2.2
+++ Makefile.in 2000/12/13 23:36:24
@@ -14,6 +14,10 @@
ifeq ($(OS_ARCH), OS2)
$(OBJS) = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.o))
+ifeq ($(MOZ_OS2_TOOLS),VACPP)
+OS_CFLAGS = $(OS_EXE_CFLAGS)
+endif
+
$(TARGETS): $(OBJS)
@$(MAKE_OBJDIR)
ifeq ($(MOZ_OS2_TOOLS),VACPP)
Index: ldap.h
===================================================================
RCS file: /cvsroot/mozilla/directory/c-sdk/ldap/include/ldap.h,v
retrieving revision 1.3.2.3
diff -u -r1.3.2.3 ldap.h
--- ldap.h 2000/06/21 18:46:58 1.3.2.3
+++ ldap.h 2000/12/13 23:37:15
@@ -27,9 +27,7 @@
extern "C" {
#endif
-#if defined( XP_OS2 )
-#include "os2sock.h"
-#elif defined (WIN32) || defined (_WIN32) || defined( _CONSOLE )
+#if defined (WIN32) || defined (_WIN32) || defined( _CONSOLE )
#include <windows.h>
# if defined( _WINDOWS )
# include <winsock.h>
@@ -54,6 +52,10 @@
#ifdef _AIX
#include <sys/select.h>
#endif /* _AIX */
+
+#ifdef XP_OS2_VACPP
+#include <sys/select.h>
+#endif
#include "lber.h"
Index: portable.h
===================================================================
RCS file: /cvsroot/mozilla/directory/c-sdk/ldap/include/portable.h,v
retrieving revision 1.2.2.4
diff -u -r1.2.2.4 portable.h
--- portable.h 2000/11/21 22:53:36 1.2.2.4
+++ portable.h 2000/12/13 23:37:39
@@ -300,7 +300,7 @@
#define BSD_TIME 1 /* for servers/slapd/log.h */
#endif /* sunos4 || osf */
-#if !defined(_WINDOWS) && !defined(macintosh)
+#if !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
#include <netinet/in.h>
#include <arpa/inet.h> /* for inet_addr() */
#endif
Index: lber-int.h
===================================================================
RCS file: /cvsroot/mozilla/directory/c-sdk/ldap/libraries/liblber/lber-int.h,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 lber-int.h
--- lber-int.h 2000/04/20 16:19:49 1.2.2.2
+++ lber-int.h 2000/12/13 23:38:29
@@ -65,10 +65,10 @@
# define USE_DBG_WIN
# endif
# else
-#if !defined(XP_OS2)
/* # include <sys/varargs.h> */
# include <sys/socket.h>
# include <netinet/in.h>
+#if !defined(XP_OS2)
# include <unistd.h>
#endif
# endif /* defined( _WINDOWS ) */
@@ -84,7 +84,6 @@
#endif /* _WINDOWS */
#ifdef XP_OS2
-#include <os2sock.h>
#include <io.h>
#endif /* XP_OS2 */
Index: Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/directory/c-sdk/ldap/libraries/liblber/Attic/Makefile.in,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Makefile.in
--- Makefile.in 2000/05/28 23:11:34 1.1.2.1
+++ Makefile.in 2000/12/13 23:39:56
@@ -6,16 +6,11 @@
RM = rm -f
SED = sed
-SRCS = decode.c \
+CSRCS = decode.c \
encode.c \
io.c \
bprint.c
-REALOBJS = $(SRCS:.c=.o)
-
-#OBJS = $(REALOBJS) versiont.o
-OBJS = $(REALOBJS)
-
HDIR = $(ldaptopsrcdir)/include
LIBRARY_NAME = lber40
@@ -36,6 +31,10 @@
INCLUDES += -I$(HDIR)
DEFINES += $(DEFS)
+ifeq ($(MOZ_OS2_TOOLS),VACPP)
+INCLUDES += -I$(DIST)/include
+endif
+
PLATFORMCFLAGS = -DUSE_WAITPID -DNEEDPROTOS
PLATFORMLIBS =
THREADS =
@@ -72,9 +71,21 @@
-e "s|%VERSION%|$${v}|" \
< Version.c > $@)
+ifeq ($(OS_ARCH),OS2)
+install:: $(TARGETS)
+ $(INSTALL) -m 444 $(TARGETS) $(DIST)/lib
+ifdef SHARED_LIBRARY
+ $(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/bin
+endif
+
+else # !os2
+
install:: $(LIBRARY) $(SHARED_LIBRARY)
$(INSTALL) -m 444 $(LIBRARY) $(DIST)/lib
ifdef MKSHLIB
$(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/lib
$(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/bin
endif
+
+endif # os2
+
Index: ldap-int.h
===================================================================
RCS file: /cvsroot/mozilla/directory/c-sdk/ldap/libraries/libldap/ldap-int.h,v
retrieving revision 1.2.2.3
diff -u -r1.2.2.3 ldap-int.h
--- ldap-int.h 2000/10/21 00:16:04 1.2.2.3
+++ ldap-int.h 2000/12/13 23:40:53
@@ -37,14 +37,14 @@
# include <windows.h>
#elif defined(macintosh)
#include "ldap-macos.h"
-#elif defined(XP_OS2)
-#include <os2sock.h>
#else /* _WINDOWS */
# include <sys/time.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
+#ifndef XP_OS2_VACPP
# include <arpa/inet.h>
+#endif
# include <netdb.h>
#if !defined(hpux) && !defined(SUNOS4) && !defined(LINUX)
# include <sys/select.h>
Index: Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/directory/c-sdk/ldap/libraries/libldap/Attic/Makefile.in,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 Makefile.in
--- Makefile.in 2000/10/21 00:16:03 1.1.2.2
+++ Makefile.in 2000/12/13 23:41:39
@@ -6,7 +6,7 @@
RM = rm -f
SED = sed
-SRCS = abandon.c \
+CSRCS = abandon.c \
add.c \
bind.c \
cache.c \
@@ -59,11 +59,6 @@
utf8.c \
vlistctrl.c
-REALOBJS = $(SRCS:.c=.o)
-
-#OBJS = $(REALOBJS) versiont.o
-OBJS = $(REALOBJS)
-
HDIR = $(ldaptopsrcdir)/include
HDIR2 = ../../include
@@ -92,6 +87,7 @@
ifeq ($(OS_ARCH), OS2)
INCLUDES += -I$(MOZ_DIST)/include
+EXTRA_LIBS += $(DIST)/lib/lber40.lib
endif
# So we actually get the definition of hostent_data....
@@ -158,12 +154,23 @@
-e "s|%VERSION%|$${v}|" \
< Version.c > $@)
+ifeq ($(OS_ARCH),OS2)
+install:: $(TARGETS)
+ $(INSTALL) -m 444 $(TARGETS) $(DIST)/lib
+ifdef SHARED_LIBRARY
+ $(INSTALL) -m 444 $(SHARED_LIBRARY) $(DIST)/bin
+endif
+
+else # !os2
+
install:: $(LIBRARY) $(SHARED_LIBRARY)
$(INSTALL) -m 444 $(LIBRARY) $(DIST)/lib
ifdef MKSHLIB
$(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/lib
$(INSTALL) -m 555 $(SHARED_LIBRARY) $(DIST)/bin
endif
+
+endif # os2
# XXX currently we don't install any of these config files; what to do?
#
Index: os-ip.c
===================================================================
RCS file: /cvsroot/mozilla/directory/c-sdk/ldap/libraries/libldap/os-ip.c,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 os-ip.c
--- os-ip.c 2000/04/20 16:27:12 1.2.2.2
+++ os-ip.c 2000/12/13 23:42:03
@@ -226,7 +226,11 @@
#ifdef _WINDOWS
err = ioctlsocket( s, FIONBIO, &iostatus );
#else
+#ifdef XP_OS2_VACPP
+ err = ioctl( s, FIONBIO, (caddr_t)&iostatus,
+sizeof(iostatus) );
+#else
err = ioctl( s, FIONBIO, (caddr_t)&iostatus );
+#endif
#endif /* _WINDOWS */
} else {
#ifdef _WINDOWS
