mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-25 00:11:10 +00:00
ssl-opt: Use ssl_server2 to query config instead of grep and sed
This commit is contained in:
parent
bfa3e0914b
commit
0644678507
|
@ -165,22 +165,34 @@ requires_config_disabled() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_config_value_or_default() {
|
get_config_value_or_default() {
|
||||||
NAME="$1"
|
# This function uses the query_config command line option to query the
|
||||||
DEF_VAL=$( grep ".*#define.*${NAME}" ../include/mbedtls/config.h |
|
# required Mbed TLS compile time configuration from the ssl_server2
|
||||||
sed 's/^.* \([0-9]*\)$/\1/' )
|
# program. The command will always return a success value if the
|
||||||
../scripts/config.pl get $NAME || echo "$DEF_VAL"
|
# configuration is defined and the value will be printed to stdout.
|
||||||
|
#
|
||||||
|
# Note that if the configuration is not defined or is defined to nothing,
|
||||||
|
# the output of this function will be an empty string.
|
||||||
|
${P_SRV} "query_config=${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
requires_config_value_at_least() {
|
requires_config_value_at_least() {
|
||||||
VAL=$( get_config_value_or_default "$1" )
|
VAL="$( get_config_value_or_default "$1" )"
|
||||||
if [ "$VAL" -lt "$2" ]; then
|
if [ -z "$VAL" ]; then
|
||||||
|
# Should never happen
|
||||||
|
echo "Mbed TLS configuration $1 is not defined"
|
||||||
|
exit 1
|
||||||
|
elif [ "$VAL" -lt "$2" ]; then
|
||||||
SKIP_NEXT="YES"
|
SKIP_NEXT="YES"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
requires_config_value_at_most() {
|
requires_config_value_at_most() {
|
||||||
VAL=$( get_config_value_or_default "$1" )
|
VAL=$( get_config_value_or_default "$1" )
|
||||||
if [ "$VAL" -gt "$2" ]; then
|
if [ -z "$VAL" ]; then
|
||||||
|
# Should never happen
|
||||||
|
echo "Mbed TLS configuration $1 is not defined"
|
||||||
|
exit 1
|
||||||
|
elif [ "$VAL" -gt "$2" ]; then
|
||||||
SKIP_NEXT="YES"
|
SKIP_NEXT="YES"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue