git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] Enable compilation by Makefile for the MSVC toolchain

From
Marius Storm-Olsen <marius@storm-olsen.com>
Date
Aug 18, 2009, 17:55 UTC
Message-ID
<4A8AEAF5.6070205@gmail.com>
In-Reply-To
<alpine.DEB.1.00.0908181605370.4680@intel-tinevez-2-302>
Johannes Schindelin said the following on 18.08.2009 16:11:
Show 11 quoted lines
> On Tue, 18 Aug 2009, Marius Storm-Olsen wrote:
>> So, instead of rely on these vcproj files which *will* go stale, we
>> can simply use the same Makefile system which everyone else is
>> using. :) After all, we're just compiling with a different
>> compiler. The end result will still rely on the *msysGit
>> environment* to function, so we already require it. Thus, GNU Make
>> is present, and we can use it.
> 
> We can also use sed or perl to generate/modify the .vcproj files, or
> run CMake (once Pau got it to build), and package the stuff using zip
> (once I got that to build).

Really? That would be some script being able to parse the Makefile, and create something reasonable as a vcproj script :) Keeping all the options in sync, conditional files/libs, all the various end executables (a separate .vcproj for each of them, and a solution file (.sln)to tie them all together into a .. "solution", a complete product blah blah blah) etc.

Just using the (GNU) Makefile as the 'default' way of compiling with MSVC seems to be the most reasonable to me. Then we could just have a contrib/vc/msvc2008.vcproj which someone can update when they feel like it. The default way should be hard to get out-of-sync, IMO.

>> diff --git a/Makefile b/Makefile
>> +ifneq (,$(findstring Microsoft Visual Studio, $(INCLUDE)))
...
Show 6 quoted lines
>> +else
>>  ifneq (,$(findstring MINGW,$(uname_S)))
>>  	pathsep = ;
>>  	NO_PREAD = YesPlease
> 
> This means that gcc is never used when Visual C++ is available?  Hmm.

Yes it does :) First, "This implementation is a quick hack to make it compile", so it was all about just making it compile, not being 100% correct. There are still some warnings and options which shouldn't be passed on to cl, so it's by no means complete. Second, having MSVC include paths in INCLUDE when you're compiling with MinGW would be plain wrong. I could use LIB instead, which would be even wronger ;) I was actually going to replace it with a USE_MSVC variable check instead though, so you'd rather do 'make USE_MSVC=1'

Show 15 quoted lines
>> diff --git a/compat/msvc.h b/compat/msvc.h
>> index 6071565..a9d5f7f 100644
>> --- a/compat/msvc.h
>> +++ b/compat/msvc.h
>> @@ -10,50 +10,120 @@
>>  
>>  /*Configuration*/
>>  
>> +#ifndef NO_PREAD
>>  #define NO_PREAD
>> +#endif
> 
> Why?  You now have the stuff in two places.  If you want to keep them in 
> compat/msvc.h to be able to generate .vcproj files, I'd rather not have 
> them duplicated in the Makefile.

The changes to the msvc.h where added just keep Frank's vcproj project working. I would have just nuked all that stuff in the msvc.h since the Makefile would just provide it for me anyways..

-- .marius

Previous: Johannes SchindelinNext: Daniel Barkalow
Message 38 of 91 in “Add miss git-compat-util.h at regex.c and fnmatch.c Add git-compat-util.h to enable build at MSVC environment”
  1. 06/11 Add miss git-compat-util.h at regex.c and fnmatch.c Add git-compat-util.h to enable build at MSVC environmentFrank Li, Aug 17, 2009
  2. 07/11 Add O_BINARY flag to open flag at mingw.cFrank Li, Aug 17, 2009
  3. 08/11 Place __stdcall to correct position.Frank Li, Aug 17, 2009
  4. 09/11 Add MSVC porting header files.Frank Li, Aug 17, 2009
  5. 10/11 Add MSVC Project fileFrank Li, Aug 17, 2009
  6. Johannes SchindelinAug 17, 2009
  7. Paolo BonziniAug 17, 2009
  8. Erik Faye-LundAug 17, 2009
  9. Paolo BonziniAug 17, 2009
  10. Johannes SchindelinAug 17, 2009
  11. Paolo BonziniAug 17, 2009
  12. Johannes SchindelinAug 17, 2009
  13. Pau Garcia i QuilesAug 17, 2009
  14. Reece DunnAug 17, 2009
  15. Pau Garcia i QuilesAug 17, 2009
  16. Reece DunnAug 17, 2009
  17. Johan 't HartAug 17, 2009
  18. Johannes SchindelinAug 17, 2009
  19. Pau Garcia i QuilesAug 17, 2009
  20. Johannes SchindelinAug 17, 2009
  21. Pau Garcia i QuilesAug 17, 2009
  22. Paolo BonziniAug 17, 2009
  23. Thiago FarinaAug 17, 2009
  24. Thiago FarinaAug 17, 2009
  25. Johannes SchindelinAug 17, 2009
  26. Pau Garcia i QuilesAug 17, 2009
  27. Johannes SchindelinAug 17, 2009
  28. Johan 't HartAug 17, 2009
  29. Pau Garcia i QuilesAug 17, 2009
  30. Johannes SchindelinAug 17, 2009
  31. Pau Garcia i QuilesAug 17, 2009
  32. [RFC] Enable compilation by Makefile for the MSVC toolchainMarius Storm-Olsen, Aug 18, 2009
  33. Marius Storm-OlsenAug 18, 2009
  34. Erik Faye-LundAug 18, 2009
  35. Johannes SchindelinAug 18, 2009
  36. Pau Garcia i QuilesAug 18, 2009
  37. Johannes SchindelinAug 18, 2009
  38. Marius Storm-OlsenAug 18, 2009
  39. Daniel BarkalowAug 18, 2009
  40. Johannes SchindelinAug 18, 2009
  41. Johannes SchindelinAug 19, 2009
  42. Johan 't HartAug 18, 2009
  43. Reece DunnAug 18, 2009
  44. Pau Garcia i QuilesAug 18, 2009
  45. Paolo BonziniAug 18, 2009
  46. Junio C HamanoAug 18, 2009
  47. Marius Storm-OlsenAug 18, 2009
  48. Johan 't HartAug 18, 2009
  49. Marius Storm-OlsenAug 18, 2009
  50. Johannes SchindelinAug 18, 2009
  51. Erik Faye-LundAug 18, 2009
  52. Johannes SchindelinAug 18, 2009
  53. Erik Faye-LundAug 18, 2009
  54. Johannes SchindelinAug 19, 2009
  55. Marius Storm-OlsenAug 19, 2009
  56. Johannes SchindelinAug 19, 2009
  57. Thomas BergAug 19, 2009
  58. Marius Storm-OlsenAug 19, 2009
  59. Johannes SchindelinAug 19, 2009
  60. Marius Storm-OlsenAug 19, 2009
  61. Erik Faye-LundAug 19, 2009
  62. Joshua JensenAug 19, 2009
  63. Daniel BarkalowAug 18, 2009
  64. Marius Storm-OlsenAug 18, 2009
  65. Thiago FarinaAug 17, 2009
  66. Thiago FarinaAug 17, 2009
  67. Johannes SchindelinAug 17, 2009
  68. Thiago FarinaAug 17, 2009
  69. Johannes SchindelinAug 17, 2009
  70. Pau Garcia i QuilesAug 17, 2009
  71. CMake, was Re: [PATCH 09/11] Add MSVC porting header files.Johannes Schindelin, Aug 17, 2009
  72. Pau Garcia i QuilesAug 17, 2009
  73. Pau Garcia i QuilesAug 17, 2009
  74. Johannes SchindelinAug 17, 2009
  75. Pau Garcia i QuilesAug 17, 2009
  76. Reece DunnAug 17, 2009
  77. Pau Garcia i QuilesAug 17, 2009
  78. Johannes SixtAug 17, 2009
  79. Frank LiAug 18, 2009
  80. Johannes SchindelinAug 18, 2009
  81. Junio C HamanoAug 18, 2009
  82. Johannes SchindelinAug 18, 2009
  83. Johannes SixtAug 17, 2009
  84. Johannes SchindelinAug 17, 2009
  85. Frank LiAug 18, 2009
  86. Johannes SchindelinAug 18, 2009
  87. Johannes SchindelinAug 17, 2009
  88. Frank LiAug 18, 2009
  89. Johannes SchindelinAug 18, 2009
  90. Johannes SchindelinAug 17, 2009
  91. Johannes SixtAug 17, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.