in the perlframework if you run perl Makefile.PL without passing apxs as
an argument or having it wrong, the whole thing goes havoc, the following
patch does the required testing:

Index: Apache-Test/lib/Apache/TestConfigC.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigC.pm,v
retrieving revision 1.3
diff -u -r1.3 TestConfigC.pm
--- Apache-Test/lib/Apache/TestConfigC.pm       2001/08/11 17:56:30
1.3
+++ Apache-Test/lib/Apache/TestConfigC.pm       2001/08/22 02:58:30
@@ -99,6 +99,13 @@
     my $makefile = "$mod->{dir}/Makefile";
     notice "writing $makefile";

+    # make sure that we can compile the C modules
+    unless (exists $self->{MP_APXS} and -e $self->{MP_APXS}) {
+        error "apxs' location is wrong|undef, make sure that you run:\n"
+            . "perl Makefile.PL apxs /path/to/apxs";
+        die "\n";
+    }
+
     open my $fh, '>', $makefile or die "open $makefile: $!";

     print $fh <<EOF;

do we always need apxs? if so may be we move the check earlier in the flow
and abort the flow if apxs is not set or set to a wrong value?

also I think that the following patch can be useful too, but per my above
note it's a duplication, which better should be done as early as possible:


Index: Apache-Test/lib/Apache/TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.37
diff -u -r1.37 TestConfig.pm
--- Apache-Test/lib/Apache/TestConfig.pm        2001/08/20 23:27:06
1.37
+++ Apache-Test/lib/Apache/TestConfig.pm        2001/08/22 02:58:30
@@ -205,7 +205,14 @@
 sub configure_apxs {
     my $self = shift;

-    return unless $self->{MP_APXS} = $self->default_apxs;
+    $self->{MP_APXS} = $self->default_apxs;
+    return unless $self->{MP_APXS};
+
+    unless (-e $self->{MP_APXS}) {
+        error "cannot find apxs at [$self->{MP_APXS}]";
+        die "\n";
+    }
+
     my $vars = $self->{vars};

     $vars->{bindir}   ||= $self->apxs('SBINDIR');

BTW, Doug even if you don't want to verify the settings, I'd rather write:

    $self->{MP_APXS} = $self->default_apxs;
    return unless $self->{MP_APXS};

and not:

   return unless $self->{MP_APXS} = $self->default_apxs;

to improve the clarity. Otherwise you have to think twice to make sure
that there is no bug in this code and you didn't mean == instead of =.
or is it a bug and it should be ==?  :)

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://localhost/      http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



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

Reply via email to