apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@ebuilt.com>
Subject Re: Autoconf question: conditional compile
Date Wed, 08 Aug 2001 21:26:04 GMT
On Wed, Aug 08, 2001 at 09:22:33PM +0200, Graham Leggett wrote:
> Hi all,
> 
> I have an autoconf question, I need to know the "right" way to do this:
> 
> In apr-util, the LDAP libraries are configured using the --with-ldap
> flag. If the libraries are found and built correctly, then a symbol
> called APU_HAS_LDAP is defined.
> 
> Now - when I compile code in Apache, which uses apr-util, how can I
> detect whether this APU_HAS_LDAP symbol exists in apr-util or not?

I think you'd want:

#include <apu.h>
...
#if APU_HAS_LDAP
/* LDAP code here. */
#else
/* You don't have LDAP, so don't do anything. */
#endif

The trick is that APU_HAS_LDAP should be a 0 or 1 value not a simple
define.  And, I think rbb (or Doug?) pointed out that it should be
APR_HAS_LDAP since that symbol doesn't conflict with APR.  

HTH.  -- justin


Mime
View raw message