mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
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
This commit is contained in:
parent
c253b722f6
commit
1695ce0686
@ -87,7 +87,14 @@ AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
|
|||||||
AC_MSG_CHECKING(for flags to link embedded Perl)
|
AC_MSG_CHECKING(for flags to link embedded Perl)
|
||||||
if test "$PORTNAME" = "win32" ; then
|
if test "$PORTNAME" = "win32" ; then
|
||||||
perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib`
|
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"
|
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
|
else
|
||||||
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
|
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
|
||||||
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
|
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
|
||||||
|
9
configure
vendored
9
configure
vendored
@ -7528,7 +7528,14 @@ $as_echo "$perl_embed_ccflags" >&6; }
|
|||||||
$as_echo_n "checking for flags to link embedded Perl... " >&6; }
|
$as_echo_n "checking for flags to link embedded Perl... " >&6; }
|
||||||
if test "$PORTNAME" = "win32" ; then
|
if test "$PORTNAME" = "win32" ; then
|
||||||
perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
|
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"
|
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
|
else
|
||||||
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
|
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
|
||||||
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
|
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
|
||||||
|
@ -42,6 +42,14 @@
|
|||||||
#undef vsnprintf
|
#undef vsnprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ActivePerl 5.18 and later are MinGW-built, and their headers use GCC's
|
||||||
|
* __inline__. Translate to something MSVC recognizes.
|
||||||
|
*/
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define __inline__ inline
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the basic Perl API. We use PERL_NO_GET_CONTEXT mode so that our code
|
* Get the basic Perl API. We use PERL_NO_GET_CONTEXT mode so that our code
|
||||||
|
@ -614,9 +614,10 @@ sub mkvcbuild
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$plperl->AddReference($postgres);
|
$plperl->AddReference($postgres);
|
||||||
|
my $perl_path = $solution->{options}->{perl} . '\lib\CORE\*perl*';
|
||||||
|
# ActivePerl 5.16 provided perl516.lib; 5.18 provided libperl518.a
|
||||||
my @perl_libs =
|
my @perl_libs =
|
||||||
grep { /perl\d+.lib$/ }
|
grep { /perl\d+\.lib$|libperl\d+\.a$/ } glob($perl_path);
|
||||||
glob($solution->{options}->{perl} . '\lib\CORE\perl*.lib');
|
|
||||||
if (@perl_libs == 1)
|
if (@perl_libs == 1)
|
||||||
{
|
{
|
||||||
$plperl->AddLibrary($perl_libs[0]);
|
$plperl->AddLibrary($perl_libs[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user