Make the stub sytem work for WIN NT as well as other unix platforms:
authorrelyea%netscape.com
Tue, 04 Apr 2000 23:49:50 +0000
changeset 224 004e938264f749d1e6a591c2d967e08281a0a70d
parent 223 814527e7a178a0ecaaf03e0c3c9a9f798063d120
child 225 639c720d524a671a7b28e288cf36155ebb082494
push idunknown
push userunknown
push dateunknown
Make the stub sytem work for WIN NT as well as other unix platforms: 1) fix compile issue in the stub maci.c file (change dllimports to dllexports). 2) build a dll with matching lib to make the symbols all work.
security/nss/lib/fortcrypt/Makefile
security/nss/lib/fortcrypt/maci.c
--- a/security/nss/lib/fortcrypt/Makefile
+++ b/security/nss/lib/fortcrypt/Makefile
@@ -45,16 +45,20 @@ endif
 ifeq ($(OS_TARGET), WIN16)
 ORIG_CILIB              = libci/tssp.lib
 endif
 
 ifeq ($(OS_TARGET), WIN95)
 ORIG_CILIB              = libci/tssp32.lib
 endif
 
+ifeq ($(OS_ARCH), WINNT)
+STUBDLL                 = $(OBJDIR)/stub.$(DLL_SUFFIX)
+endif
+
 STUBLIB                 = $(OBJDIR)/stub.$(LIB_SUFFIX)
 
 ifeq ($(OS_TARGET), WIN16)
 W16LIBS         += $(CILIB)
 else
 EXTRA_LIBS      += $(CILIB)
 endif
 
@@ -87,19 +91,31 @@ endif
 	else \
 		echo "Making empty stub $@"; \
 		$(MAKE) $(STUBLIB); \
 	fi
 	@$(RANLIB) $@
 
 $(STUBLIB): $(OBJDIR)/maci.o
 	@$(MAKE_OBJDIR)
+ifeq ($(OS_ARCH), WINNT)
+	$(MAKE) $(STUBDLL)
+else
 	$(AR) $<
+endif
 	cp $@ $(CILIB)
 
+ifeq ($(OS_ARCH), WINNT)
+$(STUBDLL): $(OBJDIR)/maci.o
+	$(LINK_DLL) -MAP $(DLLBASE) $(OBJDIR)/maci.o $(OS_LIBS)
+
+$(OBJDIR)/maci.o: maci.c
+	$(CC) -Fo$@ -c $(CFLAGS) $<
+endif
+
 #
 # The following rules packages the shared library into a JAR,
 # ready to be signed
 #
 $(OBJDIR)/replace: replace.c
 	$(CC) -o $@ $<
 
 # ZIP options:
@@ -139,8 +155,10 @@ LD      += -G
 endif 
 
 
 ifneq ($(OS_TARGET), WIN16)
 include $(CORE_DEPTH)/coreconf/rules.mk
 endif
 
 export:: private_export
+
+
--- a/security/nss/lib/fortcrypt/maci.c
+++ b/security/nss/lib/fortcrypt/maci.c
@@ -25,18 +25,24 @@
  * 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.
  */
+#include "seccomon.h"
+
+#if defined( _WIN32 ) || defined( __WIN32__ )
+#define RETURN_TYPE  extern _declspec( dllexport ) int _cdecl
+#endif /* Windows */
 #include "maci.h"
 
+
 RETURN_TYPE
 MACI_ChangePIN PROTO_LIST( (
     HSESSION       hSession,
     int            PINType,
     CI_PIN CI_FAR  pOldPIN,
     CI_PIN CI_FAR  pNewPIN ) ) {
     return CI_ERROR;
 }