Hi Mike
Thanks a lot for your patch. If the appropriate compiler options are
applied to VC8, the make_mvc.mak script emits much less warning
messages, and probably the created binary is better optimised in
some manner.
Alas, your patch doesn't work on my machine for three reasons:
1) I use VCExpress version to build vim. This is VC8, but there is
no SDK. So I also downloaded the Windows Server 2003 R2 Platform
SDK. This SDK was the newest when I downloaded it. Alas it comes
with nmake version 7.00.xyz. So I have to use nmake 7.00.xyz to
control VC8.
Solution: make_mvc.mak should not estimate the version of the
nmake utility, but of the compiler that is used. This is a little
bit difficult, but since version 7.0 of the VC toolset there
exists a environment variable MSVCVer which IMHO should be used
when it is defined.
2) The nmake utility that comes with the Windows Server 2003 R2
Platform SDK has the version 7.00.8882. This is none of the
versions that your patch is made for.
Solution: This version should be added to the list of versions
as long a s this list is maintained. Another problem: I have
heart of a VC 7.1. But I don't know with which exact version
number the related nmake tool comes. So it is doubtful if the
version list should be maintained at all, or if one should better
relay on the environment variable MSVCVer that can in case of
need be defined manually by the user.
3) Your patch uses the operators >, <, >= and <= to compare version
numbers. With my nmake-7.00.8882 this doesn't work, even if I
omit the quotes around the numbers and the macros.
Solution: It's a pity, but one has to work with == and !=.
I have applied all the solutions mentioned above (by keeping to
maintain the list of nmake versions) and can now build vim
successfully. (To be honest: I HAVE to apply other patches too that
I once have mailed to this list but seemed to have been ignored?).
Best regards and thanks again for this patch
Mathias Michaelis
Patch U010 Written by Mike Williams <[EMAIL PROTECTED]>
and Mathias Michaelis <[EMAIL PROTECTED]>
Problem: VC8 no longer supports the /Gn processor code generation
directive, and the makefile now uses link time code
generation when not optimizing for space with an error
message.
Solution: Check version of the visual tool set and, if version is
8.0, use VC8 specific optimization options.
Files: src/Make_mvc.mak
*** ..\vim-7.0.000\src\Make_mvc.mak 2006-04-26 12:30:22.000000000 +0200
--- src\Make_mvc.mak 2007-01-20 12:33:37.088265600 +0100
***************
*** 320,326 ****
--- 320,354 ----
INTDIR=$(OBJDIR)
OUTDIR=$(OBJDIR)
+ # Derive version of VC being used
+ !ifndef MSVCVER
+ !if "$(_NMAKE_VER)" == ""
+ MSVCVER = 4.0
+ !endif
+ !if "$(_NMAKE_VER)" == "162"
+ MSVCVER = 5.0
+ !endif
+ !if "$(_NMAKE_VER)" == "6.00.8168.0"
+ MSVCVER = 6.0
+ !endif
+ !if "$(_NMAKE_VER)" == "7.00.9466"
+ MSVCVER = 7.0
+ !endif
+ !if "$(_NMAKE_VER)" == "7.00.8882"
+ MSVCVER = 7.0
+ !endif
+ !if "$(_NMAKE_VER)" == "8.00.50727.42"
+ MSVCVER = 8.0
+ !endif
+ !endif
+
+ # Default to VC6 (arbitrarily) if unknown
+ !ifndef MSVCVER
+ MSVCVER = 6.0
+ !endif
+
# Convert processor ID to MVC-compatible number
+ !if "$(MSVCVER)" != "8.0"
!if "$(CPUNR)" == "i386"
CPUARG = /G3
!elseif "$(CPUNR)" == "i486"
***************
*** 334,339 ****
--- 362,373 ----
!else
CPUARG =
!endif
+ !else
+ # VC8 only allows specifying SSE architecture
+ !if "$(CPUNR)" == "pentium4"
+ CPUARG = /arch:SSE2
+ !endif
+ !endif
!ifdef NODEBUG
VIM = vim
***************
*** 344,349 ****
--- 378,389 ----
!else # MAXSPEED
OPTFLAG = /Ox
!endif
+ !if "$(MSVCVER)" == "8.0"
+ # Use link time code generation if not worried about size
+ !if "$(OPTIMIZE)" != "SPACE"
+ OPTFLAG = $(OPTFLAG) /GL
+ !endif
+ !endif
CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
! ifdef USE_MSVCRT
***************
*** 363,369 ****
CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in
VC4.0.
! ! if "$(_NMAKE_VER)" == ""
LIBC =
! else
LIBC = /fixed:no
--- 403,409 ----
CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in
VC4.0.
! ! if "$(MSVCVER)" == "4.0"
LIBC =
! else
LIBC = /fixed:no
***************
*** 707,712 ****
--- 747,761 ----
$(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
$(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
+ # Report link time code generation progress if used.
+ !ifdef NODEBUG
+ !if "$(MSVCVER)" == "8.0"
+ !if "$(OPTIMIZE)" != "SPACE"
+ LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
+ !endif
+ !endif
+ !endif
+
all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
GvimExt/gvimext.dll
***************
*** 795,801 ****
# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
! !IF "$(_NMAKE_VER)" == ""
.c{$(OUTDIR)/}.obj:
!ELSE
.c{$(OUTDIR)/}.obj::
--- 844,850 ----
# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
! !IF "$(MSVCVER)" == "4.0"
.c{$(OUTDIR)/}.obj:
!ELSE
.c{$(OUTDIR)/}.obj::
***************
*** 804,810 ****
# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
! !IF "$(_NMAKE_VER)" == ""
.cpp{$(OUTDIR)/}.obj:
!ELSE
.cpp{$(OUTDIR)/}.obj::
--- 853,859 ----
# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
! !IF "$(MSVCVER)" == "4.0"
.cpp{$(OUTDIR)/}.obj:
!ELSE
.cpp{$(OUTDIR)/}.obj::