[Apache-dispatch-devel] SF.net SVN: apache-dispatch: [22] trunk
Brought to you by:
geoffrey_young,
phred_moyer
|
From: <phr...@us...> - 2006-04-21 07:05:50
|
Revision: 22 Author: phred_moyer Date: 2006-04-21 00:05:46 -0700 (Fri, 21 Apr 2006) ViewCVS: http://svn.sourceforge.net/apache-dispatch/?rev=22&view=rev Log Message: ----------- - PUREPERL option somewhat functional now but make failing during XS build. Modified Paths: -------------- trunk/Makefile.PL trunk/set_pureperl.PL Modified: trunk/Makefile.PL =================================================================== --- trunk/Makefile.PL 2006-04-21 06:31:46 UTC (rev 21) +++ trunk/Makefile.PL 2006-04-21 07:05:46 UTC (rev 22) @@ -17,7 +17,6 @@ 'PREREQ_PM' => \%prereq, ); - # enable "make test" require Apache::TestMM; Apache::TestMM->import(qw(test clean)); @@ -38,13 +37,16 @@ ModPerl::MM::WriteMakefile(%makefile_params); } -elsif ($mp_wanted != 2) { # mod_perl1 specific makefile +elsif ($mp_wanted != 2) { # mod_perl1 specific makefile eval { require Apache::ExtUtils; require Apache::src; }; + # Build directives using xs or PerlSetVar + my $pureperl; + if ($@ || $ENV{DISPATCH_PUREPERL}) { print "\nBuilding without Custom Apache Directives, use 'PerlSetVar' for configuration.\n\n"; @@ -61,24 +63,22 @@ require Apache::Dispatch; my $directives = Apache::Dispatch->directives; - Apache::Extutils::command_table($directives); + command_table($directives); - my $inc = Apache::src->new->inc; - die "Can't find mod_perl header files installed" unless $inc; - - $makefile_params{'INC'} = $inc; $makefile_params{'PL_FILES'} = {'set_pureperl.PL' => '0'}; - $makefile_params{'PREREQ_PM'} = {mod_perl => 1.2401,}; - $makefile_params{'clean'} = {FILES => '*.xs*'}; - $makefile_params{'NAME'} = 'Apache2::Dispatch'; - - require ExtUtils::MakeMaker; - ExtUtils::MakeMaker::WriteMakefile( - INC => $inc, - LIBS => [''], - %makefile_params, - ); + $makefile_params{'PREREQ_PM'} = {mod_perl => 1.2401,}; + $makefile_params{'clean'} = {FILES => '*.xs*'}; } + + my $inc = Apache::src->new->inc; + die "Can't find mod_perl header files installed" unless $inc; + require ExtUtils::MakeMaker; + ExtUtils::MakeMaker::WriteMakefile( + NAME => 'Apache::Dispatch', + INC => $inc, + LIBS => [''], + %makefile_params, + ); } # The next sub inspired by Apache::Peek 1.05 @@ -141,16 +141,3 @@ return ($wanted, $mp_ver); } -__END__ - -open (FH,catfile(qw(blib lib Apache Dispatch.pm))) || die "cannot read Dispatch.pm: $!"; -my $code=join('',<FH>); -close FH; - -$code=~s/%%PUREPERL%%/$pureperl/; - -open (OUT,">".catfile(qw(blib lib Apache Dispatch.pm))) || die "cannot write to Dispatch.pm: $!"; -print OUT $code; -close OUT; - - Modified: trunk/set_pureperl.PL =================================================================== --- trunk/set_pureperl.PL 2006-04-21 06:31:46 UTC (rev 21) +++ trunk/set_pureperl.PL 2006-04-21 07:05:46 UTC (rev 22) @@ -1,21 +1,22 @@ use strict; +use warnings FATAL => 'all'; + use File::Spec::Functions; my $pureperl=shift(@ARGV); -my $dispatch=catfile(qw(blib lib Apache Dispatch.pm)); +my $dispatch=catfile(qw(lib Apache Dispatch.pm)); -open (FH,$dispatch) || die "cannot read Dispatch.pm: $!"; -my $code=join('',<FH>); -close FH; +my $fh; +open ($fh,$dispatch) || die "cannot read Dispatch.pm: $!"; +my $code=join('',<$fh>); +close $fh; chmod(0755,$dispatch); -$code=~s/'PUREPERL'/$pureperl/; +$code =~ s{(\$Apache::Dispatch::PUREPERL\=)\d}{$1$pureperl}; -open (OUT,">$dispatch") || die "cannot write to Dispatch.pm: $!"; -print OUT $code; -close OUT; +open ($fh,">", $dispatch) || die "cannot write to Dispatch.pm: $!"; +print $fh $code; +close $fh; - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |