This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Apache with mod_perl up and running (was: Re: error compiling apache-1.3.33 with mod_perl and perl-5.8.7-1)


I wrote:

> Gerrit P. Haase writes:
>>> [...]  Would mod_perl work with a mod_so setup as well?
>>
>> Yes it should work.  Have you tried to link directly against the DLL?
>
> You mean against /usr/bin/libhttpd.dll?
>
> I've tried, but failed miserably so far.  I've been starting with the
> build procedure delivered with mod_perl (DO_HTTPD=1), which creates a
> different Apache than what I get from cygwin's setup.  I have yet to
> find out how cygwin's Apache has been built...

OK, I've got it up and running now.

There are a couple of gotchas, though, mainly with the mod_perl
installation procedures.  Be warned.

1) In the mod_perl directory, start as documented for creating a DSO
   mod_perl:

   $ perl Makefile.PL USE_APXS=1 EVERYTHING=1 WITH_APXS=/usr/sbin/apxs

2) Run make.

3)  Curse when trying to understand
3a) why it fails to resolve against the apache core and
3b) why the heck make is trying to create cygperl5_8.dll.

ad 3a): I haven't found a solution.  I guess one can set some
environment variable or to add some parameter to perl Makefile.PL, but
I haven't discovered *how*.  My workaround was to manually enter the
offending gcc command (wrapped for readability):

    gcc -shared -o  cygperl5_8.dll -Wl,--out-implib=libperl.dll.a \
    -Wl,--export-all-symbols -Wl,--enable-auto-import \
    -Wl,--stack,8388608 -Wl,--enable-auto-image-base -s -L/usr/local/lib \
    mod_perl.lo perlxsi.lo perl_config.lo perl_util.lo perlio.lo \
    mod_perl_opmask.lo Apache.lo Constants.lo ModuleConfig.lo \
    Log.lo URI.lo Util.lo Connection.lo Server.lo File.lo Table.lo \
    -s -s -L/usr/local/lib \
    /usr/lib/perl5/5.8/cygwin/auto/DynaLoader/DynaLoader.a \
    /usr/lib/perl5/5.8/cygwin/auto/Win32CORE/Win32CORE.a \
    -L/usr/lib/perl5/5.8/cygwin/CORE -lperl -lcrypt -lgdbm_compat

with two more parameters added:

    -L/usr/bin -lhttpd

ad 3b):  I had to find out that I couldn't simply resume make because
it would again try to compile all the .lo files into cygperl5_8.dll.
The simple reason:

   the target in the mod_perl makefile is 'libperl.so'.  However, ld2
   as invoked by the makefile calls perlld, which insists on having
   libperl.* renamed to cygperl5_8.dll in the -o parameter for the gcc
   command.

   We already know that - for archeological reasons - mod_perl's DSO
   library happens to have the same file name as perl's, eh?  Here's
   a place where this *really* bit me.

I copied cygperl5_8.dll to libperl.so to get make into believing that
the linking has been successful.  Nevertheless the apxs step failed,
telling me that libperl.so isn't a DSO library.  How would apxs know?

   On cygwin (and only on cygwin), apxs insists on having a suffix of
   .dll for DSOs.

So what I finally did was to manually copy cygperl5_8.dll to
/usr/lib/apache/mod_perl.dll and changed /etc/apache/httpd.conf
myself.

I apologize for not going deeper into the subject and for not trying
to create the necessary patches to the procedures and the
documentation right now.  As I already mentioned, compiling mod_perl
was just a step aside during my attempts to add mod_auth_kerb to my
cygwin apache.
-- 
Cheers,
haj

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]