From: Adam Sutton Date: Thu, 6 Sep 2012 14:35:33 +0000 (+0100) Subject: Add some additional support to configure.inc added for new feature check in configure... X-Git-Tag: 3.3~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00fa2f44ee6148f91ecc1c8d2bb0bc8e539eb637;p=thirdparty%2Ftvheadend.git Add some additional support to configure.inc added for new feature check in configure that has now been abandoned. --- diff --git a/support/configure.inc b/support/configure.inc index d3cd6d8e5..21606f28b 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 {