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: starting apreq 2.0
Date Fri, 12 Apr 2002 18:50:50 GMT

  Joe Schaefer wrote:
 > Stas Bekman <stas@stason.org> 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 
tables
 > 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
Makefile.in will look as something like this (probably the install
target could be made simpler):

LTLIBRARY_NAME = libapreq.la
LTLIBRARY_SOURCES = apreq_request.c apreq_cookie.c apreq_multipart_buffer.c

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

include $(top_srcdir)/build/ltlib.mk

install:
	@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 libapr.so?

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/libos.la
/home/stas/apache.org/httpd-2.0-apreq/srclib/pcre/libpcre.la
/home/stas/apache.org/httpd-2.0-apreq/srclib/apreq/libapreq.la
/home/stas/apache.org/httpd-2.0-apreq/srclib/apr-util/libaprutil.la ...

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
it.

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
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