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:

    -- Brad

--- x/xs/APR/APR/Makefile.PL    Wed Nov  5 00:29:17 2003
+++ mod_perl-1.99_12/xs/APR/APR/Makefile.PL     Fri Jan  2 14:33:31 2004
@@ -7,9 +7,16 @@
 use Config;

 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' : '';
@@ -23,9 +30,20 @@
     $libs =~ s{/libpath:}{-L}g;
     $libs =~ s{(\w+)\.lib}{-l$1}g;
 }
+if (SOLARIS) {
+    # make sure that all -L, -R from libs are moved
+    # to lddflags.
+    my $tflags = $libs;
+    $tflags =~ s{-[^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;
+}

-ModPerl::BuildMM::WriteMakefile(
-    'NAME'        => 'APR',
-    'VERSION_FROM' => 'APR.pm',
-    'LIBS'         => [$libs],
-);
+$args{LIBS} = [$libs] if $libs;
+
+ModPerl::BuildMM::WriteMakefile(%args);

--
   -- Brad Lanam      [EMAIL PROTECTED]

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

Reply via email to