52e4ed3
To: vim-dev@vim.org
52e4ed3
Subject: patch 7.1.134 (extra)
52e4ed3
Fcc: outbox
52e4ed3
From: Bram Moolenaar <Bram@moolenaar.net>
52e4ed3
Mime-Version: 1.0
52e4ed3
Content-Type: text/plain; charset=ISO-8859-1
52e4ed3
Content-Transfer-Encoding: 8bit
52e4ed3
------------
52e4ed3
52e4ed3
Patch 7.1.134 (extra)
52e4ed3
Problem:    Win32: Can't build with VC8
52e4ed3
Solution:   Detect the MSVC version instead of using NMAKE_VER.
52e4ed3
            (Mike Williams)
52e4ed3
Files:      src/Make_mvc.mak
52e4ed3
52e4ed3
52e4ed3
*** ../vim-7.1.133/src/Make_mvc.mak	Tue Feb 20 03:15:08 2007
52e4ed3
--- src/Make_mvc.mak	Mon Oct  1 21:37:20 2007
52e4ed3
***************
52e4ed3
*** 92,97 ****
52e4ed3
--- 92,99 ----
52e4ed3
  #       Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
52e4ed3
  #       doesn't work)
52e4ed3
  #
52e4ed3
+ #       Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
52e4ed3
+ #
52e4ed3
  # You can combine any of these interfaces
52e4ed3
  #
52e4ed3
  # Example: To build the non-debug, GUI version with Perl interface:
52e4ed3
***************
52e4ed3
*** 101,107 ****
52e4ed3
  #	This makefile gives a fineness of control which is not supported in
52e4ed3
  #	Visual C++ configuration files.  Therefore, debugging requires a bit of
52e4ed3
  #	extra work.
52e4ed3
! #	Make_dvc.mak is a Visual C++ project to access that support.
52e4ed3
  #	To use Make_dvc.mak:
52e4ed3
  #	1) Build Vim with Make_mvc.mak.
52e4ed3
  #	     Use a "DEBUG=yes" argument to build Vim with debug support.
52e4ed3
--- 103,110 ----
52e4ed3
  #	This makefile gives a fineness of control which is not supported in
52e4ed3
  #	Visual C++ configuration files.  Therefore, debugging requires a bit of
52e4ed3
  #	extra work.
52e4ed3
! #	Make_dvc.mak is a Visual C++ project to access that support.  It may be
52e4ed3
! #	badly out of date for the Visual C++ you are using...
52e4ed3
  #	To use Make_dvc.mak:
52e4ed3
  #	1) Build Vim with Make_mvc.mak.
52e4ed3
  #	     Use a "DEBUG=yes" argument to build Vim with debug support.
52e4ed3
***************
52e4ed3
*** 198,211 ****
52e4ed3
  !if "$(DEBUG)" != "yes"
52e4ed3
  NODEBUG = 1
52e4ed3
  !else
52e4ed3
  MAKEFLAGS_GVIMEXT = DEBUG=yes
52e4ed3
  !endif
52e4ed3
  
52e4ed3
  
52e4ed3
! # Get all sorts of useful, standard macros from the SDK.  (Note that
52e4ed3
! # MSVC 2.2 does not install <ntwin32.mak> in the \msvc20\include
52e4ed3
! # directory, but you can find it in \msvc20\include on the CD-ROM.
52e4ed3
! # You may also need <win32.mak> from the same place.)
52e4ed3
  
52e4ed3
  !include <Win32.mak>
52e4ed3
  
52e4ed3
--- 201,212 ----
52e4ed3
  !if "$(DEBUG)" != "yes"
52e4ed3
  NODEBUG = 1
52e4ed3
  !else
52e4ed3
+ !undef NODEBUG
52e4ed3
  MAKEFLAGS_GVIMEXT = DEBUG=yes
52e4ed3
  !endif
52e4ed3
  
52e4ed3
  
52e4ed3
! # Get all sorts of useful, standard macros from the Platform SDK.
52e4ed3
  
52e4ed3
  !include <Win32.mak>
52e4ed3
  
52e4ed3
***************
52e4ed3
*** 272,283 ****
52e4ed3
  
52e4ed3
  # Set which version of the CRT to use
52e4ed3
  !if defined(USE_MSVCRT)
52e4ed3
! CVARS = $(cvarsdll)
52e4ed3
  # !elseif defined(MULTITHREADED)
52e4ed3
  # CVARS = $(cvarsmt)
52e4ed3
  !else
52e4ed3
  # CVARS = $(cvars)
52e4ed3
! CVARS = $(cvarsmt)
52e4ed3
  !endif
52e4ed3
  
52e4ed3
  # need advapi32.lib for GetUserName()
52e4ed3
--- 273,284 ----
52e4ed3
  
52e4ed3
  # Set which version of the CRT to use
52e4ed3
  !if defined(USE_MSVCRT)
52e4ed3
! # CVARS = $(cvarsdll)
52e4ed3
  # !elseif defined(MULTITHREADED)
52e4ed3
  # CVARS = $(cvarsmt)
52e4ed3
  !else
52e4ed3
  # CVARS = $(cvars)
52e4ed3
! # CVARS = $(cvarsmt)
52e4ed3
  !endif
52e4ed3
  
52e4ed3
  # need advapi32.lib for GetUserName()
52e4ed3
***************
52e4ed3
*** 320,326 ****
52e4ed3
--- 321,364 ----
52e4ed3
  INTDIR=$(OBJDIR)
52e4ed3
  OUTDIR=$(OBJDIR)
52e4ed3
  
52e4ed3
+ # Derive version of VC being used from nmake if not specified
52e4ed3
+ !if "$(MSVCVER)" == ""
52e4ed3
+ !if "$(_NMAKE_VER)" == ""
52e4ed3
+ MSVCVER = 4.0
52e4ed3
+ !endif
52e4ed3
+ !if "$(_NMAKE_VER)" == "162"
52e4ed3
+ MSVCVER = 5.0
52e4ed3
+ !endif
52e4ed3
+ !if "$(_NMAKE_VER)" == "6.00.8168.0"
52e4ed3
+ MSVCVER = 6.0
52e4ed3
+ !endif
52e4ed3
+ !if "$(_NMAKE_VER)" == "7.00.9466"
52e4ed3
+ MSVCVER = 7.0
52e4ed3
+ !endif
52e4ed3
+ !if "$(_NMAKE_VER)" == "7.10.3077"
52e4ed3
+ MSVCVER = 7.1
52e4ed3
+ !endif
52e4ed3
+ !if "$(_NMAKE_VER)" == "8.00.50727.42"
52e4ed3
+ MSVCVER = 8.0
52e4ed3
+ !endif
52e4ed3
+ !if "$(_NMAKE_VER)" == "8.00.50727.762"
52e4ed3
+ MSVCVER = 8.0
52e4ed3
+ !endif
52e4ed3
+ !endif
52e4ed3
+ 
52e4ed3
+ # Abort bulding VIM if version of VC is unrecognised.
52e4ed3
+ !ifndef MSVCVER
52e4ed3
+ !message *** ERROR
52e4ed3
+ !message Cannot determine Visual C version being used.  If you are using the
52e4ed3
+ !message Windows SDK then you must have the environment variable MSVCVER set to
52e4ed3
+ !message your version of the VC compiler.  If you are not using the Express
52e4ed3
+ !message version of Visual C you van either set MSVCVER or update this makefile
52e4ed3
+ !message to handle the new value for _NMAKE_VER.
52e4ed3
+ !error Make aborted.
52e4ed3
+ !endif
52e4ed3
+ 
52e4ed3
  # Convert processor ID to MVC-compatible number
52e4ed3
+ !if "$(MSVCVER)" != "8.0"
52e4ed3
  !if "$(CPUNR)" == "i386"
52e4ed3
  CPUARG = /G3
52e4ed3
  !elseif "$(CPUNR)" == "i486"
52e4ed3
***************
52e4ed3
*** 334,339 ****
52e4ed3
--- 372,386 ----
52e4ed3
  !else
52e4ed3
  CPUARG =
52e4ed3
  !endif
52e4ed3
+ !else
52e4ed3
+ # VC8 only allows specifying SSE architecture
52e4ed3
+ !if "$(CPUNR)" == "pentium4"
52e4ed3
+ CPUARG = /arch:SSE2
52e4ed3
+ !endif
52e4ed3
+ !endif
52e4ed3
+ 
52e4ed3
+ LIBC =
52e4ed3
+ DEBUGINFO = /Zi
52e4ed3
  
52e4ed3
  !ifdef NODEBUG
52e4ed3
  VIM = vim
52e4ed3
***************
52e4ed3
*** 344,384 ****
52e4ed3
  !else # MAXSPEED
52e4ed3
  OPTFLAG = /Ox
52e4ed3
  !endif
52e4ed3
  CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
52e4ed3
  RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
52e4ed3
  ! ifdef USE_MSVCRT
52e4ed3
! CFLAGS = $(CFLAGS) -MD
52e4ed3
  LIBC = msvcrt.lib
52e4ed3
- # CFLAGS = $(CFLAGS) $(cvarsdll)
52e4ed3
- # ! elseif defined(MULTITHREADED)
52e4ed3
- # LIBC = libcmt.lib
52e4ed3
- # CFLAGS = $(CFLAGS) $(cvarsmt)
52e4ed3
  ! else
52e4ed3
- # LIBC = libc.lib
52e4ed3
  LIBC = libcmt.lib
52e4ed3
! # CFLAGS = $(CFLAGS) $(cvars)
52e4ed3
  ! endif
52e4ed3
  !else  # DEBUG
52e4ed3
  VIM = vimd
52e4ed3
  CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
52e4ed3
  RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
52e4ed3
  # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
52e4ed3
! ! if "$(_NMAKE_VER)" == ""
52e4ed3
  LIBC =
52e4ed3
  ! else
52e4ed3
  LIBC = /fixed:no
52e4ed3
  ! endif
52e4ed3
  ! ifdef USE_MSVCRT
52e4ed3
! CFLAGS = $(CFLAGS) -MDd
52e4ed3
  LIBC = $(LIBC) msvcrtd.lib
52e4ed3
- # CFLAGS = $(CFLAGS) $(cvarsdll)
52e4ed3
- # ! elseif defined(MULTITHREADED)
52e4ed3
- # LIBC = $(LIBC) libcmtd.lib
52e4ed3
- # CFLAGS = $(CFLAGS) $(cvarsmt)
52e4ed3
  ! else
52e4ed3
- # LIBC = $(LIBC) libcd.lib
52e4ed3
  LIBC = $(LIBC) libcmtd.lib
52e4ed3
! # CFLAGS = $(CFLAGS) $(cvars)
52e4ed3
  ! endif
52e4ed3
  !endif # DEBUG
52e4ed3
  
52e4ed3
--- 391,430 ----
52e4ed3
  !else # MAXSPEED
52e4ed3
  OPTFLAG = /Ox
52e4ed3
  !endif
52e4ed3
+ !if "$(MSVCVER)" == "8.0"
52e4ed3
+ # Use link time code generation if not worried about size
52e4ed3
+ !if "$(OPTIMIZE)" != "SPACE"
52e4ed3
+ OPTFLAG = $(OPTFLAG) /GL
52e4ed3
+ !endif
52e4ed3
+ !endif
52e4ed3
  CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
52e4ed3
  RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
52e4ed3
  ! ifdef USE_MSVCRT
52e4ed3
! CFLAGS = $(CFLAGS) /MD
52e4ed3
  LIBC = msvcrt.lib
52e4ed3
  ! else
52e4ed3
  LIBC = libcmt.lib
52e4ed3
! CFLAGS = $(CFLAGS) /MT
52e4ed3
  ! endif
52e4ed3
  !else  # DEBUG
52e4ed3
  VIM = vimd
52e4ed3
+ ! if "$(CPU)" == "i386"
52e4ed3
+ DEBUGINFO = /ZI
52e4ed3
+ ! endif
52e4ed3
  CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
52e4ed3
  RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
52e4ed3
  # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
52e4ed3
! ! if "$(MSVCVER)" == "4.0"
52e4ed3
  LIBC =
52e4ed3
  ! else
52e4ed3
  LIBC = /fixed:no
52e4ed3
  ! endif
52e4ed3
  ! ifdef USE_MSVCRT
52e4ed3
! CFLAGS = $(CFLAGS) /MDd
52e4ed3
  LIBC = $(LIBC) msvcrtd.lib
52e4ed3
  ! else
52e4ed3
  LIBC = $(LIBC) libcmtd.lib
52e4ed3
! CFLAGS = $(CFLAGS) /MTd
52e4ed3
  ! endif
52e4ed3
  !endif # DEBUG
52e4ed3
  
52e4ed3
***************
52e4ed3
*** 681,696 ****
52e4ed3
  #
52e4ed3
  # Always generate the .pdb file, so that we get debug symbols that can be used
52e4ed3
  # on a crash (doesn't add overhead to the executable).
52e4ed3
  #
52e4ed3
! CFLAGS = $(CFLAGS) /Zi /Fd$(OUTDIR)/
52e4ed3
! LINK_PDB = /PDB:$(VIM).pdb -debug # -debug:full -debugtype:cv,fixup
52e4ed3
  
52e4ed3
  #
52e4ed3
  # End extra feature include
52e4ed3
  #
52e4ed3
  !message
52e4ed3
  
52e4ed3
! conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
52e4ed3
  
52e4ed3
  PATHDEF_SRC = $(OUTDIR)\pathdef.c
52e4ed3
  
52e4ed3
--- 727,744 ----
52e4ed3
  #
52e4ed3
  # Always generate the .pdb file, so that we get debug symbols that can be used
52e4ed3
  # on a crash (doesn't add overhead to the executable).
52e4ed3
+ # Generate edit-and-continue debug info when no optimization - allows to
52e4ed3
+ # debug more conveniently (able to look at variables which are in registers)
52e4ed3
  #
52e4ed3
! CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
52e4ed3
! LINK_PDB = /PDB:$(VIM).pdb -debug
52e4ed3
  
52e4ed3
  #
52e4ed3
  # End extra feature include
52e4ed3
  #
52e4ed3
  !message
52e4ed3
  
52e4ed3
! conflags = /nologo /subsystem:$(SUBSYSTEM)
52e4ed3
  
52e4ed3
  PATHDEF_SRC = $(OUTDIR)\pathdef.c
52e4ed3
  
52e4ed3
***************
52e4ed3
*** 702,712 ****
52e4ed3
  conflags = $(conflags) /map /mapinfo:lines
52e4ed3
  !ENDIF
52e4ed3
  
52e4ed3
! LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
52e4ed3
  LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB)  user32.lib $(SNIFF_LIB) \
52e4ed3
  		$(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
52e4ed3
  		$(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
52e4ed3
  
52e4ed3
  all:	$(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
52e4ed3
  		GvimExt/gvimext.dll
52e4ed3
  
52e4ed3
--- 750,769 ----
52e4ed3
  conflags = $(conflags) /map /mapinfo:lines
52e4ed3
  !ENDIF
52e4ed3
  
52e4ed3
! LINKARGS1 = $(linkdebug) $(conflags)
52e4ed3
  LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB)  user32.lib $(SNIFF_LIB) \
52e4ed3
  		$(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
52e4ed3
  		$(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
52e4ed3
  
52e4ed3
+ # Report link time code generation progress if used. 
52e4ed3
+ !ifdef NODEBUG
52e4ed3
+ !if "$(MSVCVER)" == "8.0"
52e4ed3
+ !if "$(OPTIMIZE)" != "SPACE"
52e4ed3
+ LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
52e4ed3
+ !endif
52e4ed3
+ !endif
52e4ed3
+ !endif
52e4ed3
+ 
52e4ed3
  all:	$(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
52e4ed3
  		GvimExt/gvimext.dll
52e4ed3
  
52e4ed3
***************
52e4ed3
*** 794,800 ****
52e4ed3
  
52e4ed3
  # Create a default rule for transforming .c files to .obj files in $(OUTDIR)
52e4ed3
  # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
52e4ed3
! !IF "$(_NMAKE_VER)" == ""
52e4ed3
  .c{$(OUTDIR)/}.obj:
52e4ed3
  !ELSE
52e4ed3
  .c{$(OUTDIR)/}.obj::
52e4ed3
--- 851,857 ----
52e4ed3
  
52e4ed3
  # Create a default rule for transforming .c files to .obj files in $(OUTDIR)
52e4ed3
  # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
52e4ed3
! !IF "$(MSVCVER)" == "4.0"
52e4ed3
  .c{$(OUTDIR)/}.obj:
52e4ed3
  !ELSE
52e4ed3
  .c{$(OUTDIR)/}.obj::
52e4ed3
***************
52e4ed3
*** 803,809 ****
52e4ed3
  
52e4ed3
  # Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
52e4ed3
  # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
52e4ed3
! !IF "$(_NMAKE_VER)" == ""
52e4ed3
  .cpp{$(OUTDIR)/}.obj:
52e4ed3
  !ELSE
52e4ed3
  .cpp{$(OUTDIR)/}.obj::
52e4ed3
--- 860,866 ----
52e4ed3
  
52e4ed3
  # Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
52e4ed3
  # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
52e4ed3
! !IF "$(MSVCVER)" == "4.0"
52e4ed3
  .cpp{$(OUTDIR)/}.obj:
52e4ed3
  !ELSE
52e4ed3
  .cpp{$(OUTDIR)/}.obj::
52e4ed3
*** ../vim-7.1.133/src/version.c	Wed Oct  3 12:49:24 2007
52e4ed3
--- src/version.c	Wed Oct  3 13:23:51 2007
52e4ed3
***************
52e4ed3
*** 668,669 ****
52e4ed3
--- 668,671 ----
52e4ed3
  {   /* Add new patch number below this line */
52e4ed3
+ /**/
52e4ed3
+     134,
52e4ed3
  /**/
52e4ed3
52e4ed3
-- 
52e4ed3
BLACK KNIGHT: The Black Knight always triumphs. Have at you!
52e4ed3
   ARTHUR takes his last leg off.  The BLACK KNIGHT's body lands upright.
52e4ed3
BLACK KNIGHT: All right, we'll call it a draw.
52e4ed3
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
52e4ed3
52e4ed3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
52e4ed3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
52e4ed3
\\\        download, build and distribute -- http://www.A-A-P.org        ///
52e4ed3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///