You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Joe Orton <jo...@redhat.com> on 2005/01/06 11:32:09 UTC

Re: autoconf help: enable a feature based on the string value of a #define

On Thu, Jan 06, 2005 at 10:40:25AM +0200, Graham Leggett wrote:
> Hi all,
> 
> The LDAP C API defines the LDAP_VENDOR_NAME symbol to identify the
> toolkit. This symbol contains a string, such as "OpenLDAP" or "Novell".
> 
> I would like autoconf to define APR_HAS_OPENLDAP_SDK if this #define
> contains the string "OpenLDAP", and I have not been able to figure out how
> to do it.
> 
> Has anybody solved this problem before?

something like:

AC_EGREP_CPP(OpenLDAP, [#include <ldap.h>
LDAP_VENDOR_NAME])

wrapped in AC_CACHE_CHECK as normal, should work.

joe

Re: autoconf help: enable a feature based on the string value of a #define

Posted by Max Bowsher <ma...@ukf.net>.
Joe Orton wrote:
> On Thu, Jan 06, 2005 at 10:40:25AM +0200, Graham Leggett wrote:
>> Hi all,
>>
>> The LDAP C API defines the LDAP_VENDOR_NAME symbol to identify the
>> toolkit. This symbol contains a string, such as "OpenLDAP" or "Novell".
>>
>> I would like autoconf to define APR_HAS_OPENLDAP_SDK if this #define
>> contains the string "OpenLDAP", and I have not been able to figure out 
>> how
>> to do it.
>>
>> Has anybody solved this problem before?
>
> something like:
>
> AC_EGREP_CPP(OpenLDAP, [#include <ldap.h>
> LDAP_VENDOR_NAME])
>
> wrapped in AC_CACHE_CHECK as normal, should work.

Yes - I recently had to do this in Subversion:

http://svn.collab.net/repos/svn/trunk/build/ac-macros/swig.m4

search for "Python/C" to find the relevant place.

Max.


Re: autoconf help: enable a feature based on the string value of a #define

Posted by Graham Leggett <mi...@sharp.fm>.
Joe Orton wrote:

> something like:
> 
> AC_EGREP_CPP(OpenLDAP, [#include <ldap.h>
> LDAP_VENDOR_NAME])
> 
> wrapped in AC_CACHE_CHECK as normal, should work.

At last! APR can now cleanly detect the LDAP toolkit, my brain can stop 
hurting now! :)

Regards,
Graham
--