httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristian Gafton <gaf...@redhat.com>
Subject Patch: apache/linux modules
Date Tue, 03 Feb 1998 20:20:31 GMT
On Tue, 3 Feb 1998, Jim Jagielski wrote:

> Not that it matters, but something like this would be very, very easy
> with Configure as well. If ./configure can do something then we can
> make ./Configure do it as well. The "advantage" to Configure, imo,
> is that it does only what we want and only how we want it done,
> without the extra baggage and "I know best" mode of autoconf.

I agree with you. There are also web servers written in PERL, but this
doesn't mean that are optimized.

As a proof of concept, I am attaching here the patch I have made for 1.2.5
(and tested for 1.2.6 dev) for having the modules loaded at run time, if
you compile them as shared libraries. You'll notice how ugly Configure
gets when you try to do something else - compile a list of files (mod_*.c)
as shared objects. You will notice the lack of Makefile generating
support, the fact that Makefiles are always hacked to keep them working on
all systems, etc. When with autoconf you have a set of macros that will
generate the correct makefiles for you. And regarding Makefiles, yes,
autoconf knows best.

Enough autoconf ranting, about the patch: This is work in progress and it
is a patch against cvs 1.2.6 dev as of yesterday. If you enable the
DYNAMIC_MODULES rule in Configuration one will get the modules compiled as
shared objects. Currently tested on Linux/glibc, but is=t should work with
few modifications (if any)  on FreeBSD. The whole hack is #ifdef-ed, so if
you don't enable it the sources are unaffected. 

Things to impove further:
	- the directory where one will store the mod_*.so files is
hardcoded (#defined in the source). I've tried to reduce the mess done by
this patch, but this could definitely be improved.
	- I did not get (yet) the proxy module to work, so if you want
shared modules and proxy this patch is one version too early for you.
	- Being a proof of concept, I didn't take the time to dlclose()
the modules when the apache server dies or is restarted. This should be
trivial now.
	- The patch assumes that one will use gcc to build the shared
objects. autoconf/libtool could be handy here, but expanding the huge case
statement from Configure to include even more platform specific things is
also an option.

As far as I have been able to determine, there is no memory/speed impact
on the server when using the modules as shared objects. 

Please, anyone with some time on their hands and a system that supports
the shared objects take a look at this patch and tell me what you think.

> There's nothing wrong with reinventing the wheel, if what you are after
> is a faster, leaner and more specialized wheel. :/

Which is what autoconf/automake/libtool suite is.

Best wishes,

Cristian
--
----------------------------------------------------------------------
Cristian Gafton   --   gafton@redhat.com   --   Red Hat Software, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 UNIX is user friendly. It's just selective about who its friends are.


Mime
View raw message