Attempt to fix jsonb_plpython build on Windows

This commit is contained in:
Peter Eisentraut 2018-03-28 11:49:23 -04:00
parent e81fc9b9db
commit 75e95dd79b
3 changed files with 29 additions and 14 deletions

View File

@ -465,6 +465,7 @@ sub CopyContribFiles
next if ($d eq "xml2" && !defined($config->{xml}));
next if ($d eq "hstore_plperl" && !defined($config->{perl}));
next if ($d eq "hstore_plpython" && !defined($config->{python}));
next if ($d eq "jsonb_plpython" && !defined($config->{python}));
next if ($d eq "ltree_plpython" && !defined($config->{python}));
next if ($d eq "sepgsql");

View File

@ -43,6 +43,7 @@ my $contrib_extrasource = {
my @contrib_excludes = (
'commit_ts', 'hstore_plperl',
'hstore_plpython', 'intagg',
'jsonb_plpython',
'ltree_plpython', 'pgcrypto',
'sepgsql', 'brin',
'test_extensions', 'test_pg_dump',
@ -506,6 +507,11 @@ sub mkvcbuild
'hstore', 'contrib/hstore');
$hstore_plpython->AddDefine(
'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"');
my $jsonb_plpython = AddTransformModule(
'jsonb_plpython' . $pymajorver, 'contrib/jsonb_plpython',
'plpython' . $pymajorver, 'src/pl/plpython');
$jsonb_plpython->AddDefine(
'PLPYTHON_LIBNAME="plpython' . $pymajorver . '"');
my $ltree_plpython = AddTransformModule(
'ltree_plpython' . $pymajorver, 'contrib/ltree_plpython',
'plpython' . $pymajorver, 'src/pl/plpython',
@ -850,20 +856,23 @@ sub AddTransformModule
my $n_src = shift;
my $pl_proj_name = shift;
my $pl_src = shift;
my $transform_name = shift;
my $transform_src = shift;
my $type_name = shift;
my $type_src = shift;
my $transform_proj = undef;
foreach my $proj (@{ $solution->{projects}->{'contrib'} })
my $type_proj = undef;
if ($type_name)
{
if ($proj->{name} eq $transform_name)
foreach my $proj (@{ $solution->{projects}->{'contrib'} })
{
$transform_proj = $proj;
last;
if ($proj->{name} eq $type_name)
{
$type_proj = $proj;
last;
}
}
die "could not find base module $type_name for transform module $n"
if (!defined($type_proj));
}
die "could not find base module $transform_name for transform module $n"
if (!defined($transform_proj));
my $pl_proj = undef;
foreach my $proj (@{ $solution->{projects}->{'PLs'} })
@ -894,13 +903,16 @@ sub AddTransformModule
}
# Add base module dependencies
$p->AddIncludeDir($transform_src);
$p->AddIncludeDir($transform_proj->{includes});
foreach my $trans_lib (@{ $transform_proj->{libraries} })
if ($type_proj)
{
$p->AddLibrary($trans_lib);
$p->AddIncludeDir($type_src);
$p->AddIncludeDir($type_proj->{includes});
foreach my $type_lib (@{ $type_proj->{libraries} })
{
$p->AddLibrary($type_lib);
}
$p->AddReference($type_proj);
}
$p->AddReference($transform_proj);
return $p;
}

View File

@ -326,6 +326,7 @@ sub subdircheck
# Makefile for more details regarding Python-version specific
# dependencies.
if ( $module eq "hstore_plpython"
|| $module eq "jsonb_plpython"
|| $module eq "ltree_plpython")
{
die "Python not enabled in configuration"
@ -376,6 +377,7 @@ sub contribcheck
next if ($module eq "xml2" && !defined($config->{xml}));
next if ($module eq "hstore_plperl" && !defined($config->{perl}));
next if ($module eq "hstore_plpython" && !defined($config->{python}));
next if ($module eq "jsonb_plpython" && !defined($config->{python}));
next if ($module eq "ltree_plpython" && !defined($config->{python}));
next if ($module eq "sepgsql");