# Makefile for PL/Perl
-# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.36 2008/10/02 08:11:11 petere Exp $
+# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.37 2009/06/05 18:29:56 adunstan Exp $
subdir = src/pl/plperl
top_builddir = ../../..
ifeq ($(PORTNAME), win32)
perl_archlibexp := $(subst \,/,$(perl_archlibexp))
perl_privlibexp := $(subst \,/,$(perl_privlibexp))
-perl_embed_ldflags = -L$(perl_archlibexp)/CORE -lperl58
+perl_lib := $(basename $(notdir $(wildcard $(perl_archlibexp)/CORE/perl[5-9]*.lib)))
+perl_embed_ldflags = -L$(perl_archlibexp)/CORE -l$(perl_lib)
override CPPFLAGS += -DPLPERL_HAVE_UID_GID
# Perl on win32 contains /* within comment all over the header file,
# so disable this warning.
#
# Package that generates build files for msvc build
#
-# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.39 2009/04/07 19:35:57 mha Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.40 2009/06/05 18:29:56 adunstan Exp $
#
use Carp;
use Win32;
}
}
$plperl->AddReference($postgres);
- if (-e $solution->{options}->{perl} . '\lib\CORE\perl510.lib')
+ my @perl_libs = grep {/perl\d+.lib$/ }
+ glob($solution->{options}->{perl} . '\lib\CORE\perl*.lib');
+ if (@perl_libs == 1)
{
- $plperl->AddLibrary($solution->{options}->{perl} . '\lib\CORE\perl510.lib');
- }
- else
- {
- $plperl->AddLibrary($solution->{options}->{perl} . '\lib\CORE\perl58.lib');
+ $plperl->AddLibrary($perl_libs[0]);
}
+ else
+ {
+ die "could not identify perl library version";
+ }
}
if ($solution->{options}->{python})