[Top][All Lists]

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

Re: autoheader an AC_DEFINE

From: aotto
Subject: Re: autoheader an AC_DEFINE
Date: Fri, 2 Sep 2022 23:25:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0


I had 2 problems:

1. my AC_DEFINE was only in the positive AS_IF state and the default #undef was 
chosen for the negative state
     → Solution: As mentioned, add a variable and remove AC_DEFINE from the 

2. the AC_DEFINE does not use the variable, the AC_DEFINE_UNQUOTED has done the 

it is fine now.


On 02.09.22 21:40, Zack Weinberg wrote:
On Fri, Sep 2, 2022, at 2:03 PM, aotto wrote:

I use autoconf to config my application. My problem is that I require a
macro with

      #define NAME 1


      #define NAME 0

autoconf / autoheader uses for '#define NAME 0' the value '#undef NAME'
This ought to work:

AS_IF([test x"$ac_cv_condition_for_NAME" = xyes],
  [AC_DEFINE([NAME], [1], [Explanation of NAME.])],
  [AC_DEFINE([NAME], [0], [Explanation of NAME.])])

And so should this:

AS_IF([test x"$ac_cv_condition_for_NAME" = xyes],
AC_DEFINE_UNQUOTED([NAME], [$value_NAME], [Explanation of NAME.])

If neither of those works, we're going to need to see a self-contained that demonstrates exactly what you're trying to do, because the 
problem must be more complicated than just how you're using AC_DEFINE.


reply via email to

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