Doug MacEachern wrote:

> On Fri, 14 Dec 2001, Stas Bekman wrote:
> 
> 
>>I'm not satisfied with autogenerated 
>>WrapXS/Apache/SubProcess/SubProcess.pm, since I need to require 
>>APR::PerlIO in it, and I don't really want to create the SubProcess.xs 
>>and Makefile.PL in xs/Apache/SubProcess/. Do you think it's OK for 
>>WrapXS to check whether foo.pm already exists and not to generate it if 
>>so and use the existing one.
>>
> 
> try this:
> echo 'use APR::PerlIO ();' > xs/Apache/SubProcess/SubProcess_pm
> 
> the contents of SubProcess_pm will be included in the generated
> SubProcess.pm.


nice :) it's good enough for me to get going now.

What if the thing is trickier than just appending a line? I didn't 
resolve all the problems yet, but it seems that it *may* look like this:

package Apache::SubProcess;

our $VERSION = '0.01';
use Apache::XSLoader ();

if ($^V and $^V lt v5.7.2) {
     # XXX: make it 5.8.0 when it gets released
     warn "__PACKAGE__ can be used with perl 5.7.2 and onwards";
}
else {
     require APR::PerlIO;
}
    Apache::XSLoader::load __PACKAGE__;
1;

Also what was the trick to avoid the bootstrap if tried outside of 
modperl env?

     if ($ENV{MOD_PERL}) {
         __PACKAGE__->bootstrap($VERSION);
     }

But since Apache::SubProcess could be used outside of mod_perl, this is 
probably not good enough. The problem I have is that I need to add 
APACHE_TEST_CONFIGURE in the subprocess.pm and blows up on require 
outside mod_perl with a weird core:

warning: core file may not match specified executable file.
Core was generated by `/home/stas/perl/ithread/bin/perl 
/home/stas/apache.org/mp-subproc/t/TEST -confi'.
Program terminated with signal 11, Segmentation fault.
#0  0x403ccbea in ?? ()
(gdb) where
#0  0x403ccbea in ?? ()
#1  0x403bf6e2 in ?? ()
#2  0x403db99f in ?? ()
#3  0x403e2159 in ?? ()
#4  0x403e1acc in ?? ()
#5  0x400b7b10 in ?? ()
#6  0x400965f9 in ?? ()
#7  0x4003bf20 in ?? ()
#8  0x4003baa2 in ?? ()
#9  0x4004053b in ?? ()
#10 0x4004000e in ?? ()
#11 0x400798be in ?? ()
#12 0x40074471 in ?? ()
#13 0x4006850b in ?? ()
#14 0x400f7ac8 in ?? ()
#15 0x400f9b33 in ?? ()
#16 0x400965f9 in ?? ()
#17 0x4003aee6 in ?? ()
#18 0x4003a981 in ?? ()
#19 0x08049435 in ?? ()
#20 0x401ea6a0 in ?? ()

Everything is updated, but it still gives me this weird trace... :(

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.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