Re: VC8 makefile patch

2007-01-22 Thread Mike Williams

Hi Mathias.

On 20/01/2007 11:48, Mathias Michaelis wrote:

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.


I didn't think the Express version of the compilers supported optimized 
code generation.  And I am surprised VCExpress comes without nmake.


 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.


Ah, that would be a problem.


   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.


I don't believe this is the case.  For my install of VC8 there is no 
MSVCVER variable defined.  Could this may be a feature of VCExpress?



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.


I was afraid this might happen.


   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.


Indeed there was.  I think its _NMAKE_VER value is 7.10.3077.


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?).


So there are now two issues.  Non-SDK build environments don't have 
MSVCVER variable, while SDK build environments have version numbers that 
can be out of synch with the version of Visual C.  It would be nice to 
keep the makefile handle its environment automatically without 
developers having to define variables to get it to build out of the 
box.  Perhaps it should first check for MSVCVER and if not defined 
fallback on _NMAKE_VER.  Thoughts?



Best regards and thanks again for this patch


No problems.  As ever, every new solution generates new problems.

Mike
--
Don't pick up that pho++Abe+++f NO CARRIER


Re: VC8 makefile patch

2007-01-22 Thread Mike Williams

Hi again,

Attached is a new version of the VC makefile that uses MSVCVER if 
defined or derives a value from nmake.  This should allow the file to be 
used straight from a source download without any environment variables 
having to be set.


If anyone has other values for _NMAKE_VER (just run nmake with no args 
and it will be on the first line where the MS version is reported), can 
they report them along with which version (and any service packs 
applied) of VC they are using.


Enjoy.

Mike
--
Computer malfunction, nut loose in operator's chair.
*** Make_mvc.mak.orig   Wed Apr 26 10:30:22 2006
--- Make_mvc.makMon Jan 22 13:59:43 2007
***
*** 92,97 
--- 92,99 
  #   Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
  #   doesn't work)
  #
+ #   Visual C Version: MSVCVER=m.n (default derived from nmake if 
undefined)
+ #
  # You can combine any of these interfaces
  #
  # Example: To build the non-debug, GUI version with Perl interface:
***
*** 320,326 
--- 322,362 
  INTDIR=$(OBJDIR)
  OUTDIR=$(OBJDIR)
  
+ # Derive version of VC being used from nmake if not specified
+ !if $(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.10.3077
+ MSVCVER = 7.1
+ !endif
+ !if $(_NMAKE_VER) == 8.00.50727.42
+ MSVCVER = 8.0
+ !endif
+ !endif
+ 
+ # Abort bulding VIM if version of VC is unrecognised.
+ !ifndef MSVCVER
+ !message *** ERROR
+ !message Cannot determine Visual C version being used.  If you are using the
+ !message Windows SDK then you must have the environment variable MSVCVER set 
to
+ !message your version of the VC compiler.  If you are not using the Express
+ !message version of Visual C you van either set MSVCVER or update this 
makefile
+ !message to handle the new value for _NMAKE_VER.
+ !error Make aborted.
+ !endif
+ 
  # Convert processor ID to MVC-compatible number
+ !if $(MSVCVER) != 8.0
  !if $(CPUNR) == i386
  CPUARG = /G3
  !elseif $(CPUNR) == i486
***
*** 334,339 
--- 370,381 
  !else
  CPUARG =
  !endif
+ !else
+ # VC8 only allows specifying SSE architecture
+ !if $(CPUNR) == pentium4
+ CPUARG = /arch:SSE2
+ !endif
+ !endif
  
  !ifdef NODEBUG
  VIM = vim
***
*** 344,349 
--- 386,397 
  !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
--- 411,417 
  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 
--- 755,769 
$(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::
--- 852,858 
  
  # 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::
--- 861,867 
  
  # 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::


Re: VC8 makefile patch

2007-01-20 Thread Mathias Michaelis
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.0 +0200
--- src\Make_mvc.mak2007-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
  

Re: VC8 makefile patch

2007-01-20 Thread Mathias Michaelis
Hi again!

I have realised that on my laptop that I am using at work there is a
nmake version 6.00.9782.0 which isn't in the version list of your
make_mvc.mak patch. I therefore definitively suggest to omit this
version list an relay solely on the MSVCVer environment variable
which should be defined since VC tool chain version 7.0. One can
force the user to define this variable with an !error directive or
one can utilize version 6.0 as standard. This may be a matter of taste.

Therefore, I suggest the patch that is attached to this email.

With kind regards

Mathias
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.0 +0200
--- src\Make_mvc.mak2007-01-20 20:29:44.430628800 +0100
***
*** 320,326 
--- 320,334 
  INTDIR=$(OBJDIR)
  OUTDIR=$(OBJDIR)
  
+ # We must know the version of the visual C tool chain.
+ !ifndef MSVCVER
+ !message Environment variable MSVCVer not defined. Please set it to the 
version of your
+ !message visual C tool chain. Possible values are 4.0, 5.0, 6.0, 7.0, 7.1 and 
8.0.
+ !error Environment variable MSVCVer is undefined!
+ !endif
+ 
  # Convert processor ID to MVC-compatible number
+ !if $(MSVCVER) != 8.0
  !if $(CPUNR) == i386
  CPUARG = /G3
  !elseif $(CPUNR) == i486
***
*** 334,339 
--- 342,353 
  !else
  CPUARG =
  !endif
+ !else
+ # VC8 only allows specifying SSE architecture
+ !if $(CPUNR) == pentium4
+ CPUARG = /arch:SSE2
+ !endif
+ !endif
  
  !ifdef NODEBUG
  VIM = vim
***
*** 344,349 
--- 358,369 
  !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
--- 383,389 
  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 
--- 727,741 
$(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::
--- 824,830 
  
  # 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::
--- 833,839 
  
  # 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::


Re: VC8 makefile patch

2007-01-19 Thread Mike Williams

On 18/01/2007 20:55, Bram Moolenaar wrote:

Mike Williams wrote:

Attached is a patch to use VC8 specific optimization options.  FTR, VC8 
no longer supports the /Gn processor code generation directive, and the 
makefile now uses link time code generation when not optimizing for space.

Although MS keeps changing the arguments, the new ones mostly get used
again in future versions.  Thus this check:

 + !if $(_NMAKE_VER) != 8.00.50727.42

Should probably check if the version is greater than or smaller than
this specific number.  At least do the comparing with this specific
number once and pass the result to further ifs.
Proposal #2 - now derives VC version from _NMAKE_VER.  Updated a couple 
of checks for VC4 so the file is a bit more more self documenting.


Thanks, looks much better.

I wonder what  actually does.  Is it a textual compare?  Perhaps you
can try out if using  or  works to avoid these magic build
numbers.  Some people must have different builds (otherwise they
wouldn't include these numbers, right?).


The doc states that strings should be compared with == and != but 
empirically (at least with VC8 ;-) ) the ordering relational operators 
seem to work.  It is possible they don't in older versions, in which 
case they would need to be the equality operators only.  Perhaps those 
with VC4/5/6/7 can try out the patch and see if it works or not.


The numbers identify specific versions of VC.  I believe early releases 
(MS's CTP, public betas etc.) have different numbers but I cannot find 
any reference list to discern a definitive pattern.


HTH

Mike
--
If you're trying to drive me crazy, you're too late!


Re: VC8 makefile patch

2007-01-18 Thread Mike Williams

On 17/01/2007 19:44, Bram Moolenaar wrote:

Mike Williams wrote:

Attached is a patch to use VC8 specific optimization options.  FTR, VC8 
no longer supports the /Gn processor code generation directive, and the 
makefile now uses link time code generation when not optimizing for space.


Although MS keeps changing the arguments, the new ones mostly get used
again in future versions.  Thus this check:

 + !if $(_NMAKE_VER) != 8.00.50727.42

Should probably check if the version is greater than or smaller than
this specific number.  At least do the comparing with this specific
number once and pass the result to further ifs.


Proposal #2 - now derives VC version from _NMAKE_VER.  Updated a couple 
of checks for VC4 so the file is a bit more more self documenting.


Enjoy.

Mike
--
Barnum was wrong... it's more like every thirty seconds.
*** Make_mvc.mak.orig   Wed Apr 26 10:30:22 2006
--- Make_mvc.makThu Jan 18 11:07:26 2007
***
*** 320,326 
--- 320,348 
  INTDIR=$(OBJDIR)
  OUTDIR=$(OBJDIR)
  
+ # Derive version of VC being used
+ !if $(_NMAKE_VER) == 
+ VC_VER = 4
+ !endif
+ !if $(_NMAKE_VER) == 162
+ VC_VER = 5
+ !endif
+ !if $(_NMAKE_VER) == 6.00.8168.0
+ VC_VER = 6
+ !endif
+ !if $(_NMAKE_VER) == 7.00.9466
+ VC_VER = 7
+ !endif
+ !if $(_NMAKE_VER) == 8.00.50727.42
+ VC_VER = 8
+ !endif
+ # Default to VC6 (arbitrarily) if unknown
+ !ifndef VC_VER
+ VC_VER = 6
+ !endif
+ 
  # Convert processor ID to MVC-compatible number
+ !if $(VC_VER)  8
  !if $(CPUNR) == i386
  CPUARG = /G3
  !elseif $(CPUNR) == i486
***
*** 334,339 
--- 356,367 
  !else
  CPUARG =
  !endif
+ !else
+ # VC8 only allows specifying SSE architecture
+ !if $(CPUNR) == pentium4
+ CPUARG = /arch:SSE2
+ !endif
+ !endif
  
  !ifdef NODEBUG
  VIM = vim
***
*** 344,349 
--- 372,383 
  !else # MAXSPEED
  OPTFLAG = /Ox
  !endif
+ !if $(VC_VER) = 8
+ # 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
--- 397,403 
  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 $(VC_VER) == 4
  LIBC =
  ! else
  LIBC = /fixed:no
***
*** 707,712 
--- 741,755 
$(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 $(VC_VER) = 8
+ !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::
--- 838,844 
  
  # 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 $(VC_VER) == 4
  .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::
--- 847,853 
  
  # 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 $(VC_VER) == 4
  .cpp{$(OUTDIR)/}.obj:
  !ELSE
  .cpp{$(OUTDIR)/}.obj::


Re: VC8 makefile patch

2007-01-18 Thread A.J.Mechelynck

Mike Williams wrote:

On 17/01/2007 19:44, Bram Moolenaar wrote:

Mike Williams wrote:

Attached is a patch to use VC8 specific optimization options.  FTR, 
VC8 no longer supports the /Gn processor code generation directive, 
and the makefile now uses link time code generation when not 
optimizing for space.


Although MS keeps changing the arguments, the new ones mostly get used
again in future versions.  Thus this check:

 + !if $(_NMAKE_VER) != 8.00.50727.42

Should probably check if the version is greater than or smaller than
this specific number.  At least do the comparing with this specific
number once and pass the result to further ifs.


Proposal #2 - now derives VC version from _NMAKE_VER.  Updated a couple 
of checks for VC4 so the file is a bit more more self documenting.


Enjoy.

Mike



...sorry, my mailer shows the patches inline but doesn't quote them on reply.

Rather than testing for specific strings, couldn't you just use the first 
digit(s) of _NMAKE_VER as the version number if followed by a period? Or 
doesn't the make evaluation syntax allow for that? (I suppose if someday the 
version string becomes, let's say, 9.05.77643.25 we should take this as 
meaning version 9 rather than default to version 6 don't you think?)


Best regards,
Tony.


Re: VC8 makefile patch

2007-01-18 Thread Bram Moolenaar

Mike Williams wrote:

  Attached is a patch to use VC8 specific optimization options.  FTR, VC8 
  no longer supports the /Gn processor code generation directive, and the 
  makefile now uses link time code generation when not optimizing for space.
  
  Although MS keeps changing the arguments, the new ones mostly get used
  again in future versions.  Thus this check:
  
   + !if $(_NMAKE_VER) != 8.00.50727.42
  
  Should probably check if the version is greater than or smaller than
  this specific number.  At least do the comparing with this specific
  number once and pass the result to further ifs.
 
 Proposal #2 - now derives VC version from _NMAKE_VER.  Updated a couple 
 of checks for VC4 so the file is a bit more more self documenting.

Thanks, looks much better.

I wonder what  actually does.  Is it a textual compare?  Perhaps you
can try out if using  or  works to avoid these magic build
numbers.  Some people must have different builds (otherwise they
wouldn't include these numbers, right?).

-- 
You have the right to remain silent. Anything you say will be
misquoted, then used against you.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


VC8 makefile patch

2007-01-17 Thread Mike Williams

Hi,

Attached is a patch to use VC8 specific optimization options.  FTR, VC8 
no longer supports the /Gn processor code generation directive, and the 
makefile now uses link time code generation when not optimizing for space.


Enjoy.

Mike
--
If space is a vacuum, who changes the bags?
*** Make_mvc.mak.orig   Wed Apr 26 10:30:22 2006
--- Make_mvc.makWed Jan 17 13:48:57 2007
***
*** 321,326 
--- 321,327 
  OUTDIR=$(OBJDIR)
  
  # Convert processor ID to MVC-compatible number
+ !if $(_NMAKE_VER) != 8.00.50727.42
  !if $(CPUNR) == i386
  CPUARG = /G3
  !elseif $(CPUNR) == i486
***
*** 334,339 
--- 335,346 
  !else
  CPUARG =
  !endif
+ !else
+ # VC8 only allows specifying SSE architecture
+ !if $(CPUNR) == pentium4
+ CPUARG = /arch:SSE2
+ !endif
+ !endif
  
  !ifdef NODEBUG
  VIM = vim
***
*** 344,349 
--- 351,362 
  !else # MAXSPEED
  OPTFLAG = /Ox
  !endif
+ # Use link time code generation in VC8 if not worried about size
+ !if $(_NMAKE_VER) == 8.00.50727.42
+ !if $(OPTIMIZE) != SPACE
+ OPTFLAG = $(OPTFLAG) /GL
+ !endif
+ !endif
  CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
  RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
  ! ifdef USE_MSVCRT
***
*** 706,711 
--- 719,733 
  LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB)  user32.lib $(SNIFF_LIB) 
\
$(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 $(_NMAKE_VER) == 8.00.50727.42
+ !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


Re: VC8 makefile patch

2007-01-17 Thread A.J.Mechelynck

Mike Williams wrote:

Hi,

Attached is a patch to use VC8 specific optimization options.  FTR, VC8 
no longer supports the /Gn processor code generation directive, and the 
makefile now uses link time code generation when not optimizing for space.


Enjoy.

Mike



Why the test on !if $(_NMAKE_VER) == 8.00.50727.42 ? Are you sure the old 
behaviour will be the right thing to do with _any_ older _or_ newer version? 
Shouldn't we rather assume that versions 8.0 or later of MSVC will require 
the new arguments? We should provide as best as we can for future versions, to 
avoid, if possible, the need for constant re-patching of the makefile with 
every new version that Gates  Co will decide to publish.



Best regards,
Tony


Re: VC8 makefile patch

2007-01-17 Thread Mike Williams

On 17/01/2007 15:09, A.J.Mechelynck wrote:

Mike Williams wrote:

Hi,

Attached is a patch to use VC8 specific optimization options.  FTR, VC8 
no longer supports the /Gn processor code generation directive, and the 
makefile now uses link time code generation when not optimizing for space.


Enjoy.

Mike



Why the test on !if $(_NMAKE_VER) == 8.00.50727.42 ? Are you sure the old 
behaviour will be the right thing to do with _any_ older _or_ newer version? 
Shouldn't we rather assume that versions 8.0 or later of MSVC will require 
the new arguments? We should provide as best as we can for future versions, to 
avoid, if possible, the need for constant re-patching of the makefile with 
every new version that Gates  Co will decide to publish.


The comparison operators can be made relative if desired.  It is normal 
for any new VC compiler to review compiler options and update any build 
scripts.  VC8 retired, deprecated, and added a large number of 
compiler/linker options.  There is nothing to say future versions wont 
do the same.  To have a build script use minimal options for an 
unrecognised compiler version is reasonable - as long as it reports that 
this is the case.


Mike
--
Do you think that you're right and I'm wrong? How naive if you do...


Re: VC8 makefile patch

2007-01-17 Thread Bram Moolenaar

Mike Williams wrote:

 Attached is a patch to use VC8 specific optimization options.  FTR, VC8 
 no longer supports the /Gn processor code generation directive, and the 
 makefile now uses link time code generation when not optimizing for space.

Although MS keeps changing the arguments, the new ones mostly get used
again in future versions.  Thus this check:

 + !if $(_NMAKE_VER) != 8.00.50727.42

Should probably check if the version is greater than or smaller than
this specific number.  At least do the comparing with this specific
number once and pass the result to further ifs.

-- 
Q. What happens to programmers when they die?
A: MS-Windows programmers are reinstalled.  C++ programmers become undefined,
   anyone who refers to them will die as well.  Java programmers reincarnate
   after being garbage collected.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///