Patch for compiling with VC8

Michael Dürig <[email protected]> Thu, 12 Oct 2006 20:50:32 +0200
Newsgroups gmane.comp.graphics.chromium.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------070900090009060306010000
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


The patch attached adds support for Visual Studio 2005 (i.e. VC8).

- When VC8 is detected in WIN_NT.MK a different set of flags is set.
There are a lot of deprecation warnings. I choose to ignore them (/wd4996).

- By default the linker produces an external manifest file. This is
problematic for appfaker since an application fails to start when the
manifest is not in the applications directory. I therefore added a
further link step which embeds the manifest into the application's binary.

- Some .def files used the DESCRIPTION keyword which is deprecated now.
Since the description was always an empty string I removed it entirely.

- I think it is wrong to declare cr_packer_globals DLLDATA
(__declspec(dllimport)) in cr_pack.h/pack_init.c. After all the variable
is exported.

Michael




--------------070900090009060306010000
Content-Type: text/plain;
 name="cr.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cr.patch"

Index: cr.mk
===================================================================
RCS file: /cvsroot/chromium/cr/cr.mk,v
retrieving revision 1.58
diff -u -r1.58 cr.mk
--- cr.mk	10 Aug 2006 16:15:43 -0000	1.58
+++ cr.mk	12 Oct 2006 17:52:05 -0000
@@ -339,6 +339,9 @@
 	@$(ECHO) "Linking $(PROGRAM) for $(ARCH)"
 ifdef WINDOWS
 	@$(CR_CXX) $(OBJS) /Fe$(PROG_TARGET)$(EXESUFFIX) $(LIBRARIES) $(LDFLAGS)
+ifdef MT
+	@$(MT) -manifest $(PROG_TARGET)$(EXESUFFIX).manifest -outputresource:$(PROG_TARGET)$(EXESUFFIX)\;1
+endif
 else
 ifdef BINUTIL_LINK_HACK
 ifdef PERSONAL_LIBRARIES
@@ -356,6 +359,9 @@
 ifdef WINDOWS
 ifdef SHARED
 	@$(LD) $(SHARED_LDFLAGS) /Fe$(LIBNAME) $(OBJS) $(LIBRARIES) $(LIB_DEFS) $(LDFLAGS)
+ifdef MT
+	@$(MT) -manifest $(LIBNAME).manifest -outputresource:$(LIBNAME)\;2
+endif
 else
 	@LIB.EXE /nologo $(OBJS) $(LIBRARIES) /OUT:$(LIBNAME)
 endif #shared
@@ -417,6 +423,9 @@
 	$(MKDIR) $(TOP)/built/$(SHORT_TARGET_NAME)/$(ARCH)
 ifdef WINDOWS
 	@$(LD) $(SHARED_LDFLAGS) /Fe$@ $(OBJS) $(LIBRARIES) $(LIB_DEFS) $(LDFLAGS)
+ifdef MT
+	@$(MT) -manifest [email protected] -outputresource:$@\;2
+endif
 else
 ifdef AIXSHAREDLIB
 	@$(ECHO) "AIX shared obj link"
@@ -449,6 +458,9 @@
 	$(MKDIR) $(TOP)/built/$*/$(ARCH)
 ifdef WINDOWS
 	@$(LD) $(SHARED_LDFLAGS) /Fe$@ $(OBJS) $(LIBRARIES) $(LIB_DEFS) $(LDFLAGS)
+ifdef MT
+	@$(MT) -manifest [email protected] -outputresource:$@\;2
+endif
 else
 ifdef AIXSHAREDLIB
 	@$(ECHO) "AIX shared obj link"
Index: config/WIN_NT.MK
===================================================================
RCS file: /cvsroot/chromium/cr/config/WIN_NT.MK,v
retrieving revision 1.14
diff -u -r1.14 WIN_NT.MK
--- config/WIN_NT.MK	18 Feb 2004 02:00:48 -0000	1.14
+++ config/WIN_NT.MK	4 Oct 2006 23:17:52 -0000
@@ -11,6 +11,25 @@
 # NOTE:  If you're compiling on Windows and find that some code warnings
 # stop compilation, remove the /WX flags in the next few lines.
 
+# Check for VC8
+VC=$(shell if cl /Yd 2>&1 | grep -q "Version 14" ; then echo 8; fi)
+
+# Options for VC8
+ifeq ($(VC), 8)
+MT = mt -nologo
+
+CXXFLAGS          += /nologo /DWIN32 /DWINDOWS /TP /W3 /WX /EHsc /D_CRT_SECURE_NO_DEPRECATE /wd4996 
+CXX_RELEASE_FLAGS += /MD /Ox /DNDEBUG
+# This is just not working for me on VC++ 7 --> CXX_DEBUG_FLAGS   += /GZ
+CXX_DEBUG_FLAGS   += /MDd /Zi
+
+CFLAGS          += /nologo /DWIN32 /DWINDOWS /W3 /WX /TC /EHsc /Zm1024 /D_CRT_SECURE_NO_DEPRECATE /wd4996 
+C_RELEASE_FLAGS += /MD /Ox /DNDEBUG
+# This is just not working for me on VC++ 7 --> C_DEBUG_FLAGS   += /GZ
+C_DEBUG_FLAGS   += /MDd /Zi
+
+# Options for VC other than 8
+else
 CXXFLAGS          += /nologo /DWIN32 /DWINDOWS /TP /W3 /WX /GX /QIfist
 CXX_RELEASE_FLAGS += /MD /Ox /DNDEBUG
 # This is just not working for me on VC++ 7 --> CXX_DEBUG_FLAGS   += /GZ
@@ -20,6 +39,7 @@
 C_RELEASE_FLAGS += /MD /Ox /DNDEBUG
 # This is just not working for me on VC++ 7 --> C_DEBUG_FLAGS   += /GZ
 C_DEBUG_FLAGS   += /MDd /Yd /Z7
+endif
 
 LDFLAGS          += /nologo
 LD_RELEASE_FLAGS += 
@@ -58,3 +78,4 @@
 MPI_CC = cl
 MPI_CXX = cl
 MPI_LDFLAGS += mpichd.lib
+
Index: dlm/dlm_header.py
===================================================================
RCS file: /cvsroot/chromium/cr/dlm/dlm_header.py,v
retrieving revision 1.7
diff -u -r1.7 dlm_header.py
--- dlm/dlm_header.py	24 Aug 2006 10:11:35 -0000	1.7
+++ dlm/dlm_header.py	12 Oct 2006 17:52:56 -0000
@@ -192,7 +192,6 @@
 	apiutil.CopyrightDef()
 	print '''\t; DO NOT EDIT.  This code is generated by %s.
 
-DESCRIPTION ""
 EXPORTS''' % os.path.basename(sys.argv[0])
 else:
 	raise "unknown generation mode '%s'" % mode
Index: include/cr_pack.h
===================================================================
RCS file: /cvsroot/chromium/cr/include/cr_pack.h,v
retrieving revision 1.37
diff -u -r1.37 cr_pack.h
--- include/cr_pack.h	3 Aug 2006 20:33:30 -0000	1.37
+++ include/cr_pack.h	12 Oct 2006 17:46:59 -0000
@@ -137,7 +137,7 @@
 extern CRtsd _PackerTSD;
 #define GET_PACKER_CONTEXT(C) CRPackContext *C = (CRPackContext *) crGetTSD(&_PackerTSD)
 #else
-extern DLLDATA CRPackContext cr_packer_globals;
+extern CRPackContext cr_packer_globals;
 #define GET_PACKER_CONTEXT(C) CRPackContext *C = &cr_packer_globals
 #endif
 
Index: opengl_stub/defs.py
===================================================================
RCS file: /cvsroot/chromium/cr/opengl_stub/defs.py,v
retrieving revision 1.15
diff -u -r1.15 defs.py
--- opengl_stub/defs.py	27 Jan 2004 23:58:04 -0000	1.15
+++ opengl_stub/defs.py	5 Oct 2006 13:32:36 -0000
@@ -10,7 +10,6 @@
 
 apiutil.CopyrightDef()
 
-print "DESCRIPTION \"\""
 print "EXPORTS"
 
 # XXX can't these values be automatically computed by analyzing parameters?
Index: packer/pack_init.c
===================================================================
RCS file: /cvsroot/chromium/cr/packer/pack_init.c,v
retrieving revision 1.9
diff -u -r1.9 pack_init.c
--- packer/pack_init.c	28 Feb 2006 15:57:44 -0000	1.9
+++ packer/pack_init.c	5 Oct 2006 13:18:37 -0000
@@ -14,7 +14,7 @@
 int cr_packer_globals;  /* dummy - for the sake of packer.def */
 #else
 int _PackerTSD;         /* dummy - for the sake of packer.def */  /* drm1 */
-DLLDATA CRPackContext cr_packer_globals;
+CRPackContext cr_packer_globals;
 #endif
 
 CRPackContext *crPackNewContext( int swapping )
Index: packer/packer_defs.py
===================================================================
RCS file: /cvsroot/chromium/cr/packer/packer_defs.py,v
retrieving revision 1.31
diff -u -r1.31 packer_defs.py
--- packer/packer_defs.py	3 Aug 2006 20:33:30 -0000	1.31
+++ packer/packer_defs.py	12 Oct 2006 17:55:06 -0000
@@ -14,7 +14,6 @@
 
 apiutil.CopyrightDef()
 
-print "DESCRIPTION \"\""
 print "EXPORTS"
 
 keys = apiutil.GetDispatchedFunctions()
Index: spu/zpix/zpixspu.def
===================================================================
RCS file: /cvsroot/chromium/cr/spu/zpix/zpixspu.def,v
retrieving revision 1.2
diff -u -r1.2 zpixspu.def
--- spu/zpix/zpixspu.def	13 Dec 2003 17:25:43 -0000	1.2
+++ spu/zpix/zpixspu.def	5 Oct 2006 12:42:12 -0000
@@ -2,6 +2,5 @@
 ; All rights reserved.
 ;
 ; See the file LICENSE.txt for information on redistributing this software.
-DESCRIPTION ""
 EXPORTS
 SPULoad
Index: state_tracker/state_defs.py
===================================================================
RCS file: /cvsroot/chromium/cr/state_tracker/state_defs.py,v
retrieving revision 1.24
diff -u -r1.24 state_defs.py
--- state_tracker/state_defs.py	12 Sep 2006 21:01:58 -0000	1.24
+++ state_tracker/state_defs.py	12 Oct 2006 17:55:44 -0000
@@ -11,7 +11,7 @@
 
 apiutil.CopyrightDef()
 
-print """DESCRIPTION ""
+print """
 EXPORTS
 """
 


--------------070900090009060306010000
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
--------------070900090009060306010000
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Chromium-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chromium-dev

--------------070900090009060306010000--