You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Jim Helm <jj...@att.net> on 2002/04/02 08:59:23 UTC
PERL5LIB patch to 1.26_01-dev
I asked about this a few days ago, and got some help from Matt. But, it
didn't solve all the problems I was having running 'make test'. I have
all my add-on modules installed non-locally (i.e. not in default perl
tree but elsewhere with a PERL5LIB defined) in /appl/perl/lib - we're
trying to keep all app related modules out of the /usr/local tree to
separate the app from the o/s. Anyway, I cleaned up my initial attempts
at fixing it, and here are a couple of patches (Makefile.PL and
t/conf/httpd.conf-dist) that get 'make test' to work with a user-defined
PERL5LIB. I've been around long enough to know not to complaing about
something if you aren't willing to fix it.
The only remaining step an end-user would need to perform after these
patches are applied is to add t/docs/local.pl with a use lib statement
matching their PERL5LIB. I think that's only necessary for running under
-T since the PERL5LIB won't get passed. All I know is that some tests
didn't run without it, and adding it fixed them (I got some hints from
the comments and code in the startup.pl).
Originally I had the PassEnv line in the global section of httpd.conf,
but after a little digging found that it was really only needed in the
cgi-bin Location block.
One other item of note; perl -cw Makefile.PL complains that (among other
things)
Useless use of string eq in void context at Makefile.PL.orig line 2476
my $bincompat = $Config{bincompat5005} and
$Config{bincompat5005} eq 'define';
Maybe there should be some parens to force the desired precedence here?
Or maybe use '&&' instead of 'and'?
Comments/suggestions (please)? I love mod_perl, but getting the test
suite to work sometimes can be a real pain under anything but a generic
perl/apache install. At least that's been my experience under Solaris
with things like mod_ssl/mod_perl DSOs - which I gave up on long ago.
TIA
Jim
--- Makefile.PL.orig Sun Mar 24 10:57:36 2002
+++ Makefile.PL.patched Mon Apr 1 22:19:26 2002
@@ -96,7 +96,9 @@
my $PWD = cwd;
$ENV{APACHE_CWD} = $PWD;
-$ENV{PERL5LIB} = join ':', "$PWD/lib", $ENV{PERL5LIB};
+$ENV{PERL5LIB} = defined($ENV{PERL5LIB}) ?
+ "$PWD/lib$Config{path_sep}$ENV{PERL5LIB}" :
+ "$PWD/lib" ;
my %SSL = (
"modules/ssl/apache_ssl.c" => "Ben-SSL",
@@ -1502,7 +1504,7 @@
@(cd t/conf; test -f httpd.conf || cp httpd.conf-dist
httpd.conf)
@(cd t/net; test -f config.pl || cp config.pl.dist config.pl)
@$(TOUCH) t/conf/srm.conf
- $(APACHE_SRC)/$(HTTPD) -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t
&
+ $(PERL5LIB) $(APACHE_SRC)/$(HTTPD) -f `pwd`/t/conf/httpd.conf -X
-d `pwd`/t &
@echo httpd listening on port $(PORT)
@echo will write error_log to: t/logs/error_log
@echo "letting apache warm up...\c"
@@ -1510,12 +1512,12 @@
@echo done
start_httpd_fork:
- $(APACHE_SRC)/$(HTTPD) -f `pwd`/t/conf/httpd.conf -d `pwd`/t
+ $(PERL5LIB) $(APACHE_SRC)/$(HTTPD) -f `pwd`/t/conf/httpd.conf -d
`pwd`/t
rehttpd: kill_httpd start_httpd
run_tests:
- $(FULLPERL) $(MP_TEST_SCRIPT) $(TEST_VERBOSE)
+ $(PERL5LIB) $(FULLPERL) $(MP_TEST_SCRIPT) $(TEST_VERBOSE)
),
--- httpd.conf-dist.orig Fri Apr 27 09:52:19 2001
+++ httpd.conf-dist.patched Mon Apr 1 22:25:35 2002
@@ -136,6 +136,7 @@
<Location /cgi-bin>
SetHandler cgi-script
+PassEnv PERL5LIB
Options +ExecCGI
</Location>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org