Skip to content

Commit 7fb97ec

Browse files
committed
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.
1 parent 6e650a5 commit 7fb97ec

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

config/perl.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ AC_DEFUN([PGAC_CHECK_PERL_CONFIG],
3838
[AC_REQUIRE([PGAC_PATH_PERL])
3939
AC_MSG_CHECKING([for Perl $1])
4040
perl_$1=`$PERL -MConfig -e 'print $Config{$1}'`
41+
test "$PORTNAME" = "win32" && perl_$1=`echo $perl_$1 | sed 's,\\\\,/,g'`
4142
AC_SUBST(perl_$1)dnl
4243
AC_MSG_RESULT([$perl_$1])])
4344

@@ -57,9 +58,14 @@ AC_DEFUN([PGAC_CHECK_PERL_CONFIGS],
5758
AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
5859
[AC_REQUIRE([PGAC_PATH_PERL])
5960
AC_MSG_CHECKING(for flags to link embedded Perl)
61+
if test "$PORTNAME" = "win32" ; then
62+
perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib`
63+
test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
64+
else
6065
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
6166
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
6267
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
68+
fi
6369
AC_SUBST(perl_embed_ldflags)dnl
6470
if test -z "$perl_embed_ldflags" ; then
6571
AC_MSG_RESULT(no)

configure

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7320,24 +7320,32 @@ $as_echo "$as_me: error: Perl not found" >&2;}
73207320
{ $as_echo "$as_me:$LINENO: checking for Perl archlibexp" >&5
73217321
$as_echo_n "checking for Perl archlibexp... " >&6; }
73227322
perl_archlibexp=`$PERL -MConfig -e 'print $Config{archlibexp}'`
7323+
test "$PORTNAME" = "win32" && perl_archlibexp=`echo $perl_archlibexp | sed 's,\\\\,/,g'`
73237324
{ $as_echo "$as_me:$LINENO: result: $perl_archlibexp" >&5
73247325
$as_echo "$perl_archlibexp" >&6; }
73257326
{ $as_echo "$as_me:$LINENO: checking for Perl privlibexp" >&5
73267327
$as_echo_n "checking for Perl privlibexp... " >&6; }
73277328
perl_privlibexp=`$PERL -MConfig -e 'print $Config{privlibexp}'`
7329+
test "$PORTNAME" = "win32" && perl_privlibexp=`echo $perl_privlibexp | sed 's,\\\\,/,g'`
73287330
{ $as_echo "$as_me:$LINENO: result: $perl_privlibexp" >&5
73297331
$as_echo "$perl_privlibexp" >&6; }
73307332
{ $as_echo "$as_me:$LINENO: checking for Perl useshrplib" >&5
73317333
$as_echo_n "checking for Perl useshrplib... " >&6; }
73327334
perl_useshrplib=`$PERL -MConfig -e 'print $Config{useshrplib}'`
7335+
test "$PORTNAME" = "win32" && perl_useshrplib=`echo $perl_useshrplib | sed 's,\\\\,/,g'`
73337336
{ $as_echo "$as_me:$LINENO: result: $perl_useshrplib" >&5
73347337
$as_echo "$perl_useshrplib" >&6; }
73357338

73367339
{ $as_echo "$as_me:$LINENO: checking for flags to link embedded Perl" >&5
73377340
$as_echo_n "checking for flags to link embedded Perl... " >&6; }
7341+
if test "$PORTNAME" = "win32" ; then
7342+
perl_lib=`basename $perl_archlibexp/CORE/perl[5-9]*.lib .lib`
7343+
test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
7344+
else
73387345
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
73397346
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
73407347
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
7348+
fi
73417349
if test -z "$perl_embed_ldflags" ; then
73427350
{ $as_echo "$as_me:$LINENO: result: no" >&5
73437351
$as_echo "no" >&6; }

src/pl/plperl/GNUmakefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ endif
1616
ifeq ($(shared_libperl),yes)
1717

1818
ifeq ($(PORTNAME), win32)
19-
perl_archlibexp := $(subst \,/,$(perl_archlibexp))
20-
perl_privlibexp := $(subst \,/,$(perl_privlibexp))
21-
perl_lib := $(basename $(notdir $(wildcard $(perl_archlibexp)/CORE/perl[5-9]*.lib)))
22-
perl_embed_ldflags = -L$(perl_archlibexp)/CORE -l$(perl_lib)
2319
override CPPFLAGS += -DPLPERL_HAVE_UID_GID
2420
# Perl on win32 contains /* within comment all over the header file,
2521
# so disable this warning.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy