1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

Provide for contrib and pgxs modules to install include files.

This allows out-of-tree PLs and similar code to get access to
definitions needed to work with extension data types.

The following existing modules now install headers: contrib/cube,
contrib/hstore, contrib/isn, contrib/ltree, contrib/seg.

Discussion: https://postgr.es/m/87y3euomjh.fsf%40news-spur.riddles.org.uk
This commit is contained in:
Andrew Gierth
2018-07-31 19:58:39 +01:00
parent f3eb76b399
commit df163230b9
8 changed files with 130 additions and 2 deletions

View File

@ -554,6 +554,49 @@ sub CopySubdirFiles
}
}
{
$flist = '';
if ($mf =~ /^HEADERS\s*=\s*(.*)$/m) { $flist .= $1 }
my @modlist = ();
my %fmodlist = ();
while ($mf =~ /^HEADERS_([^\s=]+)\s*=\s*(.*)$/mg) { $fmodlist{$1} .= $2 }
if ($mf =~ /^MODULE_big\s*=\s*(.*)$/m)
{
push @modlist, $1;
if ($flist ne '')
{
$fmodlist{$1} = $flist;
$flist = '';
}
}
elsif ($mf =~ /^MODULES\s*=\s*(.*)$/m)
{
push @modlist, split /\s+/, $1;
}
croak "HEADERS requires MODULE_big in $subdir $module"
if $flist ne '';
foreach my $mod (keys %fmodlist)
{
croak "HEADERS_$mod for unknown module in $subdir $module"
unless grep { $_ eq $mod } @modlist;
$flist = ParseAndCleanRule($fmodlist{$mod}, $mf);
EnsureDirectories($target,
"include", "include/server",
"include/server/$moduledir",
"include/server/$moduledir/$mod");
foreach my $f (split /\s+/, $flist)
{
lcopy("$subdir/$module/$f",
"$target/include/server/$moduledir/$mod/" . basename($f))
|| croak("Could not copy file $f in $subdir $module");
print '.';
}
}
}
$flist = '';
if ($mf =~ /^DOCS\s*=\s*(.*)$/mg) { $flist .= $1 }
if ($flist ne '')