Recommended way to use autotools

2009-11-16 Thread Dave Ingram

Hi all,

I've been wondering if there is a recommended way of using autotools 
when writing an Apache module? I've seen a tutorial 
http://threebit.net/tutorials/apache2_modules/tut1/tutorial1.html on 
this, but it was last updated in 2005, so I'm not sure if there are any 
better ways or things to do. I've also looked at a couple 
http://code.google.com/p/mod-authn-otp/ of projects 
http://code.google.com/p/modskeleton/, and they seem to do things 
differently. I also found a couple of previous 
http://marc.info/?l=apache-modulesm=109754513810791w=2 questions 
http://marc.info/?l=apache-modulesm=97517123707363w=2 on this 
subject, but they're very old and don't answer my question.


I essentially want to allow the module to be compiled against one or two 
different libraries, depending on availability and user choice.


Non-essential background details:
8-
I'm building a module that accesses a database at configuration parse 
time, but I can't use APR DBD for a few reasons. Firstly, I need 
features from apr-util 1.3 which is not in many major distributions. 
Secondly, apr-util and mod_php can conflict by linking against 
libmysqlclient_r and libmysqlclient, respectively. Both libraries export 
the same symbols, which then causes all sorts of hell (generally 
manifesting as bizarre segfaults). I've also had issues with the 
distro-packaged versions of apr-util being compiled without database 
support (or DSO support, making it impossible to load the DB drivers). 
Then again, this could be due to me missing something. My DB 
driver-loading code was inspired from mod_dbd, so I'm fairly sure it's 
making the right calls.


Basically, I want the user/package maintainer to be able to force 
selection of libmysqlclient/libmysqlclient_r as appropriate (as some 
distributions have fixed this issue), although it would be even better 
to autodetect this via configure rules. I then also plan to add 
support for other databases, such as Postgres.


Of course, if anyone has any better suggestions on how to do this that 
don't involve me writing my own reduced-functionality DB abstraction 
layer, I would love to hear them.

8-


Thanks,


Dave


Re: Recommended way to use autotools

2009-11-16 Thread Jerome Renard
Hi Dave,

On Mon, Nov 16, 2009 at 11:42 PM, Dave Ingram d...@dmi.me.uk wrote:
 Hi all,

 I've been wondering if there is a recommended way of using autotools when
 writing an Apache module? I've seen a tutorial
 http://threebit.net/tutorials/apache2_modules/tut1/tutorial1.html on this,
 but it was last updated in 2005, so I'm not sure if there are any better
 ways or things to do. I've also looked at a couple
 http://code.google.com/p/mod-authn-otp/ of projects
 http://code.google.com/p/modskeleton/, and they seem to do things
 differently. I also found a couple of previous
 http://marc.info/?l=apache-modulesm=109754513810791w=2 questions
 http://marc.info/?l=apache-modulesm=97517123707363w=2 on this subject,
 but they're very old and don't answer my question.

 I essentially want to allow the module to be compiled against one or two
 different libraries, depending on availability and user choice.

Will the following files help you :
- http://code.google.com/p/modmemcachedinclude/source/browse/m4

Have a nice day :)