httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: starting apreq 2.0
Date Fri, 12 Apr 2002 18:50:50 GMT

  Joe Schaefer wrote:
 > Stas Bekman <> writes:
 >>OK, I've started porting the apreq as an in-core httpd-2.0 library
 >>first. Got the first foo?test=good working over mod_example :)
 >>Most of the pain to start with was to figure out how all the libtool
 >>setup works within httpd-2.0. It seems that it's almost ok now.
 >>Once this library is in httpd-2.0, the Perl glue will come as a part of
 >>modperl-2.0, therefore it's most likely that we won't need httpd-apreq
 >>rep for 2.0. (assuming that httpd folks accept this library in core)
 >>will keep you posted as I get a chance to work more on this library.
 > Great!  A few days ago, I noticed that apr(util?) supports apache-1 
 > and arrays, so it should be a simple matter of porting (tm) the ap_*
 > prefixes to apr_ ones.  I also tried to figure out how the new modperl 2
 > "glue" works (Request.xs uses xsubpp), but I couldn't find enough doc's
 > that explained the process.  It should be a lot clearer to me after you
 > get it working :-)

Yes, the table stuff porting was a simple s///

It will be very easy to add the perl glue, but first we need to get
apreq into the core. Once it's there, we will do the perl glue.

Now if anybody knows libtool and how 2.0 uses it I could use some help
with it.

I've decided to build libapreq as a statically linked library similar
to libpcre, therefore I've placed it into
httpd-2.0/srclib/apreq. There a few other build files but the will look as something like this (probably the install
target could be made simpler):

LTLIBRARY_SOURCES = apreq_request.c apreq_cookie.c apreq_multipart_buffer.c

DISTCLEAN_TARGETS = apreq.h apreq-config config.h $(CLEAN_TARGETS)

include $(top_srcdir)/build/

	@echo Installing libapreq header files into $(includedir)
	@test -d $(includedir)     || $(MKINSTALLDIRS) $(includedir)
	@cp -p $(srcdir)/include/apreq_request.h $(includedir)
	@cp -p $(srcdir)/include/apreq_multipart_buffer.h $(includedir)
	@cp -p $(srcdir)/include/apreq_cookie.h $(includedir)

First of all I'm not sure if it's the right choice. Should it be a
shared library instead, similar to

Currently the automatic linking doesn't seem to statically link
libapreq with httpd by default. If for example I try to use functions
from libapreq in mod_example and build with --enable-example, libapreq
gets statically linked with httpd and everything is cool. But if I try
to build --enable-example=shared, libapreq won't get linked statically
with httpd and therefore things won't work. Anybody knows how to tell
libtool to link this library statically?

The final linking include all the .la's including:

... os/unix/
/home/stas/ ...

so it must be a libtool issue. I suppose it dynamically looks if
anybody is using symbols from each .la and only then statically links

I cannot figure out why does it work for libpcre (it gets linked
statically) but not for libapreq :(

I test whether static linking was done correctly with nm(1). if apreq
is used by statically linked mod_example (with some calls to apreq)
nm(1) shows apreq symbols in httpd. If I remove these calls from
mod_example nm(1) shows nada. of course I build with --enable-example.

Also since I don't have the perl glue yet, I'm trying to add a few
tests to httpd-test. Seems that once I resolve the linking issue I can
proceed with the rest of the porting and tests writing.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message