[FFmpeg-devel] [PATCH] configure: warn about disabled explicitly enabled components
Marton Balint
cus at passwd.hu
Sat Feb 9 00:20:31 EET 2019
On Tue, 5 Feb 2019, Marton Balint wrote:
> If we enable a component but a dependant library is disabled, then the enabled
> component gets silently disabled. Warning about disabled explicitly enabled components
> allows configure to show the missing dependencies and if --fatal-warnings is
> used it can also fail if the user wants it so.
>
> For example if libdav1d is not availble ./configure --enable-decoder=libdav1d
> succeeds but the libdav1d decoder is not be enabled. After the patch configure
> will warn about this:
>
> WARNING: Disabled libdav1d_decoder because not all dependencies are satisfied: libdav1d
>
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
> configure | 32 ++++++++++++++++++++++++++++----
> 1 file changed, 28 insertions(+), 4 deletions(-)
>
Ping.
Thanks,
Marton
> diff --git a/configure b/configure
> index e1412352fa..c1a203daa3 100755
> --- a/configure
> +++ b/configure
> @@ -648,6 +648,12 @@ request(){
> done
> }
>
> +warn_if_gets_disabled(){
> + for var in $*; do
> + WARN_IF_GETS_DISABLED_LIST="$WARN_IF_GETS_DISABLED_LIST $var"
> + done
> +}
> +
> enable(){
> set_all yes $*
> }
> @@ -656,6 +662,14 @@ disable(){
> set_all no $*
> }
>
> +disable_with_reason(){
> + disable $1
> + eval "${1}_disable_reason=\"$2\""
> + if requested $1; then
> + die "ERROR: $1 requested, but $2"
> + fi
> +}
> +
> enable_weak(){
> set_weak yes $*
> }
> @@ -784,10 +798,10 @@ check_deps(){
>
> [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
> [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
> - enabled_all $dep_all || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but not all dependencies are satisfied: $dep_all"; }
> - enabled_any $dep_any || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but not any dependency is satisfied: $dep_any"; }
> - disabled_all $dep_con || { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but some conflicting dependencies are unsatisfied: $dep_con"; }
> - disabled_any $dep_sel && { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but some selected dependency is unsatisfied: $dep_sel"; }
> + enabled_all $dep_all || { disable_with_reason $cfg "not all dependencies are satisfied: $dep_all"; }
> + enabled_any $dep_any || { disable_with_reason $cfg "not any dependency is satisfied: $dep_any"; }
> + disabled_all $dep_con || { disable_with_reason $cfg "some conflicting dependencies are unsatisfied: $dep_con"; }
> + disabled_any $dep_sel && { disable_with_reason $cfg "some selected dependency is unsatisfied: $dep_sel"; }
>
> enabled $cfg && enable_deep_weak $dep_sel $dep_sgs
>
> @@ -3880,6 +3894,7 @@ for opt do
> name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
> list=$(filter "$name" $list)
> [ "$list" = "" ] && warn "Option $opt did not match anything"
> + test $action = enable && warn_if_gets_disabled $list
> $action $list
> ;;
> --enable-yasm|--disable-yasm)
> @@ -7103,6 +7118,15 @@ echo "License: $license"
>
> fi # test "$quiet" != "yes"
>
> +if test -n "$WARN_IF_GETS_DISABLED_LIST"; then
> + for cfg in $WARN_IF_GETS_DISABLED_LIST; do
> + if disabled $cfg; then
> + varname=${cfg}_disable_reason
> + eval "warn \"Disabled $cfg because \$$varname\""
> + fi
> + done
> +fi
> +
> if test -n "$WARNINGS"; then
> printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
> enabled fatal_warnings && exit 1
> --
> 2.16.4
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
More information about the ffmpeg-devel
mailing list