httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2 patch] getting APR to work w/o modperl
Date Sat, 15 May 2004 21:55:13 GMT
Randy Kobes wrote:
> On Mon, 10 May 2004, Stas Bekman wrote:
> 
> 
>>How about a quick workaround as follows: For windows only,
>>link APR.so statically with all APR/Foo.o and the required
>>modperl_foo.o and arrange for the bootstrap not to call it
>>for windows if APR.so is loaded?
> 
> 
> That sounds good ... 

So can you try to tackle that? I guess my latest patch won't apply against the 
current cvs and I'll need to re-sync it and resolve collisions.

I guess all you need to do is to change xs/APR/APR/Makefile.PL to collect all 
.o files from under xs/APR and a few selected src/modules/perl/modperl_xxx.o 
and link them statically with APR.so if under win32. (and may be some other 
platforms too (aix comes to mind)).

> The only alternative I was able
> to come up with is to use LoadLibrary/GetProcAddress
> to set a function pointer to that of a function
> within a dll. I tried to cut this down to the
> minimal needed, and came up with something along
> the lines of, generically,
> 
> typdef ... /* delare the function pointers */
> 
> HINSTANCE hlib;
> if (GetProcAddresses(&hlib, "Some.dll",
>                      &fn_1, "func_1",
>                      &fn_2, "func_2",
>                      ...) {
>   /* the functions are available */
> }
> if (hlib != NULL) FreeLibrary(hlib);
> 
> where GetProcAddresses() is a simple (generic) routine that
> associates, from Some.dll, func_1, func_2, ... with fn_1,
> fn_2, ... So, in this approach, for each APR::* as
> appropriate, necessary function pointers must be declared,
> GetProcAddresses() is invoked, and finally, if necessary,
> FreeLibrary() called at the end.
> 
> However, I don't have enough experience with the build
> system to compare if the above would be easier or harder to
> set up and maintain, compared to linking against the
> appropriate .so files.

The biggest problem I see here, is that we won't be able to test whether 
things still work on windows, every time we change or add something. So I'd 
prefer not to use it. If this can be done automatically, without touching the 
existing code, then i guess it's OK. But I'm not quite sure this is possible.


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

Mime
View raw message