Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 19227 invoked from network); 7 Aug 2008 09:41:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Aug 2008 09:41:29 -0000 Received: (qmail 41078 invoked by uid 500); 7 Aug 2008 09:41:19 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 41030 invoked by uid 500); 7 Aug 2008 09:41:18 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 41019 invoked by uid 99); 7 Aug 2008 09:41:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 02:41:18 -0700 X-ASF-Spam-Status: No, hits=-8.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [195.135.220.2] (HELO mx1.suse.de) (195.135.220.2) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 09:40:20 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 3FD2341587 for ; Thu, 7 Aug 2008 11:40:46 +0200 (CEST) Date: Thu, 7 Aug 2008 11:40:45 +0200 From: Peter Poeml To: dev@httpd.apache.org Subject: Re: FWD: Testing modules using Python Message-ID: <20080807094045.GC8801@suse.de> Mail-Followup-To: dev@httpd.apache.org References: <3CAFA8502A25A841B2F6D22237BFC01A01E86CFB@exbe05.intra.dlr.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TYecfFk8j8mZq+dy" Content-Disposition: inline In-Reply-To: <3CAFA8502A25A841B2F6D22237BFC01A01E86CFB@exbe05.intra.dlr.de> X-Useless-Header: If you read this, say 'honk'! User-Agent: Mutt/1.5.13 (2006-08-11) Sender: Peter Poeml X-Virus-Checked: Checked by ClamAV on apache.org --TYecfFk8j8mZq+dy Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Steven, On Tue, Aug 05, 2008 at 10:21:01 +0200, Steven.Mohr@dlr.de wrote: > Hi, > on modules-dev@httpd.apache.org Peter gave me the advice to build apache = with the SHARED_CORE rule. Apache 2.x does not have this rule anymore. Is t= here something comparable in Apache 2.x? > Sorry for cross-posting but I think you are the guys who could help me. >=20 > Steven The build infrastructure doesn't seem to know this anymore -=20 but does it work if you do the following? make clean CFLAGS=3D'-D SHARED_CORE -fPIC' ./configure make and then take the line which links together the httpd binary (the one with libtool ... -mode=3Dlink gcc ... -o httpd ... which is probably the last line) and rerun it manually with a slight change: libtool ... -mode=3Dlink gcc ... -shared -o libhttpd.so ... server/exports= =2Eo This should build the shared object anyway. But it is possible that it doesn't provide what you need. YMMV. > ------------------------------------------------ > Steven Mohr > Bachelor student >=20 > DLR (German Aerospace Center),=20 > Simulation and Software Technology > Linder Hoehe, 51147 Cologne, Germany > voice: +49 2203 601 2956 fax: +49 2203 601 3070 > eMail: steven.mohr at dlr.de http://www.dlr.de/sc >=20 >=20 >=20 > -----Urspr=FCngliche Nachricht----- > Von: Peter Poeml [mailto:poeml@suse.de]=20 > Gesendet: Montag, 4. August 2008 16:37 > An: modules-dev@httpd.apache.org > Betreff: Re: Testing modules using Python >=20 > On Mon, Aug 04, 2008 at 04:27:58PM +0200, Steven.Mohr@dlr.de wrote: > > Hi, > > I want to unit test my module (catacomb.tigris.org) 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.=20 > >=20 > > 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? > >=20 > > Steven=20 >=20 > 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. >=20 > 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=20 >=20 > --enable-rule=3DSHARED_CORE > =20 > mkdir shared_core > cp -p src/libhttpd.ep src/libhttpd.so src/httpd > shared_core >=20 >=20 > # install shared-core apache > install -m 755 shared_core/libhttpd.ep $RPM_BUILD_ROOT/%{_libdir}/%{na= me} > install -m 755 shared_core/libhttpd.so $RPM_BUILD_ROOT/%{_libdir}/%{na= me} > ln -s %{_libdir}/%{name}/libhttpd.ep $RPM_BUILD_ROOT/%{_sbindir}/httpd= -shared_core > ln -s %{_libdir}/%{name}/libhttpd.so $RPM_BUILD_ROOT/%{_libdir}/libhtt= pd.so >=20 >=20 > At the time, that was reportedly working to build DSOs with Kylix 3. >=20 > Peter > --=20 > Contact: admin@opensuse.org (a.k.a. ftpadmin@suse.com) > #opensuse-mirrors on freenode.net > Info: http://en.opensuse.org/Mirror_Infrastructure > =20 > SUSE LINUX Products GmbH > Research & Development Peter --=20 "WARNING: This bug is visible to non-employees. Please be respectful!" =20 SUSE LINUX Products GmbH Research & Development --TYecfFk8j8mZq+dy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFImsMd92K4Je+2lOoRAqlfAJ9jXF/C7JCabCFVdn1JVZPQovYMKQCfXkdW FgCfJZsBZ4lfOusRGD4e81o= =4i7t -----END PGP SIGNATURE----- --TYecfFk8j8mZq+dy--