httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject Re: [multi-env] APR__Request__Param.h question
Date Wed, 02 Mar 2005 06:45:53 GMT
On Tue, 1 Mar 2005, Joe Schaefer wrote:

> Randy Kobes <randy@theoryx5.uwinnipeg.ca> writes:
>
> [...]
>
> > No problem - thanks. That is very strange that it would
> > be causing problems - I didn't notice the #if 0 #endif
> > surrounding it, but it is there. This is probably due
> > to some anomalies I'm seeing with ExtUtils::XSBuilder;
> > I'll look into this.
>
> Right, I just ported everything there except for the
> Apache::Upload::Brigade wrappers, and I will remove
> that garbage now to avoid any remaining Win32 problems.
> No need waste your time debugging something like this.

It turned out to be a strange (Win32) problem ...
Apache::Request wasn't installed into
blib/lib/Apache2/Apache/Request.pm (it went into
blib/lib/Apache/Request.pm), and so when running the tests,
it picked up an older Apache::Request from my system Perl,
which needed the symbol that the new libapreq2.dll doesn't
have. I'm not sure where the problem lies: this Makefile.PL

use Apache2;
use ModPerl::MM;
ModPerl::MM::WriteMakefile(
  NAME => 'foo',
);

with a lib/Apache/Bar.pm at the same level will install
it into blib/lib/Apache/Bar.pm (ie, without an Apache2
subdirectory, as happens on Unix). So it's something
either on the ModPerl::MM side, or perhaps ExtUtils::*.

As a workaround, I used this patch:
==========================================================
Index: glue/perl/Makefile.PL
===================================================================
--- glue/perl/Makefile.PL	(revision 155885)
+++ glue/perl/Makefile.PL	(working copy)
@@ -139,6 +139,7 @@
 package My::WrapXS;
 use base qw/ExtUtils::XSBuilder::WrapXS/;
 our $VERSION = $version;
+use constant WIN32 => ($^O =~ /Win32/i);

 ##################################################
 # Finally, we get to the actual script...
@@ -159,13 +160,24 @@
 Apache::TestSmokePerl->generate_script;
 Apache::TestReportPerl->generate_script;

-ModPerl::MM::WriteMakefile(
+my %opts = (
     NAME => 'libapreq2',
     DIR => [qw(xs)],
     clean => { FILES => "xs t/logs t/TEST @scripts" },
     realclean => { FILES => "xsbuilder/tables" },
 );

+if (WIN32) {
+    my $PM = {
+        'lib/Apache/Request.pm' => '$(INST_LIB)/Apache/Request.pm',
+        'lib/Apache/Upload.pm' => '$(INST_LIB)/Apache/Upload.pm',
+        'lib/Apache/Cookie.pm' => '$(INST_LIB)/Apache/Cookie.pm',
+    };
+    $opts{PM} = $PM;
+}
+
+ModPerl::MM::WriteMakefile(%opts);
+
 # That's the whole script - below is just a bunch of local overrides
 ##################################################
 sub get_functions {
=====================================================================

Does this look OK?

As well, with VC++ index(), used in
   glue/perl/xsbuilder/APR/Request/Param/Param.xs
isn't available. Is strchr() equivalent?

================================================================
Index: glue/perl/xsbuilder/APR/Request/Param/Param.xs
===================================================================
--- glue/perl/xsbuilder/APR/Request/Param/Param.xs	(revision 155885)
+++ glue/perl/xsbuilder/APR/Request/Param/Param.xs	(working copy)
@@ -585,7 +585,7 @@
     if (ct == NULL)
         Perl_croak(aTHX_ "$param->upload_type: can't find Content-Type header");

-    if ((sc = index(ct, ';')))
+    if ((sc = strchr(ct, ';')))
         len = sc - ct;
     else
         len = strlen(ct);

Property changes on: glue/perl/xsbuilder/APR/Request/Param/Param.xs
___________________________________________________________________
Name: svn:eol-style
   + native

=====================================================================

With the above 2 changes, the perl glue all builds, and the
tests pass, save for the expected failures at this point
in time.

-- 
best regards,
randy

Mime
View raw message