mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-30 19:00:29 +08:00
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
This commit is contained in:
parent
1f1cd9b5dd
commit
bad51a49a4
@ -266,13 +266,18 @@ sub GenerateFiles
|
||||
chdir('src/backend/utils');
|
||||
my $pg_language_dat = '../../../src/include/catalog/pg_language.dat';
|
||||
my $pg_proc_dat = '../../../src/include/catalog/pg_proc.dat';
|
||||
if ( IsNewer('fmgrtab.c', $pg_language_dat)
|
||||
|| IsNewer('fmgrtab.c', $pg_proc_dat)
|
||||
|| IsNewer('fmgrtab.c', '../../../src/include/access/transam.h'))
|
||||
if ( IsNewer('fmgr-stamp', 'Gen_fmgrtab.pl')
|
||||
|| IsNewer('fmgr-stamp', '../catalog/Catalog.pm')
|
||||
|| IsNewer('fmgr-stamp', $pg_language_dat)
|
||||
|| IsNewer('fmgr-stamp', $pg_proc_dat)
|
||||
|| IsNewer('fmgr-stamp', '../../../src/include/access/transam.h'))
|
||||
{
|
||||
system(
|
||||
"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('../../..');
|
||||
|
||||
@ -468,36 +473,49 @@ EOF
|
||||
|| croak "Could not find POSTGRES_BKI_DATA in Makefile\n";
|
||||
my @bki_data = split /\s+/, $1;
|
||||
|
||||
my $need_genbki = 0;
|
||||
foreach my $bki (@bki_srcs, @bki_data)
|
||||
{
|
||||
next if $bki eq "";
|
||||
if (IsNewer(
|
||||
'src/backend/catalog/postgres.bki',
|
||||
'src/backend/catalog/bki-stamp',
|
||||
"src/include/catalog/$bki"))
|
||||
{
|
||||
chdir('src/backend/catalog');
|
||||
my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs);
|
||||
system(
|
||||
"perl genbki.pl --set-version=$self->{majorver} $bki_srcs");
|
||||
chdir('../../..');
|
||||
|
||||
# Copy generated headers to include directory.
|
||||
opendir(my $dh, 'src/backend/catalog/')
|
||||
|| die "Can't opendir src/backend/catalog/ $!";
|
||||
my @def_headers = grep { /pg_\w+_d\.h$/ } readdir($dh);
|
||||
closedir $dh;
|
||||
foreach my $def_header (@def_headers)
|
||||
{
|
||||
copyFile(
|
||||
"src/backend/catalog/$def_header",
|
||||
"src/include/catalog/$def_header");
|
||||
}
|
||||
copyFile(
|
||||
'src/backend/catalog/schemapg.h',
|
||||
'src/include/catalog/schemapg.h');
|
||||
$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');
|
||||
my $bki_srcs = join(' ../../../src/include/catalog/', @bki_srcs);
|
||||
system("perl genbki.pl --set-version=$self->{majorver} $bki_srcs");
|
||||
open(my $f, '>', 'bki-stamp')
|
||||
|| confess "Could not touch bki-stamp";
|
||||
close($f);
|
||||
chdir('../../..');
|
||||
|
||||
# Copy generated headers to include directory.
|
||||
opendir(my $dh, 'src/backend/catalog/')
|
||||
|| die "Can't opendir src/backend/catalog/ $!";
|
||||
my @def_headers = grep { /pg_\w+_d\.h$/ } readdir($dh);
|
||||
closedir $dh;
|
||||
foreach my $def_header (@def_headers)
|
||||
{
|
||||
copyFile(
|
||||
"src/backend/catalog/$def_header",
|
||||
"src/include/catalog/$def_header");
|
||||
}
|
||||
copyFile(
|
||||
'src/backend/catalog/schemapg.h',
|
||||
'src/include/catalog/schemapg.h');
|
||||
}
|
||||
|
||||
open(my $o, '>', "doc/src/sgml/version.sgml")
|
||||
|| croak "Could not write to version.sgml\n";
|
||||
|
@ -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\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\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.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\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\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
|
||||
@ -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\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\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\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
|
||||
|
Loading…
Reference in New Issue
Block a user