diff --git a/support/configure.inc b/support/configure.inc index d3cd6d8e..21606f28 100644 --- a/support/configure.inc +++ b/support/configure.inc @@ -119,6 +119,13 @@ function enabled [ "$val" == "yes" ] && return 0 || return 1 } +# Check if disabled +function disabled +{ + local val=$(_enabled $1) + [ "$val" == "no" ] && return 0 || return 1 +} + # Check if enabled (or auto) function enabled_or_auto { @@ -126,6 +133,13 @@ function enabled_or_auto [ "$val" == "yes" -o "$val" == "auto" ] && return 0 || return 1 } +# Check if disabled (or auto) +function disabled_or_auto +{ + local val=$(_enabled $1) + [ "$val" == "no" -o "$val" == "auto" ] && return 0 || return 1 +} + # ########################################################################### # Command Line # ########################################################################### @@ -266,6 +280,25 @@ function check_cc_header fi } +# Check some compiler snippet +function check_cc_snippet +{ + local nam=$1 + local snp=$2 + local opt=$3 + + echo -ne "checking for cc $nam ...${TAB}" + + # Check if supported + if check_cc "$snp" "$opt"; then + echo "ok" + enable $nam + else + echo "fail" + return 1 + fi +} + # Check compiler option function check_cc_option {