Bugzilla bug 249782: make NSPR compile with Microsoft Visual Studio 2005.
authorwchang0222%aol.com
Mon, 08 Nov 2004 02:52:56 +0000
changeset 3215 109e4019e61e5291caeb0075889ddca38578315d
parent 3211 16e0b1e7e8257b605eae1a7ccec0eed43c748932
child 3216 3045368f00acddd1fe657d82342e383de9d84ec2
push idunknown
push userunknown
push dateunknown
bugs249782
Bugzilla bug 249782: make NSPR compile with Microsoft Visual Studio 2005. The -DEBUGTYPE flag is no longer supported. Since -DEBUGTYPE:CV is the default, we simply delete it. We added support for VC 5.0 (MSC_VER=1100) back. The patch is contributed by Stephen Walker <sdwalker@myrealbox.com>. r=wtc. Modified Files: configure configure.in config/rules.mk lib/msgc/tests/Makefile.in lib/prstreams/tests/testprstrm/Makefile.in lib/tests/Makefile.in lib/tests/windows/makefile pr/src/cplus/tests/Makefile.in pr/src/misc/Makefile.in tools/Makefile.in
config/rules.mk
configure
configure.in
lib/msgc/tests/Makefile.in
lib/prstreams/tests/testprstrm/Makefile.in
lib/tests/Makefile.in
lib/tests/windows/makefile
pr/src/cplus/tests/Makefile.in
pr/src/misc/Makefile.in
tools/Makefile.in
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -135,17 +135,17 @@ endif
 endif
 endif
 
 ifndef TARGETS
 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
 TARGETS		= $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
 ifndef BUILD_OPT
 ifdef MSC_VER
-ifneq ($(MSC_VER),1200)
+ifneq (,$(filter-out 1100 1200,$(MSC_VER)))
 TARGETS		+= $(SHARED_LIB_PDB)
 endif
 endif
 endif
 else
 TARGETS		= $(LIBRARY) $(SHARED_LIBRARY)
 endif
 endif
--- a/configure
+++ b/configure
@@ -3819,18 +3819,18 @@ EOF
             fi
             if test -n "$MOZ_PROFILE" -o -n "$MOZ_DEBUG_SYMBOLS"; then
                 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
                 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
             fi
         fi
 
         if test -n "$MOZ_DEBUG"; then
-            DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
-            LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
+            DLLFLAGS="$DLLFLAGS -DEBUG"
+            LDFLAGS="$LDFLAGS -DEBUG"
         fi
         
         if test "$OS_TARGET" = "WINNT"; then
             CFLAGS="$CFLAGS -GT"
             if test "$CPU_ARCH" = "x86"; then
                 CFLAGS="$CFLAGS -G5"
             fi
             LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
@@ -3872,17 +3872,17 @@ EOF
         CPU_ARCH_TAG=$CPU_ARCH
     fi
 
     if test -n "$USE_DEBUG_RTL"; then
         OBJDIR_SUFFIX=OBJD
     fi
 
     OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
-    if test "$MSC_VER" = "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
+    if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
         OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
     fi
 
     case "$OS_TARGET" in
     WINNT)
 	    MDCPUCFG_H=_winnt.cfg
 	    ;;
     WIN95)
--- a/configure.in
+++ b/configure.in
@@ -1296,18 +1296,18 @@ case "$target" in
             fi
             if test -n "$MOZ_PROFILE" -o -n "$MOZ_DEBUG_SYMBOLS"; then
                 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
                 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
             fi
         fi
 
         if test -n "$MOZ_DEBUG"; then
-            DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
-            LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
+            DLLFLAGS="$DLLFLAGS -DEBUG"
+            LDFLAGS="$LDFLAGS -DEBUG"
         fi
         
         if test "$OS_TARGET" = "WINNT"; then
             CFLAGS="$CFLAGS -GT"
             if test "$CPU_ARCH" = "x86"; then
                 CFLAGS="$CFLAGS -G5"
             fi
             LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
@@ -1337,17 +1337,17 @@ case "$target" in
         CPU_ARCH_TAG=$CPU_ARCH
     fi
 
     if test -n "$USE_DEBUG_RTL"; then
         OBJDIR_SUFFIX=OBJD
     fi
 
     OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
-    if test "$MSC_VER" = "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
+    if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
         OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
     fi
 
     case "$OS_TARGET" in
     WINNT)
 	    MDCPUCFG_H=_winnt.cfg
 	    ;;
     WIN95)
--- a/lib/msgc/tests/Makefile.in
+++ b/lib/msgc/tests/Makefile.in
@@ -79,17 +79,17 @@ LIBPLC = -lplc$(NSPR_VERSION)
 LIBGC = -lmsgc$(GC_VERSION)
 
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET), WIN16)
   LIBPR = $(dist_libdir)/nspr$(NSPR_VERSION).lib
   LIBPLC = $(dist_libdir)/plc$(NSPR_VERSION).lib
   LIBGC= $(dist_libdir)/msgc$(GC_VERSION).lib
 else
-  LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+  LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
   LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).$(LIB_SUFFIX)
   LIBPLC = $(dist_libdir)/libplc$(NSPR_VERSION).$(LIB_SUFFIX)
   LIBGC= $(dist_libdir)/libmsgc$(GC_VERSION).$(LIB_SUFFIX)
 endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
--- a/lib/prstreams/tests/testprstrm/Makefile.in
+++ b/lib/prstreams/tests/testprstrm/Makefile.in
@@ -74,17 +74,17 @@ LDOPTS = -L$(dist_libdir)
 LIBPR = -lnspr$(MOD_MAJOR_VERSION)
 LIBPRSTRMS = -lprstrms$(MOD_MAJOR_VERSION)
 
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET), WIN16)
   LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
   LIBPRSTRMS = $(dist_libdir)/prstrms$(MOD_MAJOR_VERSION).lib
 else
-  LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+  LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
   ifeq ($(OS_TARGET), WIN95)
     LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
     LIBPRSTRMS = $(dist_libdir)/prstrms$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
   else
     LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
     LIBPRSTRMS = $(dist_libdir)/libprstrms$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
   endif
 endif
--- a/lib/tests/Makefile.in
+++ b/lib/tests/Makefile.in
@@ -83,17 +83,17 @@ LIBPLC = -lplc$(MOD_MAJOR_VERSION)
 LIBPLDS = -lplds$(MOD_MAJOR_VERSION)
 
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET), WIN16)
   LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
   LIBPLC= $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
   LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).lib
 else
-  LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+  LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
   ifeq ($(OS_TARGET), WIN95)
   LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
   LIBPLC= $(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
   LIBPLDS= $(dist_libdir)/plds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
   else
   LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
   LIBPLC= $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
   LIBPLDS= $(dist_libdir)/libplds$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
--- a/lib/tests/windows/makefile
+++ b/lib/tests/windows/makefile
@@ -44,32 +44,32 @@ INCLUDES = -I$(DIST)/include
 CSRCS = winevent.c
 
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET), WIN16)
   LIBPR = $(DIST)/lib/nspr$(MOD_VERSION).lib
   LIBPLC= $(DIST)/lib/plc$(MOD_VERSION).lib
   LIBPLDS= $(DIST)/lib/plds$(MOD_VERSION).lib
 else
-  LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+  LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
   ifeq ($(OS_TARGET), WIN95)
   LIBPR = $(DIST)/lib/nspr$(MOD_VERSION).$(LIB_SUFFIX)
   LIBPLC= $(DIST)/lib/plc$(MOD_VERSION).$(LIB_SUFFIX)
   LIBPLDS= $(DIST)/lib/plds$(MOD_VERSION).lib
   else
   LIBPR = $(DIST)/lib/libnspr$(MOD_VERSION).$(LIB_SUFFIX)
   LIBPLC= $(DIST)/lib/libplc$(MOD_VERSION).$(LIB_SUFFIX)
   LIBPLDS= $(DIST)/lib/libplds$(MOD_VERSION).lib
   endif
 endif
 endif
 
 TARGETS = $(OBJDIR)/winevent.exe
 OS_CFLAGS = $(OS_EXE_CFLAGS)
-LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
 LDFLAGS += -DEBUG
 LIBPR += $(LIBPLDS)
 LIBPR += kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
 
 include $(MOD_DEPTH)/config/rules.mk
 
 $(OBJDIR)/winevent.exe: $(OBJS)
 	link $(LDOPTS) $< $(LIBPLC) $(LIBPR) wsock32.lib -out:$@
--- a/pr/src/cplus/tests/Makefile.in
+++ b/pr/src/cplus/tests/Makefile.in
@@ -127,17 +127,17 @@ ifeq ($(OS_ARCH), SunOS)
     endif # LOCAL_THREADS_ONLY
 endif # SunOS
 
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET), WIN16)
   LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).lib
   LIBPL = $(dist_libdir)/plc$(MOD_MAJOR_VERSION).lib
 else
-  LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+  LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
   LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
   LIBPL = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
 endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
   ifeq ($(MOZ_OS2_TOOLS),VACPP)
     LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
--- a/pr/src/misc/Makefile.in
+++ b/pr/src/misc/Makefile.in
@@ -88,17 +88,21 @@ include $(topsrcdir)/config/rules.mk
 
 # Prevent floating point errors caused by MSVC 6.0 Processor Pack
 # optimizations (bug 207421).  This disables optimizations that
 # could change the precision of floating-point calculations for
 # this single compilation unit.
 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
 $(OBJDIR)/prdtoa.$(OBJ_SUFFIX): prdtoa.c
 	@$(MAKE_OBJDIR)
+ifeq (,$(filter-out 1100 1200 1300 1310,$(MSC_VER)))
 	$(CC) -Fo$@ -c $(CFLAGS) -Op $(call abspath,$<)
+else
+	$(CC) -Fo$@ -c $(CFLAGS) -fp:precise $(call abspath,$<)
+endif
 endif
 
 #
 # Generate prerr.h, prerr.c, and prerr.properties from prerr.et.
 #
 build_prerr:
 	cd $(srcdir); $(PERL) compile-et.pl prerr.et
 
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -78,17 +78,17 @@ LDOPTS = -L$(dist_libdir)
 LIBPR = -lnspr$(NSPR_VERSION)
 LIBPLC = -lplc$(NSPR_VERSION)
 
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET), WIN16)
   LIBPR = $(dist_libdir)/nspr$(NSPR_VERSION).lib
   LIBPLC= $(dist_libdir)/plc$(NSPR_VERSION).lib
 else
-LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
+LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
 LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).$(LIB_SUFFIX)
 LIBPLC= $(dist_libdir)/libplc$(NSPR_VERSION).$(LIB_SUFFIX)
 endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
   ifeq ($(MOZ_OS2_TOOLS),VACPP)
     LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO