autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Macro to check header define value


From: Peter Johansson
Subject: Re: Macro to check header define value
Date: Thu, 21 Jan 2010 11:58:26 -0500
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Hi emannuel,

address@hidden wrote:
Hi,

my software uses an extern library which has its version number in it header.h 
like following:
#define LIB_VERSION 424242

I need to check this version number (because the API was changed and this 
introduced an incompatibility).

I think about something like AC_CHECK_DEFINE_VALUE... bug nothing like that 
seems to exist.

Does someone knows how to do that?

I would use a more low-level macro such as AC_COMPILE_IFELSE, e.g., as follows (not tested)

   AC_COMPILE_IFELSE(
     [AC_LANG_PROGRAM(address@hidden:@include <header.h>],
       [ #if LIB_VERSION >= 424242
         // OK
         #else
         # error version too old
         #endif
       ])
     ],
   [ACTION-IF_OK], ACTION-IF_NOT_OK])

Cheers,
Peter

--
Peter Johansson

svndigest maintainer, http://dev.thep.lu.se/svndigest
yat maintainer,       http://dev.thep.lu.se/yat





reply via email to

[Prev in Thread] Current Thread [Next in Thread]