# [PATCH 2/2] Modify MSVC wrapper script

4 messages from 2010-07-05 to 2010-07-06. Participants: Peter Harris, Johannes Sixt, Johannes Schindelin.
Thread: https://gitlist.dev/t/24296

## Peter Harris, 2010-07-05 19:41

Subject: [PATCH 1/2] Fix MSVC build
Message-ID: <1278358897-488-1-git-send-email-pharris@opentext.com>
URL: https://gitlist.dev/e/1278358897-488-1-git-send-email-pharris%40opentext.com

```
Signed-off-by: Peter Harris <pharris@opentext.com>
---
 compat/mingw.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/compat/mingw.h b/compat/mingw.h
index 8104039..08fea02 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -14,11 +14,13 @@ typedef int uid_t;
 #define S_ISSOCK(x) 0
 
 #ifndef _STAT_H_
+#ifndef S_IRUSR
 #define S_IRUSR 0
 #define S_IWUSR 0
 #define S_IXUSR 0
 #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
 #endif
+#endif
 #define S_IRGRP 0
 #define S_IWGRP 0
 #define S_IXGRP 0
-- 
1.7.1.msysgit.0.4.gea744.MSVC

```

## Peter Harris, 2010-07-05 19:41

Subject: [PATCH 2/2] Modify MSVC wrapper script
Message-ID: <1278358897-488-2-git-send-email-pharris@opentext.com>
URL: https://gitlist.dev/e/1278358897-488-2-git-send-email-pharris%40opentext.com
In-Reply-To: <1278358897-488-1-git-send-email-pharris@opentext.com>

```
This reduces warnings, and supports additional linker
flags (such as -DEBUG and -MAP)

Signed-off-by: Peter Harris <pharris@opentext.com>
---
 Makefile                        |    1 +
 compat/vcbuild/scripts/clink.pl |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 7134509..d4fd4b0 100644
--- a/Makefile
+++ b/Makefile
@@ -1073,6 +1073,7 @@ ifndef DEBUG
 	AR += -LTCG
 else
 	BASIC_CFLAGS += -Zi -MTd
+	BASIC_LDFLAGS = -DEBUG -MAP
 endif
 	X = .exe
 endif
diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl
index 4374771..3f51886 100644
--- a/compat/vcbuild/scripts/clink.pl
+++ b/compat/vcbuild/scripts/clink.pl
@@ -12,10 +12,14 @@
 use strict;
 my @args = ();
 my @cflags = ();
+my @lflags = ();
 my $is_linking = 0;
+my %linkflag = ( '-DEBUG' => 1, '-MAP' => 1 );
 while (@ARGV) {
 	my $arg = shift @ARGV;
-	if ("$arg" =~ /^-[DIMGO]/) {
+	if ($linkflag{$arg}) {
+		push(@lflags, $arg);
+	} elsif ("$arg" =~ /^-[DIMGOWZ]/) {
 		push(@cflags, $arg);
 	} elsif ("$arg" eq "-o") {
 		my $file_out = shift @ARGV;
@@ -44,6 +48,7 @@ while (@ARGV) {
 }
 if ($is_linking) {
 	unshift(@args, "link.exe");
+	push(@args, @lflags);
 } else {
 	unshift(@args, "cl.exe");
 	push(@args, @cflags);
-- 
1.7.1.msysgit.0.4.gea744.MSVC

```

## Johannes Sixt, 2010-07-06 05:55

Subject: Re: [PATCH 1/2] Fix MSVC build
Message-ID: <4C32C53C.8020105@viscovery.net>
URL: https://gitlist.dev/e/4C32C53C.8020105%40viscovery.net
In-Reply-To: <1278358897-488-1-git-send-email-pharris@opentext.com>

```
Am 7/5/2010 21:41, schrieb Peter Harris:
> Signed-off-by: Peter Harris <pharris@opentext.com>
> ---
>  compat/mingw.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/compat/mingw.h b/compat/mingw.h
> index 8104039..08fea02 100644
> --- a/compat/mingw.h
> +++ b/compat/mingw.h
> @@ -14,11 +14,13 @@ typedef int uid_t;
>  #define S_ISSOCK(x) 0
>  
>  #ifndef _STAT_H_
> +#ifndef S_IRUSR
>  #define S_IRUSR 0
>  #define S_IWUSR 0
>  #define S_IXUSR 0
>  #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
>  #endif
> +#endif
>  #define S_IRGRP 0
>  #define S_IWGRP 0
>  #define S_IXGRP 0

This doesn't apply: I don't see the #ifndef _STAT_H_ brackets anywhere in
my version of compat/mingw.h.

-- Hannes

```

## Johannes Schindelin, 2010-07-06 10:12

Subject: Re: [msysGit] Re: [PATCH 1/2] Fix MSVC build
Message-ID: <alpine.DEB.1.00.1007061211590.2326@intel-tinevez-2-302>
URL: https://gitlist.dev/e/alpine.DEB.1.00.1007061211590.2326%40intel-tinevez-2-302
In-Reply-To: <4C32C53C.8020105@viscovery.net>

```
Hi,

On Tue, 6 Jul 2010, Johannes Sixt wrote:

> Am 7/5/2010 21:41, schrieb Peter Harris:
> > Signed-off-by: Peter Harris <pharris@opentext.com>
> > ---
> >  compat/mingw.h |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/compat/mingw.h b/compat/mingw.h
> > index 8104039..08fea02 100644
> > --- a/compat/mingw.h
> > +++ b/compat/mingw.h
> > @@ -14,11 +14,13 @@ typedef int uid_t;
> >  #define S_ISSOCK(x) 0
> >  
> >  #ifndef _STAT_H_
> > +#ifndef S_IRUSR
> >  #define S_IRUSR 0
> >  #define S_IWUSR 0
> >  #define S_IXUSR 0
> >  #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
> >  #endif
> > +#endif
> >  #define S_IRGRP 0
> >  #define S_IWGRP 0
> >  #define S_IXGRP 0
> 
> This doesn't apply: I don't see the #ifndef _STAT_H_ brackets anywhere in
> my version of compat/mingw.h.

Obviously, this is a patch against 4msysgit's devel branch.

Hth,
Dscho

```
