Tom Lane wrote:
> But I agree with Andres' complaint that just duplicating the code isn't
> the best way. The configure script has a loop that's basically like
>
> for f in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84
> tclsh8.3 tclsh83
> do
> ... break if $f is the right one
> done
>
> Seems to me that a similar coding pattern in the MSVC script is a
> reasonable way to go.
Something like the (untested) attached perhaps?
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 30c126503b..c0bc25292f 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -204,20 +204,24 @@ sub mkvcbuild
if ($solution->{options}->{tcl})
{
+ my $found = 0;
my $pltcl =
$solution->AddProject('pltcl', 'dll', 'PLs', 'src/pl/tcl');
$pltcl->AddIncludeDir($solution->{options}->{tcl} . '/include');
$pltcl->AddReference($postgres);
- if (-e $solution->{options}->{tcl} . '/lib/tcl85.lib')
+
+ for my $tclver (qw(86t 85 84))
{
- $pltcl->AddLibrary(
- $solution->{options}->{tcl} . '/lib/tcl85.lib');
- }
- else
- {
- $pltcl->AddLibrary(
- $solution->{options}->{tcl} . '/lib/tcl84.lib');
+ my $tcllib = $solution->{options}->{tcl} .
"/lib/tcl$tclver.lib";
+ if (-e $tcllib)
+ {
+ $pltcl->AddLibrary($tcllib);
+ $found = 1;
+ last;
+ }
}
+ die "Unable to find
$solution->{options}->{tcl}/lib/tcl<version>.lib"
+ unless $found;
}
$libpq = $solution->AddProject('libpq', 'dll', 'interfaces',
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers