1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Make plpythonu language use plpython2 shared library directly.

The original scheme for this was to symlink plpython.$DLSUFFIX to
plpython2.$DLSUFFIX, but that doesn't work on Windows, and only
accidentally failed to fail because of the way that CREATE LANGUAGE created
or didn't create new C functions.  My changes of yesterday exposed the
weakness of that approach.  To fix, get rid of the symlink and make
pg_pltemplate show what's really going on.
This commit is contained in:
Tom Lane
2011-03-05 15:13:15 -05:00
parent ba0c93a0f4
commit bfd7f8cbb2
5 changed files with 14 additions and 14 deletions

View File

@ -172,8 +172,8 @@ sub mkvcbuild
if ($solution->{options}->{python})
{
# Attempt to get python version and location. Assume python.exe in specified dir.
# Attempt to get python version and location.
# Assume python.exe in specified dir.
open(P,
$solution->{options}->{python}
. "\\python -c \"import sys;print(sys.prefix);print(str(sys.version_info[0])+str(sys.version_info[1]))\" |"
@ -184,11 +184,14 @@ sub mkvcbuild
chomp($pyver);
close(P);
# Sometimes (always?) if python is not present, the execution actually works, but gives no data...
# Sometimes (always?) if python is not present, the execution
# appears to work, but gives no data...
die "Failed to query python for version information\n"
if (!(defined($pyprefix) && defined($pyver)));
my $plpython = $solution->AddProject('plpython','dll','PLs','src\pl\plpython');
my $pymajorver = substr($pyver, 0, 1);
my $plpython = $solution->AddProject('plpython' . $pymajorver, 'dll',
'PLs', 'src\pl\plpython');
$plpython->AddIncludeDir($pyprefix . '\include');
$plpython->AddLibrary($pyprefix . "\\Libs\\python$pyver.lib");
$plpython->AddReference($postgres);