Stas Bekman wrote:
Philippe M. Chiasson wrote:
There is already support in the modperl_exports.c generation code to exclude
certain functions depending on build options. So in summary, if we just
excluded modperl_io_apache_init() from modperl_exports.c when PERLIO is absent,
we would be good ? Or is there other modperl_perlio_ or modperl_io_ symbols
we should also skip ?
I'd prefer to see a generic solution, w/o needing to do that manually every time a new function is added. So if the trick suggested by Joe works, then we should better use it IMHO.
Sadly, we've explored that path before, and it turns out that it's nearly impossible. See lib/ModPerl/WrapXS.pm for all the export_file_* foo.
One way or another, at least for win32 folks, we will always need to generate similar files, with exclusions based on various perl options. So it's not a terrible thing IMO to keep continuing that way.
In any case, I've got the code ready to exclude things when under PERLIO, I just
want to confirm what we need to exclude. And unless I am wrong, this should also
have been a problem to people in the win32 land as well, no ?
No. Just try to build mp2 with 5.6.1 on linux and you will see what we are talking about.
After talking about this over with stas in irc-land, I've come to the conclusion that Joe's suggestion in the long run might prove to be a much better solution, and could even simplify things in the win32 world. So without further delay, here is the patch. (It does fix the modperl_io_apache_init() problem by itself, but other similar #ifdefed functions can now be worked on and removed from the exception cases in lib/ModPerl/WrapXS.pm:$ithreads_exports)
Index: lib/ModPerl/WrapXS.pm =================================================================== --- lib/ModPerl/WrapXS.pm (revision 111876) +++ lib/ModPerl/WrapXS.pm (working copy) @@ -1302,7 +1302,12 @@ next if $entry->{name} =~ /^($ithreads_exports)/; } ( my $name ) = $entry->{name} =~ /^modperl_(.*)/; - print $fh "const void *modperl_hack_$name = (const void *)modperl_$name;\n"; + print $fh <<"EOF"; +#ifndef modperl_$name +const void *modperl_hack_$name = (const void *)modperl_$name; +#endif + +EOF } }
-------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
signature.asc
Description: OpenPGP digital signature