Commit bad51a49 authored by Tom Lane's avatar Tom Lane

Blindly try to fix MSVC build's use of genbki.pl and Gen_fmgrtab.pl.

We need to use a stamp file to record the runs of these scripts, as
is done on the Unix side.  I think I got it right, but can't test.

While at it, extend this handmade dependency logic to also check the
generating script files, as the makefiles do.

Discussion: https://postgr.es/m/16925.1525376229@sss.pgh.pa.us
parent 1f1cd9b5
...@@ -266,13 +266,18 @@ sub GenerateFiles ...@@ -266,13 +266,18 @@ sub GenerateFiles
chdir('src/backend/utils'); chdir('src/backend/utils');
my $pg_language_dat = '../../../src/include/catalog/pg_language.dat'; my $pg_language_dat = '../../../src/include/catalog/pg_language.dat';
my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat'; my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat';
if ( IsNewer('fmgrtab.c', $pg_language_dat) if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl')
|| IsNewer('fmgrtab.c', $pg_proc_dat) || IsNewer('fmgr-stamp', '../catalog/Catalog.pm')
|| IsNewer('fmgrtab.c', '../../../src/include/access/transam.h')) || IsNewer('fmgr-stamp', $pg_language_dat)
|| IsNewer('fmgr-stamp', $pg_proc_dat)
|| IsNewer('fmgr-stamp', '../../../src/include/access/transam.h'))
{ {
system( system(
"perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat" "perl -I ../catalog Gen_fmgrtab.pl -I../../../src/include/ $pg_language_dat $pg_proc_dat"
); );
open(my $f, '>', 'fmgr-stamp')
|| confess "Could not touch fmgr-stamp";
close($f);
} }
chdir('../../..'); chdir('../../..');
...@@ -468,17 +473,32 @@ EOF ...@@ -468,17 +473,32 @@ EOF
|| croak "Could not find POSTGRES_BKI_DATA in Makefile\n"; || croak "Could not find POSTGRES_BKI_DATA in Makefile\n";
my @bki_data = split /\s+/, $1; my @bki_data = split /\s+/, $1;
my $need_genbki = 0;
foreach my $bki (@bki_srcs, @bki_data) foreach my $bki (@bki_srcs, @bki_data)
{ {
next if $bki eq ""; next if $bki eq "";
if (IsNewer( if (IsNewer(
'src/backend/catalog/postgres.bki', 'src/backend/catalog/bki-stamp',
"src/include/catalog/$bki")) "src/include/catalog/$bki"))
{
$need_genbki = 1;
last;
}
}
$need_genbki = 1
if IsNewer('src/backend/catalog/bki-stamp',
'src/backend/catalog/genbki.pl');
$need_genbki = 1
if IsNewer('src/backend/catalog/bki-stamp',
'src/backend/catalog/Catalog.pm');
if ($need_genbki)
{ {
chdir('src/backend/catalog'); chdir('src/backend/catalog');
my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs); my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs);
system( system("perl genbki.pl --set-version=$self->{majorver} $bki_srcs");
"perl genbki.pl --set-version=$self->{majorver} $bki_srcs"); open(my $f, '>', 'bki-stamp')
|| confess "Could not touch bki-stamp";
close($f);
chdir('../../..'); chdir('../../..');
# Copy generated headers to include directory. # Copy generated headers to include directory.
...@@ -495,8 +515,6 @@ EOF ...@@ -495,8 +515,6 @@ EOF
copyFile( copyFile(
'src/backend/catalog/schemapg.h', 'src/backend/catalog/schemapg.h',
'src/include/catalog/schemapg.h'); 'src/include/catalog/schemapg.h');
last;
}
} }
open(my $o, '>', "doc/src/sgml/version.sgml") open(my $o, '>', "doc/src/sgml/version.sgml")
......
...@@ -54,10 +54,11 @@ if exist doc\src\sgml\version.sgml del /q doc\src\sgml\version.sgml ...@@ -54,10 +54,11 @@ if exist doc\src\sgml\version.sgml del /q doc\src\sgml\version.sgml
if %DIST%==1 if exist src\backend\utils\fmgroids.h del /q src\backend\utils\fmgroids.h if %DIST%==1 if exist src\backend\utils\fmgroids.h del /q src\backend\utils\fmgroids.h
if %DIST%==1 if exist src\backend\utils\fmgrprotos.h del /q src\backend\utils\fmgrprotos.h if %DIST%==1 if exist src\backend\utils\fmgrprotos.h del /q src\backend\utils\fmgrprotos.h
if %DIST%==1 if exist src\backend\utils\fmgrtab.c del /q src\backend\utils\fmgrtab.c if %DIST%==1 if exist src\backend\utils\fmgrtab.c del /q src\backend\utils\fmgrtab.c
if %DIST%==1 if exist src\backend\utils\fmgr-stamp del /q src\backend\utils\fmgr-stamp
if %DIST%==1 if exist src\backend\utils\errcodes.h del /q src\backend\utils\errcodes.h
if %DIST%==1 if exist src\backend\storage\lmgr\lwlocknames.c del /q src\backend\storage\lmgr\lwlocknames.c if %DIST%==1 if exist src\backend\storage\lmgr\lwlocknames.c del /q src\backend\storage\lmgr\lwlocknames.c
if %DIST%==1 if exist src\backend\storage\lmgr\lwlocknames.h del /q src\backend\storage\lmgr\lwlocknames.h if %DIST%==1 if exist src\backend\storage\lmgr\lwlocknames.h del /q src\backend\storage\lmgr\lwlocknames.h
if %DIST%==1 if exist src\pl\plpython\spiexceptions.h del /q src\pl\plpython\spiexceptions.h if %DIST%==1 if exist src\pl\plpython\spiexceptions.h del /q src\pl\plpython\spiexceptions.h
if %DIST%==1 if exist src\backend\utils\errcodes.h del /q src\backend\utils\errcodes.h
if %DIST%==1 if exist src\pl\plpgsql\src\plerrcodes.h del /q src\pl\plpgsql\src\plerrcodes.h if %DIST%==1 if exist src\pl\plpgsql\src\plerrcodes.h del /q src\pl\plpgsql\src\plerrcodes.h
if %DIST%==1 if exist src\pl\tcl\pltclerrcodes.h del /q src\pl\tcl\pltclerrcodes.h if %DIST%==1 if exist src\pl\tcl\pltclerrcodes.h del /q src\pl\tcl\pltclerrcodes.h
if %DIST%==1 if exist src\backend\utils\sort\qsort_tuple.c del /q src\backend\utils\sort\qsort_tuple.c if %DIST%==1 if exist src\backend\utils\sort\qsort_tuple.c del /q src\backend\utils\sort\qsort_tuple.c
...@@ -69,6 +70,7 @@ if %DIST%==1 if exist src\backend\catalog\postgres.description del /q src\backen ...@@ -69,6 +70,7 @@ if %DIST%==1 if exist src\backend\catalog\postgres.description del /q src\backen
if %DIST%==1 if exist src\backend\catalog\postgres.shdescription del /q src\backend\catalog\postgres.shdescription if %DIST%==1 if exist src\backend\catalog\postgres.shdescription del /q src\backend\catalog\postgres.shdescription
if %DIST%==1 if exist src\backend\catalog\schemapg.h del /q src\backend\catalog\schemapg.h if %DIST%==1 if exist src\backend\catalog\schemapg.h del /q src\backend\catalog\schemapg.h
if %DIST%==1 if exist src\backend\catalog\pg_*_d.h del /q src\backend\catalog\pg_*_d.h if %DIST%==1 if exist src\backend\catalog\pg_*_d.h del /q src\backend\catalog\pg_*_d.h
if %DIST%==1 if exist src\backend\catalog\bki-stamp del /q src\backend\catalog\bki-stamp
if %DIST%==1 if exist src\backend\parser\scan.c del /q src\backend\parser\scan.c if %DIST%==1 if exist src\backend\parser\scan.c del /q src\backend\parser\scan.c
if %DIST%==1 if exist src\backend\parser\gram.c del /q src\backend\parser\gram.c if %DIST%==1 if exist src\backend\parser\gram.c del /q src\backend\parser\gram.c
if %DIST%==1 if exist src\backend\bootstrap\bootscanner.c del /q src\backend\bootstrap\bootscanner.c if %DIST%==1 if exist src\backend\bootstrap\bootscanner.c del /q src\backend\bootstrap\bootscanner.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment