autoconf
[Top][All Lists]
Advanced

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

why doesn't this macro work!?


From: John Wohlbier
Subject: why doesn't this macro work!?
Date: Sun, 8 Mar 2009 00:22:17 -0700

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


reply via email to

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