From 00fa2f44ee6148f91ecc1c8d2bb0bc8e539eb637 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Thu, 6 Sep 2012 15:35:33 +0100 Subject: [PATCH] Add some additional support to configure.inc added for new feature check in configure that has now been abandoned. --- support/configure.inc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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 {