Macro to check header define value

2010-01-21 Thread emmanuel
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 noth

Re: Macro to check header define value

2010-01-21 Thread Peter Johansson
Hi emannuel, emman...@engelhart.org 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 so

finding the value of a preprocessor symbol

2010-01-21 Thread David Byron
Let's say I have a header file named foo.h that contains: #define FOO an_interesting_value (I think) I'm looking for a macro like this: AC_GET_VALUE([foo.h],[FOO]) that populates ac_cv_value_of_FOO with an_interesting_value Does such a macro exist? Apologies if this is a FAQ. I can think of

AC_CHECK_FUNC is not compatible with gcc -Werror

2010-01-21 Thread Dmitry V. Levin
Hi, There is no news that AC_CHECK_FUNC fails to find built-in functions when either AC_LANG_WERROR is used or -Werror is included in CFLAGS: $ cat configure.ac AC_INIT AC_LANG_WERROR AC_CHECK_FUNC(memset) $ autoconf && ./configure checking for gcc... gcc checking whether the C compiler works..

Re: finding the value of a preprocessor symbol

2010-01-21 Thread John Calcote
Hi David, On 1/21/2010 4:38 PM, David Byron wrote: Let's say I have a header file named foo.h that contains: #define FOO an_interesting_value (I think) I'm looking for a macro like this: AC_GET_VALUE([foo.h],[FOO]) that populates ac_cv_value_of_FOO with an_interesting_value This is tot

RE: finding the value of a preprocessor symbol

2010-01-21 Thread David Byron
On Thursday, January 21, 2010, John Calcote wrote: > On 1/21/2010 4:38 PM, David Byron wrote: > > Let's say I have a header file named foo.h that contains: > > > > #define FOO an_interesting_value > > > > (I think) I'm looking for a macro like this: > > > > AC_GET_VALUE([foo.h],[FOO]) > > > > that

RE: finding the value of a preprocessor symbol

2010-01-21 Thread Thomas Dickey
On Thu, 21 Jan 2010, David Byron wrote: On Thursday, January 21, 2010, John Calcote wrote: On 1/21/2010 4:38 PM, David Byron wrote: $ cpp -dM foo.h | grep FOO #define FOO an_interesting_value Good idea. Replace cpp -dM with $CPP $CPPFLAGS and I'm getting close. Also starting to convince mys