Stas Bekman wrote:
Stas Bekman wrote:

Hmm, for some reason I get t/api/module.t failing on perl's test modules when buildiing with 2.0.49:

    my $mmn_major = $cfg->{httpd_info}{MODULE_MAGIC_NUMBER_MAJOR};
    my $mmn_minor = $cfg->{httpd_info}{MODULE_MAGIC_NUMBER_MINOR};
    for (my $modp = $top_module; $modp; $modp = $modp->next) {
        my $name = $modp->name;
        ok $name;
        t_debug("Testing module: " . $modp->name);
        ok t_cmp $modp->ap_api_major_version, $mmn_major;
        # fails the next line
        ok $modp->ap_api_minor_version <= $mmn_minor;
        t_debug(sprintf "minor: api=%d, mmn_=%d",
                $modp->ap_api_minor_version, $mmn_minor);
        ok $modp->module_index >= 0;
        my $cmds = $modp->cmds;
        ok !defined($cmds) || ref($cmds) eq 'Apache2::Command';
    }


# Testing module: TestDirective::perlloadmodule4 # expected: 20020903 # received: 20020903 ok 49 not ok 50 # minor: api=9, mmn_=7 ok 51 ok 52 ok 53

apache modules are just fine:

# Testing module: core.c
# expected: 20020903
# received: 20020903
ok 289
ok 290
# minor: api=7, mmn_=7
ok 291
ok 292

gozer, what your smokes say? or is it still a planned thing to set up things for modperl?


OK, I see the reason for this problem, we get includes for unrelated source directories. I build with:

perl Makefile.PL MP_GENERATE_XS=1 MP_USE_DSO=1 MP_DEBUG=1 MP_TRACE=1 MP_USE_GTOP=0 MP_APXS=/home/stas/httpd/prefork-2.0.49/bin/apxs MP_CCOPTS='-DMP_IOBUFSIZE=16384' MP_MAINTAINER=1 && make && make test

So it should use the include dir -I/home/stas/httpd/prefork-2.0.49/include/ but instead it includes -I/home/stas/apache.org/modperl-2.0/../httpd-2.0/include, which it shouldn't even know about. Looks like again we get hit by too much guesswork.

As a result of that mod_perl get compiled with the wrong includes.

The following fixes the problem. It will only search the httpd source if $self->{MP_AP_PREFIX} was set. In all other cases it should use apxs.


Index: lib/Apache2/Build.pm
===================================================================
--- lib/Apache2/Build.pm        (revision 169579)
+++ lib/Apache2/Build.pm        (working copy)
@@ -940,7 +940,8 @@

     return $self->{dir} if $self->{dir};

-    if (IS_MOD_PERL_BUILD) {
+    # be careful with the guesswork, or may pick up some wrong headers
+    if (IS_MOD_PERL_BUILD && $self->{MP_AP_PREFIX}) {
         my $build = $self->build_config;

         if (my $bdir = $build->{'dir'}) {
@@ -1927,7 +1928,6 @@
         die "Can't find the mod_perl include dir (reason: $reason)";
     }

-    my $src = $self->dir;
     my $os = WIN32 ? 'win32' : 'unix';
     push @inc, $self->file_path("src/modules/perl", "xs");

@@ -1951,13 +1951,16 @@
         }
     }

-    for ("$src/modules/perl", "$src/include",
-         "$src/srclib/apr/include",
-         "$src/srclib/apr-util/include",
-         "$src/os/$os")
-      {
-          push @inc, $_ if -d $_;
-      }
+    if ($self->{MP_AP_PREFIX}) {
+        my $src = $self->dir;
+        for ("$src/modules/perl", "$src/include",
+             "$src/srclib/apr/include",
+             "$src/srclib/apr-util/include",
+             "$src/os/$os")
+            {
+                push @inc, $_ if -d $_;
+            }
+    }

     return [EMAIL PROTECTED];
 }


-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com

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



Reply via email to