Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita05af1d

Browse files
committed
Make the msvc build system ask python about details of version and installation
prefix, instead of assuming it will always be following the default layout.All information we need is not available on Windows, but the number ofassumptions are at least fewer this way than before.Based on suggestions from James William Pye.
1 parentc5d644a commita05af1d

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

‎src/tools/msvc/Mkvcbuild.pm

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Mkvcbuild;
33
#
44
# Package that generates build files for msvc build
55
#
6-
# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.51 2010/01/20 09:22:43 heikki Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.52 2010/02/14 14:10:23 mha Exp $
77
#
88
use Carp;
99
use Win32;
@@ -147,11 +147,18 @@ sub mkvcbuild
147147

148148
if ($solution->{options}->{python})
149149
{
150+
# Attempt to get python version and location. Assume python.exe in specified dir.
151+
open(P,$solution->{options}->{python} ."\\python -c\"import sys;print(sys.prefix);print(str(sys.version_info[0])+str(sys.version_info[1]))\" |") ||die"Could not query for python versoin!\n";
152+
my$pyprefix = <P>;chomp($pyprefix);
153+
my$pyver = <P>;chomp($pyver);
154+
close(P);
155+
156+
# Sometimes (always?) if python is not present, the execution actually works, but gives no data...
157+
die"Failed to query python for version information\n"if (!(defined($pyprefix) &&defined($pyver)));
158+
150159
my$plpython =$solution->AddProject('plpython','dll','PLs','src\pl\plpython');
151-
$plpython->AddIncludeDir($solution->{options}->{python} .'\include');
152-
$solution->{options}->{python} =~/\\Python(\d{2})/i
153-
|| croak"Could not determine python version from path";
154-
$plpython->AddLibrary($solution->{options}->{python} ."\\Libs\\python$1.lib");
160+
$plpython->AddIncludeDir($pyprefix .'\include');
161+
$plpython->AddLibrary($pyprefix ."\\Libs\\python$pyver.lib");
155162
$plpython->AddReference($postgres);
156163
}
157164

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp