autoconf
[Top][All Lists]
Advanced

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

Re: autoheader an AC_DEFINE


From: Zack Weinberg
Subject: Re: autoheader an AC_DEFINE
Date: Fri, 02 Sep 2022 15:40:25 -0400
User-agent: Cyrus-JMAP/3.7.0-alpha0-841-g7899e99a45-fm-20220811.002-g7899e99a

On Fri, Sep 2, 2022, at 2:03 PM, aotto wrote:
> Hi,
>
> I use autoconf to config my application. My problem is that I require a 
> macro with
>
>      #define NAME 1
>
> or
>
>      #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],
  [value_NAME=1],
  [value_NAME=0])
AC_DEFINE_UNQUOTED([NAME], [$value_NAME], [Explanation of NAME.])

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

zw



reply via email to

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