On Tue, 27 Feb 2018 11:43:34 +0100
Magnus Hagander <mag...@hagander.net> wrote:


> I'm unsure why this was introduced in 9.5 and earlier, but not in the
> newer ones.  This smells like a possible backpatch mistake, in which
> case that part should probably be backed out of the old branches
> rather than teaching mkvcbuild about it.

Patch for Mkvcbuild.pm is actually quite simple (see attach).

Really, I have more complicated patch, which supports recursive
substitution as gmake does. It was developed to simplify inclusion of
PGXS extensions into contrib tree. (authors of modern extension often
use complex Makefile constructs).

I've not presented it to community because I hoped that current MSVC
build system would be soon replaced by cmake.

-- 


diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
old mode 100644
new mode 100755
index 2e19aa7035..2bd506bb90
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -686,6 +686,8 @@ sub mkvcbuild
 
 	$mf = Project::read_file('src\bin\scripts\Makefile');
 	$mf =~ s{\\s*[\r\n]+}{}mg;
+	$mf =~ m{SCRIPTS_COMMON\s*=\s*(.*)$}m;
+	my @common_files = split /\s+/, $1;
 	$mf =~ m{PROGRAMS\s*=\s*(.*)$}m
 	  || die 'Could not match in bin\scripts\Makefile' . "\n";
 	foreach my $prg (split /\s+/, $1)
@@ -694,6 +696,7 @@ sub mkvcbuild
 		$mf =~ m{$prg\s*:\s*(.*)$}m
 		  || die 'Could not find script define for $prg' . "\n";
 		my @files = split /\s+/, $1;
+		push @files,@common_files if (grep {$_ eq '$(SCRIPTS_COMMON)'} @files);
 		foreach my $f (@files)
 		{
 			$f =~ s/\.o$/\.c/;

Reply via email to