#
# $Id: makl_checkinline,v 1.1 2006/04/20 12:31:59 tat Exp $
#

##\brief Check if 'inline' keyword is supported by the compiler
##
##  Define HAVE_INLINE if 'inline' keyword is supported.
##  \e $1 determines whether the feature is optional or required.
##
##   \param $1 0:optional/1:required
##
makl_checkinline ()
{
    [ -z `makl_get "__noconfig__"` ] || return

    makl_info "checking for inline keyword support"

    {
        ${ECHO} "inline int _f(void) { return 0; }"
        ${ECHO} "int main() { return _f(); }"
    } | makl_compile_code 0

    if [ $? = 0 ]; then
        makl_set_var "HAVE_INLINE"
        return 0
    else
        [ $1 = 0 ] || makl_err 1 "failed inline keyword check!"
        makl_unset_var "HAVE_INLINE"
        makl_warn "failed check on optional inline keyword support"
        return 1
    fi
}

