From: Andrew Dunstan Date: Fri, 5 Jun 2009 18:29:56 +0000 (+0000) Subject: Search for versioned perl library instead of using hardcoded name on Windows. Backpat... X-Git-Url: http://git.postgresql.org/gitweb/backend_dirs.html?a=commitdiff_plain;h=1735676910cdfda9078676426f937949c010f432;p=users%2Fsimon%2Fpostgres.git Search for versioned perl library instead of using hardcoded name on Windows. Backpatch to release 8.3 --- diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile index 09adae5501..a3c3495aac 100644 --- a/src/pl/plperl/GNUmakefile +++ b/src/pl/plperl/GNUmakefile @@ -19,7 +19,8 @@ ifneq (,$(findstring yes, $(shared_libperl)$(allow_nonpic_in_shlib))) 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. diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index 4754f16b27..66b7f6a928 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -104,14 +104,16 @@ sub mkvcbuild } } $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})