aboutsummaryrefslogtreecommitdiff
path: root/config/perl.m4
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2013-01-09 17:49:23 -0500
committerAndrew Dunstan <andrew@dunslane.net>2013-01-09 17:49:23 -0500
commit7fb97ecd137a879831ec6e3dce14c9f2e2a3d6b5 (patch)
tree6532464f2b19759ceeb32030b0886ca84fff6d51 /config/perl.m4
parent6e650a55cda9291bbeebd6b1aa6aedbd3d15e622 (diff)
downloadpostgresql-7fb97ecd137a879831ec6e3dce14c9f2e2a3d6b5.tar.gz
postgresql-7fb97ecd137a879831ec6e3dce14c9f2e2a3d6b5.zip
Detect Windows perl linkage parameters in configure script.
This means we can now construct a configure test for the library presence. Previously these parameters were only figured out at build time in plperl's GnuMakefile.
Diffstat (limited to 'config/perl.m4')
-rw-r--r--config/perl.m46
1 files changed, 6 insertions, 0 deletions
diff --git a/config/perl.m4 b/config/perl.m4
index d602a5bb1b0..0b43b04742e 100644
--- a/config/perl.m4
+++ b/config/perl.m4
@@ -38,6 +38,7 @@ AC_DEFUN([PGAC_CHECK_PERL_CONFIG],
[AC_REQUIRE([PGAC_PATH_PERL])
AC_MSG_CHECKING([for Perl $1])
perl_$1=`$PERL -MConfig -e 'print $Config{$1}'`
+test "$PORTNAME" = "win32" && perl_$1=`echo $perl_$1 | sed 's,\\\\,/,g'`
AC_SUBST(perl_$1)dnl
AC_MSG_RESULT([$perl_$1])])
@@ -57,9 +58,14 @@ AC_DEFUN([PGAC_CHECK_PERL_CONFIGS],
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"
+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"]`
+fi
AC_SUBST(perl_embed_ldflags)dnl
if test -z "$perl_embed_ldflags" ; then
AC_MSG_RESULT(no)