Brad Lanam wrote:
On Fri, Jan 02, 2004 at 02:21:13PM -0800, Stas Bekman wrote:

How about the following trickery. It arranges that LDDFLAGS will come after
LIBS, making sure that apache's -Rpath will come in first. This is untested.


    No.  I don't think that's a good idea.
    LDDLFLAGS has a bunch of -L args, and those have to appear
    before the libraries.

This patch works:

good, a few comments:


+if (SOLARIS) {
+    # make sure that all -L, -R from libs are moved
+    # to lddflags.
+    my $tflags = $libs;

What's the mnemonic for $tflags?


+ $tflags =~ s{-[^LR]\S+}{}g;

So you want $tflags to contain only /-[LR]\S+/g. Which means that a different pattern is needed. How about:


my $tflags = join " ", $libs =~ /(-[LR]\S+)/g;

+    # -R makes sure that these paths will be used
+    $tflags =~ s{-L(\S+)}{-L$1 -R$1}g;
+    $args{LDDLFLAGS} = $tflags . $build->perl_config('lddlflags');

$args{LDDLFLAGS} = $tflags . " " . $build->perl_config('lddlflags');


does this work?

Index: xs/APR/APR/Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.18
diff -u -r1.18 Makefile.PL
--- xs/APR/APR/Makefile.PL      5 Nov 2003 08:29:17 -0000       1.18
+++ xs/APR/APR/Makefile.PL      2 Jan 2004 23:38:26 -0000
@@ -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,19 @@
     $libs =~ s{(\w+)\.lib}{-l$1}g;
 }

-ModPerl::BuildMM::WriteMakefile(
-    'NAME'        => 'APR',
-    'VERSION_FROM' => 'APR.pm',
-    'LIBS'         => [$libs],
-);
+if (SOLARIS && $libs) {
+    # make sure that all -L, -R from libs are moved
+    # to the beginning of lddflags.
+    my $tflags = join " ", $libs =~ /(-[LR]\S+)/g;
+
+    # -R makes sure that these paths will be used
+    $tflags =~ s{-L(\S+)}{-L$1 -R$1}g;
+    $args{LDDLFLAGS} = $tflags . " " . $build->perl_config('lddlflags');
+
+    # leave -L in libs -- MakeMaker needs it.
+    $libs =~ s{-R\S+}{}g;
+}
+
+$args{LIBS} = [$libs] if $libs;
+
+ModPerl::BuildMM::WriteMakefile(%args);

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to