ssl-opt.sh: Add function extracting val or default val from config.h

This commit is contained in:
Hanno Becker 2018-08-28 16:09:22 +01:00
parent dc1e950170
commit 7c48dd11db

View File

@ -164,21 +164,22 @@ requires_config_disabled() {
fi fi
} }
requires_config_value_at_least() { get_config_value_or_default() {
NAME="$1" NAME="$1"
DEF_VAL=$( grep ".*#define.*${NAME}" ../include/mbedtls/config.h | DEF_VAL=$( grep ".*#define.*${NAME}" ../include/mbedtls/config.h |
sed 's/^.*\s\([0-9]*\)$/\1/' ) sed 's/^.*\s\([0-9]*\)$/\1/' )
VAL=$( ../scripts/config.pl get $NAME || echo "$DEF_VAL" ) ../scripts/config.pl get $NAME || echo "$DEF_VAL"
}
requires_config_value_at_least() {
VAL=$( get_config_value_or_default "$1" )
if [ "$VAL" -lt "$2" ]; then if [ "$VAL" -lt "$2" ]; then
SKIP_NEXT="YES" SKIP_NEXT="YES"
fi fi
} }
requires_config_value_at_most() { requires_config_value_at_most() {
NAME="$1" VAL=$( get_config_value_or_default "$1" )
DEF_VAL=$( grep ".*#define.*${NAME}" ../include/mbedtls/config.h |
sed 's/^.*\s\([0-9]*\)$/\1/' )
VAL=$( ../scripts/config.pl get $NAME || echo "$DEF_VAL" )
if [ "$VAL" -gt "$2" ]; then if [ "$VAL" -gt "$2" ]; then
SKIP_NEXT="YES" SKIP_NEXT="YES"
fi fi