8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b69bf30 commit cbf9f0eCopy full SHA for cbf9f0e
src/tools/msvc/Install.pm
@@ -439,9 +439,12 @@ sub CopyContribFiles
439
while (my $d = readdir($D))
440
{
441
# These configuration-based exclusions must match vcregress.pl
442
- next if ($d eq "uuid-ossp" && !defined($config->{uuid}));
443
- next if ($d eq "sslinfo" && !defined($config->{openssl}));
444
- next if ($d eq "xml2" && !defined($config->{xml}));
+ next if ($d eq "uuid-ossp" && !defined($config->{uuid}));
+ next if ($d eq "sslinfo" && !defined($config->{openssl}));
+ next if ($d eq "xml2" && !defined($config->{xml}));
445
+ next if ($d eq "hstore_plperl" && !defined($config->{perl}));
446
+ next if ($d eq "hstore_plpython" && !defined($config->{python}));
447
+ next if ($d eq "ltree_plpython" && !defined($config->{python}));
448
next if ($d eq "sepgsql");
449
450
CopySubdirFiles($subdir, $d, $config, $target);
src/tools/msvc/Mkvcbuild.pm
@@ -46,7 +46,11 @@ my $contrib_extraincludes =
46
my $contrib_extrasource = {
47
'cube' => [ 'contrib/cube/cubescan.l', 'contrib/cube/cubeparse.y' ],
48
'seg' => [ 'contrib/seg/segscan.l', 'contrib/seg/segparse.y' ], };
49
-my @contrib_excludes = ('pgcrypto', 'commit_ts', 'intagg', 'sepgsql');
+my @contrib_excludes = (
50
+ 'commit_ts', 'hstore_plperl',
51
+ 'hstore_plpython', 'intagg',
52
+ 'ltree_plpython', 'pgcrypto',
53
+ 'sepgsql');
54
55
# Set of variables for frontend modules
56
my $frontend_defines = { 'initdb' => 'FRONTEND' };
@@ -176,119 +180,6 @@ sub mkvcbuild
176
180
$plpgsql->AddFiles('src/pl/plpgsql/src', 'pl_gram.y');
177
181
$plpgsql->AddReference($postgres);
178
182
179
- if ($solution->{options}->{perl})
- {
- my $plperlsrc = "src/pl/plperl/";
- my $plperl =
183
- $solution->AddProject('plperl', 'dll', 'PLs', 'src/pl/plperl');
184
- $plperl->AddIncludeDir($solution->{options}->{perl} . '/lib/CORE');
185
- $plperl->AddDefine('PLPERL_HAVE_UID_GID');
186
- foreach my $xs ('SPI.xs', 'Util.xs')
187
188
- (my $xsc = $xs) =~ s/\.xs/.c/;
189
- if (Solution::IsNewer("$plperlsrc$xsc", "$plperlsrc$xs"))
190
191
- my $xsubppdir = first { -e "$_/ExtUtils/xsubpp" } @INC;
192
- print "Building $plperlsrc$xsc...\n";
193
- system( $solution->{options}< 8000 span class="pl-k">->{perl}
194
- . '/bin/perl '
195
- . "$xsubppdir/ExtUtils/xsubpp -typemap "
196
- . $solution->{options}->{perl}
197
- . '/lib/ExtUtils/typemap '
198
- . "$plperlsrc$xs "
199
- . ">$plperlsrc$xsc");
200
- if ((!(-f "$plperlsrc$xsc")) || -z "$plperlsrc$xsc")
201
202
- unlink("$plperlsrc$xsc"); # if zero size
203
- die "Failed to create $xsc.\n";
204
- }
205
206
207
- if (Solution::IsNewer(
208
- 'src/pl/plperl/perlchunks.h',
209
- 'src/pl/plperl/plc_perlboot.pl')
210
- || Solution::IsNewer(
211
212
- 'src/pl/plperl/plc_trusted.pl'))
213
214
- print 'Building src/pl/plperl/perlchunks.h ...' . "\n";
215
- my $basedir = getcwd;
216
- chdir 'src/pl/plperl';
217
- system( $solution->{options}->{perl}
218
219
- . 'text2macro.pl '
220
- . '--strip="^(\#.*|\s*)$$" '
221
- . 'plc_perlboot.pl plc_trusted.pl '
222
- . '>perlchunks.h');
223
- chdir $basedir;
224
- if ((!(-f 'src/pl/plperl/perlchunks.h'))
225
- || -z 'src/pl/plperl/perlchunks.h')
226
227
- unlink('src/pl/plperl/perlchunks.h'); # if zero size
228
- die 'Failed to create perlchunks.h' . "\n";
229
230
231
232
- 'src/pl/plperl/plperl_opmask.h',
233
- 'src/pl/plperl/plperl_opmask.pl'))
234
235
- print 'Building src/pl/plperl/plperl_opmask.h ...' . "\n";
236
237
238
239
240
- . 'plperl_opmask.pl '
241
- . 'plperl_opmask.h');
242
243
- if ((!(-f 'src/pl/plperl/plperl_opmask.h'))
244
- || -z 'src/pl/plperl/plperl_opmask.h')
245
246
- unlink('src/pl/plperl/plperl_opmask.h'); # if zero size
247
- die 'Failed to create plperl_opmask.h' . "\n";
248
249
250
- $plperl->AddReference($postgres);
251
- my @perl_libs =
252
- grep { /perl\d+.lib$/ }
253
- glob($solution->{options}->{perl} . '\lib\CORE\perl*.lib');
254
- if (@perl_libs == 1)
255
256
- $plperl->AddLibrary($perl_libs[0]);
257
258
- else
259
260
- die "could not identify perl library version";
261
262
263
-
264
- if ($solution->{options}->{python})
265
266
267
- # Attempt to get python version and location.
268
- # Assume python.exe in specified dir.
269
- open(P,
270
- $solution->{options}->{python}
271
- . "\\python -c \"import sys;print(sys.prefix);print(str(sys.version_info[0])+str(sys.version_info[1]))\" |"
272
- ) || die "Could not query for python version!\n";
273
- my $pyprefix = <P>;
274
- chomp($pyprefix);
275
- my $pyver = <P>;
276
- chomp($pyver);
277
- close(P);
278
279
- # Sometimes (always?) if python is not present, the execution
280
- # appears to work, but gives no data...
281
- die "Failed to query python for version information\n"
282
- if (!(defined($pyprefix) && defined($pyver)));
283
284
- my $pymajorver = substr($pyver, 0, 1);
285
- my $plpython = $solution->AddProject('plpython' . $pymajorver,
286
- 'dll', 'PLs', 'src/pl/plpython');
287
- $plpython->AddIncludeDir($pyprefix . '/include');
288
- $plpython->AddLibrary($pyprefix . "/Libs/python$pyver.lib");
289
- $plpython->AddReference($postgres);
290
291
292
if ($solution->{options}->{tcl})
293
294
my $pltcl =
@@ -571,6 +462,138 @@ sub mkvcbuild
571
462
closedir($D);
572
463
}
573
464
465
+ # Build Perl and Python modules after contrib/ modules to satisfy some
466
+ # dependencies with transform contrib modules, like hstore_plpython
467
+ # ltree_plpython and hstore_plperl.
468
+ if ($solution->{options}->{python})
469
+ {
470
+ # Attempt to get python version and location.
471
+ # Assume python.exe in specified dir.
472
+ my $pythonprog = "import sys;print(sys.prefix);" .
473
+ "print(str(sys.version_info[0])+str(sys.version_info[1]))";
474
+ my $prefixcmd = $solution->{options}->{python}
475
+ . "\\python -c \"$pythonprog\"";
476
+ my $pyout = `$prefixcmd`;
477
+ die "Could not query for python version!\n" if $?;
478
+ my ($pyprefix,$pyver) = split(/\r?\n/,$pyout);
479
+
480
+ # Sometimes (always?) if python is not present, the execution
481
+ # appears to work, but gives no data...
482
+ die "Failed to query python for version information\n"
483
+ if (!(defined($pyprefix) && defined($pyver)));
484
485
+ my $pymajorver = substr($pyver, 0, 1);
486
+ my $plpython = $solution->AddProject('plpython' . $pymajorver,
487
+ 'dll', 'PLs', 'src/pl/plpython');
488
+ $plpython->AddIncludeDir($pyprefix . '/include');
489
+ $plpython->AddLibrary($pyprefix . "/Libs/python$pyver.lib");
490
+ $plpython->AddReference($postgres);
491
492
+ # Add transform modules dependent on plpython
493
+ AddTransformModule('hstore_plpython' . $pymajorver,
494
+ 'contrib/hstore_plpython',
495
+ 'plpython' . $pymajorver,
496
+ 'src/pl/plpython', 'hstore',
497
+ 'contrib/hstore');
498
+ AddTransformModule('ltree_plpython' . $pymajorver,
499
+ 'contrib/ltree_plpython',
500
501
+ 'src/pl/plpython', 'ltree',
502
+ 'contrib/ltree');
503
+ }
504
505
+ if ($solution->{options}->{perl})
506
507
+ my $plperlsrc = "src/pl/plperl/";
508
+ my $plperl =
509
+ $solution->AddProject('plperl', 'dll', 'PLs', 'src/pl/plperl');
510
+ $plperl->AddIncludeDir($solution->{options}->{perl} . '/lib/CORE');
511
+ $plperl->AddDefine('PLPERL_HAVE_UID_GID');
512
+ foreach my $xs ('SPI.xs', 'Util.xs')
513
514
+ (my $xsc = $xs) =~ s/\.xs/.c/;
515
+ if (Solution::IsNewer("$plperlsrc$xsc", "$plperlsrc$xs"))
516
517
+ my $xsubppdir = first { -e "$_/ExtUtils/xsubpp" } @INC;
518
+ print "Building $plperlsrc$xsc...\n";
519
+ system( $solution->{options}->{perl}
520
+ . '/bin/perl '
521
+ . "$xsubppdir/ExtUtils/xsubpp -typemap "
522
+ . $solution->{options}->{perl}
523
+ . '/lib/ExtUtils/typemap '
524
+ . "$plperlsrc$xs "
525
+ . ">$plperlsrc$xsc");
526
+ if ((!(-f "$plperlsrc$xsc")) || -z "$plperlsrc$xsc")
527
528
+ unlink("$plperlsrc$xsc"); # if zero size
529
+ die "Failed to create $xsc.\n";
530
531
532
533
+ if (Solution::IsNewer(
534
+ 'src/pl/plperl/perlchunks.h',
535
+ 'src/pl/plperl/plc_perlboot.pl')
536
+ || Solution::IsNewer(
537
538
+ 'src/pl/plperl/plc_trusted.pl'))
539
540
+ print 'Building src/pl/plperl/perlchunks.h ...' . "\n";
541
+ my $basedir = getcwd;
542
+ chdir 'src/pl/plperl';
543
544
545
+ . 'text2macro.pl '
546
+ . '--strip="^(\#.*|\s*)$$" '
547
+ . 'plc_perlboot.pl plc_trusted.pl '
548
+ . '>perlchunks.h');
549
+ chdir $basedir;
550
+ if ((!(-f 'src/pl/plperl/perlchunks.h'))
551
+ || -z 'src/pl/plperl/perlchunks.h')
552
553
+ unlink('src/pl/plperl/perlchunks.h'); # if zero size
554
+ die 'Failed to create perlchunks.h' . "\n";
555
556
557
558
+ 'src/pl/plperl/plperl_opmask.h',
559
+ 'src/pl/plperl/plperl_opmask.pl'))
560
561
+ print 'Building src/pl/plperl/plperl_opmask.h ...' . "\n";
562
563
564
565
566
+ . 'plperl_opmask.pl '
567
+ . 'plperl_opmask.h');
568
569
+ if ((!(-f 'src/pl/plperl/plperl_opmask.h'))
570
+ || -z 'src/pl/plperl/plperl_opmask.h')
+ unlink('src/pl/plperl/plperl_opmask.h'); # if zero size
+ die 'Failed to create plperl_opmask.h' . "\n";
574
575
576
+ $plperl->AddReference($postgres);
577
+ my @perl_libs =
578
+ grep { /perl\d+.lib$/ }
579
+ glob($solution->{options}->{perl} . '\lib\CORE\perl*.lib');
580
+ if (@perl_libs == 1)
581
582
+ $plperl->AddLibrary($perl_libs[0]);
583
584
+ else
585
586
+ die "could not identify perl library version";
587
588
589
+ # Add transform module dependent on plperl
590
+ my $hstore_plperl =
591
+ AddTransformModule('hstore_plperl', 'contrib/hstore_plperl',
592
+ 'plperl', 'src/pl/plperl',
593
+ 'hstore', 'contrib/hstore');
594
+ $hstore_plperl->AddDefine('PLPERL_HAVE_UID_GID');
595
596
597
$mf =
598
Project::read_file('src/backend/utils/mb/conversion_procs/Makefile');
599
$mf =~ s{\\\r?\n}{}g;
@@ -680,6 +703,68 @@ sub AddSimpleFrontend
680
703
return $p;
681
704
682
705
706
+# Add a simple transform module
707
+sub AddTransformModule
708
+{
709
+ my $n = shift;
710
+ my $n_src = shift;
711
+ my $pl_proj_name = shift;
712
+ my $pl_src = shift;
713
+ my $transform_name = shift;
714
+ my $transform_src = shift;
715
716
+ my $transform_proj = undef;
717
+ foreach my $proj (@{ $solution->{projects}->{'contrib'} })
718
719
+ if ($proj->{name} eq $transform_name)
720
721
+ $transform_proj = $proj;
722
+ last;
723
724
725
+ die "could not find base module $transform_name for transform module $n"
726
+ if (!defined($transform_proj));
727
728
+ my $pl_proj = undef;
729
+ foreach my $proj (@{ $solution->{projects}->{'PLs'} })
730
731
+ if ($proj->{name} eq $pl_proj_name)
732
733
+ $pl_proj = $proj;
734
735
736
737
+ die "could not find PL $pl_proj_name for transform module $n"
738
+ if (!defined($pl_proj));
739
740
+ my $p = $solution->AddProject($n, 'dll', 'contrib', $n_src);
741
+ for my $file (glob("$n_src/*.c"))
742
743
+ $p->AddFile($file);
744
745
+ $p->AddReference($postgres);
746
747
+ # Add PL dependencies
748
+ $p->AddIncludeDir($pl_src);
749
+ $p->AddReference($pl_proj);
750
+ $p->AddIncludeDir($pl_proj->{includes});
751
+ foreach my $pl_lib (@{$pl_proj->{libraries}})
752
753
+ $p->AddLibrary($pl_lib);
754
755
756
+ # Add base module dependencies
757
+ $p->AddIncludeDir($transform_src);
758
+ $p->AddIncludeDir($transform_proj->{includes});
759
+ foreach my $trans_lib (@{$transform_proj->{libraries}})
760
761
+ $p->AddLibrary($trans_lib);
762
763
+ $p->AddReference($transform_proj);
764
765
+ return $p;
766
+}
767
683
768
# Add a simple contrib project
684
769
sub AddContrib
685
770
src/tools/msvc/vcregress.pl
@@ -262,9 +262,12 @@ sub contribcheck
foreach my $module (glob("*"))
# these configuration-based exclusions must match Install.pm
- next if ($module eq "uuid-ossp" && !defined($config->{uuid}));
- next if ($module eq "sslinfo" && !defined($config->{openssl}));
- next if ($module eq "xml2" && !defined($config->{xml}));
+ next if ($module eq "uuid-ossp" && !defined($config->{uuid}));
+ next if ($module eq "sslinfo" && !defined($config->{openssl}));
+ next if ($module eq "xml2" && !defined($config->{xml}));
+ next if ($module eq "hstore_plperl" && !defined($config->{perl}));
+ next if ($module eq "hstore_plpython");
+ next if ($module eq "ltree_plpython");
next if ($module eq "sepgsql");
subdircheck("$topdir/contrib", $module);
@@ -375,7 +378,6 @@ sub fetchRegressOpts
375
378
$m =~ s{\\\r?\n}{}g;
376
379
if ($m =~ /^\s*REGRESS_OPTS\s*=(.*)/m)
377
380
381
# Substitute known Makefile variables, then ignore options that retain
382
# an unhandled variable reference. Ignore anything that isn't an
383
# option starting with "--".