Re: why doesn't this macro work!?

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

 



Of course I figured it out the minute after I sent the mail.
AC_DEFINE_UNQUOTED.
I can't claim to understand exactly why, but it works.

On Sun, Mar 8, 2009 at 12:22 AM, John Wohlbier <johnwohlbier@xxxxxxxxx>wrote:

> Below is the macro that doesn't work. Probably something I don't understand
> about m4, as usual.
> --with-dbc works to give me -DDBC=7
> but other variations give me
> -DDBC=\$withval
> -DDBC=\$DBC
>
> Hints are appreciated. Thanks very much.
>
> jgw
>
>
>
> AC_DEFUN([CCS_WITH_DBC], [
>     AC_ARG_VAR([DBC], [value of DBC])
>
>     AC_ARG_WITH([dbc],
>         [AC_HELP_STRING([--with-dbc],
>         [level of DBC, design by contract, valid values are 0-7])],
>         [
>             if test -n "$DBC" ; then
>                 AC_MSG_NOTICE([setting level of DBC to $DBC])
>                 AC_DEFINE(DBC, $DBC)
>             elif test "$withval" = "yes" ; then
>                 AC_MSG_NOTICE([--with-dbc specified without a value,
> setting it to 7])
>                 AC_DEFINE(DBC, [7])
>             elif test "$withval" != "no" ; then
>                 AC_MSG_NOTICE([setting level of DBC to $withval])
>                 AC_DEFINE(DBC, $withval)
>             fi
>         ],
>         [
>             if test -n "$DBC" ; then
>                 AC_MSG_NOTICE([setting level of DBC])
>                 AC_DEFINE(DBC, $DBC)
>             fi
>     ])
> ])
>
>
> --
> John G. Wohlbier
>
>
>


-- 
John G. Wohlbier
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

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

  Powered by Linux