From patchwork Tue Feb 5 21:14:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 11978 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 0490F448F34 for ; Tue, 5 Feb 2019 23:15:10 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DBCE368AA4D; Tue, 5 Feb 2019 23:15:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 691FF68AA24 for ; Tue, 5 Feb 2019 23:15:04 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 09AADE138B; Tue, 5 Feb 2019 22:15:03 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3LeFIerTc_Zr; Tue, 5 Feb 2019 22:15:02 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B6CB9E04A0; Tue, 5 Feb 2019 22:15:01 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 5 Feb 2019 22:14:59 +0100 Message-Id: <20190205211459.24691-1-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 Subject: [FFmpeg-devel] [PATCH] configure: warn about disabled explicitly enabled components X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --- configure | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) 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