httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graham Dumpleton" <graham.dumple...@gmail.com>
Subject Re: APXS question
Date Mon, 23 Jul 2007 22:31:48 GMT
On 24/07/07, Farokh Irani <farokh@mcfsoftware.com> wrote:
> >>  >It does unfortunately look like you're invoking apxs in such a way as
> >>>to install two DSO's, not to link two pieces of object code into a
> >>>single DSO.
> >>
> >>I tried to use the .la files (as you mentioned in a different message) as in:
> >>apxs -i -n mod_fancy mod_fancy.la config.la
> >>
> >>Unfortunately, apxs generated two .so files, mod_fancy.so and
> >>config.so. It seems that apxs doesn't want to link multiple .la files
> >>into one .so as it does if I passed it .cpp files.
> >>
> >>I think that what I'm going to have to do is to create a single
> >>library out of everything and then use apxs to install that. Anyone
> >>have thoughts on that?
> >
> >Huh. If you use the -c option correctly, ie., list all source code,
> >object files with one invocation of apxs then all the source file
> >object files, plus other object files, should be combined into one
> >loadable module at that point.
> >
> >I see the problem now. You have:
> >
> >%.o : %.cpp
> >  apxs -S CC=g++ -c $<
> >
> >which is just wrong. You shouldn't be calling apxs on each source file
> >separately. Instead do something like:
> >
> >SRCS=   mod_python.c _apachemodule.c requestobject.c tableobject.c util.c \
> >                serverobject.c connobject.c filterobject.c hlist.c \
> >                hlistobject.c finfoobject.c
> >
> >mod_python.la: $(SRCS)
> >        $(APXS) $(INCLUDES) -c $(SRCS) $(LDFLAGS) $(LIBS)
> >
> >The name of the output module will use the basename of the first code
> >file listed in the list of source files in this case.
>
> The problem is that I don't want apxs recompiling everything each
> time I make a change. I'm looking at something like 100 files in the
> total module.

Then you will need to go the library route then. Eg:

        apxs -i mod_fancy.c -lyourlib

Still suggest doing the compilation of Apache specific files with apxs
and link to others from library.

If the library is a shared library, then the library will be
dynamically dragged in at run time and shared between processes.

If the library is a static library, then libtool within apxs will
unpack the object files out of your .a and incorporate them into your
Apache module.

In the latter, if the object files in the .a aren't position
independent, it is possible on some platforms that when the Apache
module is loaded into the Apache process that it will need to perform
address relocations with the result that rather than module being
completely shared, it will turn into local process private memory, so
use of shared library preferred.

Graham

Mime
View raw message