mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-02 08:24:17 +01:00
ssl-opt.sh: Add function extracting val or default val from config.h
This commit is contained in:
parent
dc1e950170
commit
7c48dd11db
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user