autoconf
[Top][All Lists]
Advanced

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

Re: Problem with AC_DEFINE in autoconf 2.59


From: Paolo Bonzini
Subject: Re: Problem with AC_DEFINE in autoconf 2.59
Date: Thu, 06 Nov 2008 15:17:41 +0100
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

> if test "x$release_mode" = "xyes" ; then
>   AC_DEFINE([my_debug(s, ...)],[], [Disable my_debug calls])
> else
>   AC_DEFINE([my_debug(s, ...)],[g_debug(s, ##__VA_ARGS__)], [Enable
> my_debug calls])
> fi
> 
> The problem is that using autoconf 2.59, the previous code will generate
> in config.h:
>  /* Enable my_debug calls */
> /* #undef my_debug */(s, ...)
> 
> The previous code works ok with latest 2.61 version in Debian Lenny &
> Ubuntu Intrepid, but fails with 2.59 in RHEL5.
> 
> Any idea how to make this work with version 2.59?

No idea except: do not do it.  Use

AC_DEFINE([RELEASE_MODE], [1], [Disable my_debug calls])

and since you should already have some global header (typically it's
called system.h) do

#ifdef RELEASE_MODE
#define my_debug(s, ...)
#else
#define my_debug(s, ...) g_debug(s, ##__VA_ARGS__)
#endif

there.  A worse "fix" is to stick an AC_PREREQ(2.61) in your script.

Paolo




reply via email to

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