git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix MSVC build on cygwin
@ 2009-10-08 15:21 Ramsay Jones
  2009-10-08 18:40 ` Johannes Schindelin
  2009-10-09  6:48 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Ramsay Jones @ 2009-10-08 15:21 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: mstormo, GIT Mailing-list


In the MSVC section of the Makefile, BASIC_CFLAGS is set to a
value which contains the string "-DWIN32-D_CONSOLE". This results
in a (single) malformed -Define being passed to the compiler.
At least on my cygwin installation, the msvc compiler seems to
ignore this parameter, without issuing an error or warning, and
results in the WIN32 and _CONSOLE macros being undefined. This
breaks the build.

In order to fix the build, we simply insert a space between the
two -Define parameters, "-DWIN32" and "-D_CONSOLE", as originally
intended.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

Hi *,

The original version of this patch used line-continuation to
wrap the over-long lines in the MSVC section. (the lines that
set up BASIC_CFLAGS, COMPAT_CFLAGS and BASIC_LDFLAGS.)
However, that somewhat obscured the important change in this
patch (and some people don't find line-continuation easier to
read anyway ;-).

ATB,
Ramsay Jones

 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 12defd4..ae9bb03 100644
--- a/Makefile
+++ b/Makefile
@@ -914,7 +914,7 @@ ifdef MSVC
 	CC = compat/vcbuild/scripts/clink.pl
 	AR = compat/vcbuild/scripts/lib.pl
 	CFLAGS =
-	BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32-D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
+	BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
 	COMPAT_OBJS = compat/msvc.o compat/fnmatch/fnmatch.o compat/winansi.o
 	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/fnmatch -Icompat/regex -Icompat/fnmatch -DSTRIP_EXTENSION=\".exe\"
 	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
-- 
1.6.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix MSVC build on cygwin
  2009-10-08 15:21 [PATCH] Fix MSVC build on cygwin Ramsay Jones
@ 2009-10-08 18:40 ` Johannes Schindelin
  2009-10-08 18:50   ` Sverre Rabbelier
  2009-10-09  6:48 ` Junio C Hamano
  1 sibling, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2009-10-08 18:40 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, mstormo, GIT Mailing-list

Hi,

On Thu, 8 Oct 2009, Ramsay Jones wrote:

> Hi *,

I thought we only used shell patterns for filenames, and regexes for 
everything else?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix MSVC build on cygwin
  2009-10-08 18:40 ` Johannes Schindelin
@ 2009-10-08 18:50   ` Sverre Rabbelier
  0 siblings, 0 replies; 5+ messages in thread
From: Sverre Rabbelier @ 2009-10-08 18:50 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Ramsay Jones, Junio C Hamano, mstormo, GIT Mailing-list

Heya,

On Thu, Oct 8, 2009 at 20:40, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> I thought we only used shell patterns for filenames, and regexes for
> everything else?

Maybe he's enacting a long silence after his Hi? "Hi                       "?

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix MSVC build on cygwin
  2009-10-08 15:21 [PATCH] Fix MSVC build on cygwin Ramsay Jones
  2009-10-08 18:40 ` Johannes Schindelin
@ 2009-10-09  6:48 ` Junio C Hamano
  2009-10-09 21:53   ` Ramsay Jones
  1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2009-10-09  6:48 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: mstormo, GIT Mailing-list

Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:

> In the MSVC section of the Makefile, BASIC_CFLAGS is set to a
> value which contains the string "-DWIN32-D_CONSOLE". This results
> in a (single) malformed -Define being passed to the compiler.
> At least on my cygwin installation, the msvc compiler seems to
> ignore this parameter, without issuing an error or warning, and
> results in the WIN32 and _CONSOLE macros being undefined. This
> breaks the build.
>
> In order to fix the build, we simply insert a space between the
> two -Define parameters, "-DWIN32" and "-D_CONSOLE", as originally
> intended.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>

Thanks; that's quite a detailed description to explain why -DFOO-DBAR is
bad when -DFOO -DBAR was wanted ;-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix MSVC build on cygwin
  2009-10-09  6:48 ` Junio C Hamano
@ 2009-10-09 21:53   ` Ramsay Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Ramsay Jones @ 2009-10-09 21:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: mstormo, GIT Mailing-list

Junio C Hamano wrote:
> Thanks; that's quite a detailed description to explain why -DFOO-DBAR is
> bad when -DFOO -DBAR was wanted ;-)

Heh, yeah I usually have the opposite problem; often I can't spare any
words past the one-line summary...

I suspect the unusual verbosity won't last... ;-)

ATB,
Ramsay Jones

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-10 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-08 15:21 [PATCH] Fix MSVC build on cygwin Ramsay Jones
2009-10-08 18:40 ` Johannes Schindelin
2009-10-08 18:50   ` Sverre Rabbelier
2009-10-09  6:48 ` Junio C Hamano
2009-10-09 21:53   ` Ramsay Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).