Hi all,

I'm trying to pass some ENV from mp2's Makefile.PL to 
Apache::Test::generate_script() so that when it
is generated ./t/TEST will work out of the box on platforms who's linkers get 
-rpath wrong.
As it stands, my patch only fixes mp2's 'make test'  which is good cause thats 
like 90% :)

As far as I can see, I don't see a yet coded way to do this:

======
# generate t/TEST script (or a different filename) which will drive
# Apache::TestRun
sub generate_script {
    my ($class, @opts) = @_;
======

I'm thinking of hijacking @opts in the CALLER like so
   ->generate_script(env => { VAR => VAL });

   $body . = $ENV{VAR} =  q|VAL|; .....

Objections ?



-- 
------------------------------------------------------------------------
Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

When I call your name, Girl, it starts to flame
Burning in my heart, Tearing it all apart..
No matter how I try My love I cannot hide....
Index: Makefile.PL
===================================================================
--- Makefile.PL (revision 450701)
+++ Makefile.PL (working copy)
@@ -768,6 +768,31 @@
     else {
         # PASSENV confuses the Win32 command-line build
         my $env = Apache::TestConfig->passenv_makestr();
+
+        # this is not in A-T because we don't want to affect everyone
+        # using A-T just mod_perl2's test suite environment
+        # take care to preserve existing SHELL LD_LIBRARY_PATH
+        # by PREPENDING
+        # All this to work around "broken" linkers on some platforms
+        # that refuse to get -rpaths correct....
+        # XXX: ./t/TEST will still fail on one of these platforms.
+        my $ldpath;
+        for ($build->apu_config_path, $build->apr_config_path) {
+            if (my $link = $_ && -x $_ && qx{$_ '--link-ld'}) {
+                chomp $link;
+                while ($link =~ /\-L(.*)\s+/g) {
+                    $ldpath .= "$1:";
+                }
+            }
+        }
+
+        if ($ldpath) {
+            $env .= " LD_LIBRARY_PATH=$ldpath";
+            $env .= ":$ENV{LD_LIBRARY_PATH}" if exists $ENV{LD_LIBRARY_PATH};
+
+            $env =~ s/:$//;
+        }
+
         $preamble = <<EOF;
 PASSENV = $env
 EOF

Reply via email to