summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorNoah Misch2017-11-24 04:22:04 +0000
committerNoah Misch2017-11-24 04:22:04 +0000
commit84c4313c6f6a3f67ccc2296e5a7674dee1979e7a (patch)
treecdaccce7a9bde63c08f5026183a7b7cba0514475 /config
parent59b71c6fe6ca89566f40439bcdff94a2f5b39a92 (diff)
Support linking with MinGW-built Perl.
This is necessary for ActivePerl 5.18 onwards and for Strawberry Perl. It is not sufficient for 32-bit builds with newer Visual Studio; these fail with error LINK2026. Back-patch to 9.3 (all supported versions). Reported by Victor Wagner. Discussion: https://postgr.es/m/20160326154321.7754ab8f@wagner.wagner.home
Diffstat (limited to 'config')
-rw-r--r--config/perl.m417
1 files changed, 12 insertions, 5 deletions
diff --git a/config/perl.m4 b/config/perl.m4
index 8c21d0fb395..76b1a92e3a0 100644
--- a/config/perl.m4
+++ b/config/perl.m4
@@ -83,12 +83,19 @@ AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
[AC_REQUIRE([PGAC_PATH_PERL])
AC_MSG_CHECKING(for flags to link embedded Perl)
if test "$PORTNAME" = "win32" ; then
-perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib`
-test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
+ perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib`
+ if test -e "$perl_archlibexp/CORE/$perl_lib.lib"; then
+ perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
+ else
+ perl_lib=`basename $perl_archlibexp/CORE/libperl[[5-9]]*.a .a | sed 's/^lib//'`
+ if test -e "$perl_archlibexp/CORE/lib$perl_lib.a"; then
+ perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
+ fi
+ fi
else
-pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
-pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
-perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
+ pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
+ pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
+ perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
fi
AC_SUBST(perl_embed_ldflags)dnl
if test -z "$perl_embed_ldflags" ; then