httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject FWD: Testing modules using Python
Date Tue, 05 Aug 2008 08:21:01 GMT
on Peter gave me the advice to build apache with the SHARED_CORE
rule. Apache 2.x does not have this rule anymore. Is there something comparable in Apache
Sorry for cross-posting but I think you are the guys who could help me.


Steven Mohr
Bachelor student

DLR (German Aerospace Center), 
Simulation and Software Technology
Linder Hoehe, 51147 Cologne, Germany
voice: +49 2203 601 2956  fax: +49 2203 601 3070
eMail: steven.mohr at

-----Urspr√ľngliche Nachricht-----
Von: Peter Poeml [] 
Gesendet: Montag, 4. August 2008 16:37
Betreff: Re: Testing modules using Python

On Mon, Aug 04, 2008 at 04:27:58PM +0200, wrote:
> Hi,
> I want to unit test my module ( using Python. My
> idea is to load the module with ctypes (a python module that allows to
> load functions from shared libraries into python) and test it in this
> environment. The main advantage is that it's much easier to create
> mock-up objects in Python than in C. My problem is that ctypes fails if
> the shared library contains any undefined symbols. Because the module is
> used normally together with a httpd server,
> there're a lot of undefined symbols. My solution is to link libapr,
> libaprutil, libexpat and libmysql statically in my module and to add a
> file with the definitions of the apache-internal functions (just copy
> and paste from httpd source). With every function which I copy in this
> file I get a few new undefined symbols. All in all it's a pain to search
> all definitions and I probably have to do this again after adding new
> features which uses other functionalities. 
> Is there an easier way to do this? To build a module which includes all
> needed links to apache functions without linking the needed libraries
> statically and copy-and-paste functions from apache source? Or do you
> know a better way to do this?
> Steven 

With httpd 1.3, there used to be a way to build something what was
called "shared core", a shared object that contained the server in a
form you could link it into an application.

I don't know if this is still possible with httpd 2.x, but what used I
in an RPM package at the time was 

    mkdir shared_core
    cp -p src/libhttpd.ep src/ src/httpd

   # install shared-core apache
   install -m 755 shared_core/libhttpd.ep $RPM_BUILD_ROOT/%{_libdir}/%{name}
   install -m 755 shared_core/ $RPM_BUILD_ROOT/%{_libdir}/%{name}
   ln -s %{_libdir}/%{name}/libhttpd.ep $RPM_BUILD_ROOT/%{_sbindir}/httpd-shared_core
   ln -s %{_libdir}/%{name}/ $RPM_BUILD_ROOT/%{_libdir}/

At the time, that was reportedly working to build DSOs with Kylix 3.

Contact: (a.k.a.
         #opensuse-mirrors on
SUSE LINUX Products GmbH
Research & Development

View raw message