Re: autoheader an AC_DEFINE

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

 



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





[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux