Merge pull request #8992 from orbea/rpng

qb: Extend the check_enabled function.
This commit is contained in:
Twinaphex 2019-06-20 08:07:55 +02:00 committed by GitHub
commit 10014f03a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -524,5 +524,5 @@ if [ "$HAVE_DEBUG" = 'yes' ]; then
fi
check_enabled MENU MENU_WIDGETS 'menu widgets' 'The menu is' false
check_enabled ZLIB RPNG RPNG 'zlib is' false
check_enabled 'ZLIB BUILTINZLIB' RPNG RPNG 'zlib is' false
check_enabled V4L2 VIDEOPROCESSOR 'video processor' 'Video4linux2 is' true

View File

@ -48,21 +48,23 @@ check_compiler()
}
# check_enabled:
# $1 = HAVE_$1 [Disabled feature]
# $1 = HAVE_$1 [Disabled 'feature' or 'feature feature1 feature2', $1 = name]
# $2 = USER_$2 [Enabled feature]
# $3 = lib
# $4 = feature
# $5 = enable lib when true [checked only if non-empty]
check_enabled()
{ tmpvar="$(eval "printf %s \"\$HAVE_$1\"")"
setval="$(eval "printf %s \"\$HAVE_$2\"")"
{ setval="$(eval "printf %s \"\$HAVE_$2\"")"
if [ "$tmpvar" != 'no' ]; then
if [ "$setval" != 'no' ] && [ "${5:-}" = 'true' ]; then
eval "HAVE_$2=yes"
for val in $(printf %s "$1"); do
tmpvar="$(eval "printf %s \"\$HAVE_$val\"")"
if [ "$tmpvar" != 'no' ]; then
if [ "$setval" != 'no' ] && [ "${5:-}" = 'true' ]; then
eval "HAVE_$2=yes"
fi
return 0
fi
return 0
fi
done
tmpval="$(eval "printf %s \"\$USER_$2\"")"