]> granicus.if.org Git - postgresql/commitdiff
Unbreak MSVC builds after recent Makefile refactoring.
authorAndrew Dunstan <andrew@dunslane.net>
Thu, 11 Oct 2012 16:36:42 +0000 (12:36 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Thu, 11 Oct 2012 16:36:42 +0000 (12:36 -0400)
Based on a suggestion by Peter Eisentraut.

src/tools/msvc/pgbison.pl
src/tools/msvc/pgflex.pl

index d6f2444841d7d98c9719c3e5401c758f7d275481..31e75403f594f9e232e5e6e625dbaa4623693ad9 100644 (file)
@@ -42,7 +42,8 @@ open($mf, $makefile);
 local $/ = undef;
 $make = <$mf>;
 close($mf);
-my $headerflag = ($make =~ /\$\(BISON\)\s+-d/ ? '-d' : '');
+my $basetarg = basename($output);
+my $headerflag = ($make =~ /^$basetarg:\s+BISONFLAGS\b.*-d/m ? '-d' : '');
 
 system("bison $headerflag $input -o $output");
 exit $? >> 8;
index 259f2187ed38acbf009d400237a523cfb0060b60..7e4c0f90b70e22943faf7463975f519c6ae9c6c4 100644 (file)
@@ -44,7 +44,8 @@ open($mf, $makefile);
 local $/ = undef;
 $make = <$mf>;
 close($mf);
-my $flexflags = ($make =~ /^\s*FLEXFLAGS\s*=\s*(\S.*)/m ? $1 : '');
+my $basetarg = basename($output);
+my $flexflags = ($make =~ /^$basetarg:\s*FLEXFLAGS\s*=\s*(\S.*)/m ? $1 : '');
 
 system("flex $flexflags -o$output $input");
 if ($? == 0)