You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2004/01/03 02:17:33 UTC
cvs commit: modperl-2.0 Changes
stas 2004/01/02 17:17:33
Modified: xs/APR/APR Makefile.PL
. Changes
Log:
On Solaris add a workaround for xs/APR/APR/Makefile.PL to build
APR.so, correctly linked against apr and apr-util libs, by addding the
missing -R paths corresponding to -L flags. EU::MM was adding them via
LD_RUN_PATH instead of using -R, but since perl's lddflags may have -R
it overrides LD_RUN_PATH. So explicitly add anything that may go into
LD_RUN_PATH via -R. Also make sure that -R coming from Apache will
appear first.
Submitted by: Brad Lanam <bl...@gentoo.com>
Revision Changes Path
1.19 +33 -7 modperl-2.0/xs/APR/APR/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -u -r1.18 -r1.19
--- Makefile.PL 5 Nov 2003 08:29:17 -0000 1.18
+++ Makefile.PL 3 Jan 2004 01:17:33 -0000 1.19
@@ -6,10 +6,18 @@
use Apache::Build ();
use Config;
-use constant WIN32 => Apache::Build::WIN32;
+use constant WIN32 => Apache::Build::WIN32;
+use constant SOLARIS => $^O eq 'solaris';
+
+my %args = (
+ 'NAME' => 'APR',
+ 'VERSION_FROM' => 'APR.pm',
+);
my $libs = '';
-if (my $apr_bindir = ModPerl::BuildMM::build_config()->apr_bindir()) {
+my $build = ModPerl::BuildMM::build_config();
+
+if (my $apr_bindir = $build->apr_bindir()) {
# XXX: this works only with libapr 0.9.2+
my $ext = WIN32 ? '.bat' : '';
@@ -24,8 +32,26 @@
$libs =~ s{(\w+)\.lib}{-l$1}g;
}
-ModPerl::BuildMM::WriteMakefile(
- 'NAME' => 'APR',
- 'VERSION_FROM' => 'APR.pm',
- 'LIBS' => [$libs],
-);
+if (SOLARIS && $libs) {
+ # EU::MM sets LD_RUN_PATH (for linking) based on -L options in LIBS.
+ # LD_RUN_PATH is getting overridden by the specified -R path.
+ # The -R specified is from the perl config's lddflags.
+ # Therefore -R has to be added with the appropriate paths rather
+ # than using LD_RUN_PATH, because it gets overridden.
+
+ # make sure that all -L, -R from libs are moved
+ # to the beginning of lddflags.
+ my $extralddflags = join " ", $libs =~ /(-[LR]\S+)/g;
+
+ # -R makes sure that these paths will be used
+ $extralddflags =~ s{-L(\S+)}{-L$1 -R$1}g;
+ $args{LDDLFLAGS} = $extralddflags . " " . $build->perl_config('lddlflags');
+
+ # -R are now copied to LDDFLAGS, but leave -L's in LIBS --
+ # EU::MM needs it.
+ $libs =~ s{-R\S+}{}g;
+}
+
+$args{LIBS} = [$libs] if $libs;
+
+ModPerl::BuildMM::WriteMakefile(%args);
1.297 +8 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.296
retrieving revision 1.297
diff -u -u -r1.296 -r1.297
--- Changes 23 Dec 2003 04:28:00 -0000 1.296
+++ Changes 3 Jan 2004 01:17:33 -0000 1.297
@@ -12,6 +12,14 @@
=item 1.99_13-dev
+On Solaris add a workaround for xs/APR/APR/Makefile.PL to build
+APR.so, correctly linked against apr and apr-util libs, by addding the
+missing -R paths corresponding to -L flags. EU::MM was adding them via
+LD_RUN_PATH instead of using -R, but since perl's lddflags may have -R
+it overrides LD_RUN_PATH. So explicitly add anything that may go into
+LD_RUN_PATH via -R. Also make sure that -R coming from Apache will
+appear first. [Brad Lanam <bl...@gentoo.com>]
+
'make dist' now generates and picks Apache-Test/META.yml which was
always reported missing, as it was included in Apache-Test/MANIFEST
[Stas]