From patchwork Thu Dec 1 23:44:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1653 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp212vsa; Thu, 1 Dec 2016 15:44:57 -0800 (PST) X-Received: by 10.194.188.9 with SMTP id fw9mr35818375wjc.213.1480635896658; Thu, 01 Dec 2016 15:44:56 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f21si319166wmh.150.2016.12.01.15.44.51; Thu, 01 Dec 2016 15:44:56 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@googlemail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CFAA6689CD3; Fri, 2 Dec 2016 01:44:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wj0-f174.google.com (mail-wj0-f174.google.com [209.85.210.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 67F67689A68 for ; Fri, 2 Dec 2016 01:44:35 +0200 (EET) Received: by mail-wj0-f174.google.com with SMTP id v7so218167129wjy.2 for ; Thu, 01 Dec 2016 15:44:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to; bh=3ZtLAhYEerd1W70AAzgYbVG7F8MdPrubasbPyBG0DPY=; b=SZotpPioV3HdxnCQKXbIPzIbOf8AxCFh3lveO/+vNSi2WpiPaXriOdIxqeEHUskjxp OnzjDAX7UpzpnrvvOgnEUGNvaYBeSq2373PdTh3IH33b0Yk6hLI5j6DRdadkvpxe21dk QkcRH5E99sPpzg+Dxz/jP5laiATYMe5ihTCC8B4N1jwIfZZ5HCSvxkV20cR6NgSk7uKa BjwoIplXTzJLjRRU44mx0iQgnGYG4P7L2Sn8rSBDB5SOOZPt0/qx8ZYNEPPs+vVmsg4C 7BX6UIr/pOwowb190Y1QrwFNX9Skvq9ReS2iSLUzPUaG4p1bUK6l5wQahu/XeEzRQlJP cNAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to; bh=3ZtLAhYEerd1W70AAzgYbVG7F8MdPrubasbPyBG0DPY=; b=hfA8Zy52n0yxJFeIhaOq8QQtFuZMi5iFwO/l6OPGyY1cd88iVq8dxQsRX7j24shm6t 3koGKYwbd+f7u9vPrQ2AETGLpw4R9Fm/+NDDiqjN5lvrQFYte6vQ13RdxtVVoMCZ2D/i uZu6B2HPL4P76r84W1apKHbGs2SDLG9/02klIyPDiPpbSuHx4MmkBCBFI+6EvsMbwsFI 9K8eHlwJ14YtEFJaIQrHsJPU5x+PggE2DS9XHUKNAB8zv+NTMVWPn/6AXOEzNOFVA/us Gf7WXwkZhCXO8oBDom4k8ssWaad00e1c0SkccUy5GbfB9ixZSX8niyzktEkDiFBdM9aL TJJg== X-Gm-Message-State: AKaTC00u7acuGx1nL2AD5t9IqrM8VCFdDsBdzDgAsjwvfjW/3GTkKEiuX9bw1Afiw6i1Hw== X-Received: by 10.194.59.98 with SMTP id y2mr35289630wjq.166.1480635882855; Thu, 01 Dec 2016 15:44:42 -0800 (PST) Received: from [192.168.2.21] (p5B0950FE.dip0.t-ipconnect.de. [91.9.80.254]) by smtp.googlemail.com with ESMTPSA id f3sm278888wmf.10.2016.12.01.15.44.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 15:44:42 -0800 (PST) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: ffmpeg-devel@ffmpeg.org References: <0509cabe-2a98-cec9-aa71-b4980d39e6b9@googlemail.com> <53432ffc-ccd2-d935-d535-63dffaacbc99@googlemail.com> <20161201003417.GB4749@nb4> Message-ID: <354655d7-339a-a897-f1ca-5234e8a86424@googlemail.com> Date: Fri, 2 Dec 2016 00:44:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161201003417.GB4749@nb4> Subject: Re: [FFmpeg-devel] [PATCH 3/3] configure: fail if autodetect-libraries are requested but not found 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On 01.12.2016 01:34, Michael Niedermayer wrote: > On Thu, Dec 01, 2016 at 12:22:50AM +0100, Andreas Cadhalpun wrote: >> @@ -6381,6 +6410,11 @@ for thread in $THREADS_LIST; do >> fi >> done >> >> +# Check if requested libraries were found. >> +for lib in $AUTODETECT_LIBS; do >> + requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found"; >> +done > > This must be after check_deps as that can disable vaapi I agree, but... > unless i miss something ...it is already after check_deps. ;) > also in the same light i think things like: > > enabled vaapi && > check_lib va/va.h vaInitialize -lva || > disable vaapi > > should disable vaapi through having a entry in vaapi_deps= ... There is already va_va_h in vaapi_deps and I'm not sure, what else you'd like to have there. However, it seems independent of this patch. > And then check_deps should check for requested when disabling things > that way it should be possible to print why something is being disabled > If that works that extra information should be quite usefull More information never hurts, so I added some specific error messages in check_deps. > also off topic but this can eventually be extended to cover more > things than just these libs Possibly. > actually i wanted to cleanup configure and that stuff but > its one of these things that kept sliding down on my todo .. That's probably because as long as configure works a cleanup isn't really important... On 01.12.2016 09:48, Carl Eugen Hoyos wrote: > Needs a Changelog Added, updated patch is attached. > and a NEWS entry. As in "put the Changelog entry on the website"? Fine for me if you think that'd be useful. > Have you tested the patch? Of course, and I made sure that the newly added functionality actually works, however I can't possibly test all combinations of configure options in all sorts of environments for regressions, so help in testing e.g. the more exotic ones would be welcome. > It was tried before and the result were different regressions iirc. Can you provide links to previous attempts and their regressions so that I can make sure they don't happen with my patch? Best regards, Andreas From 68a5545becacd8c3c9d26b16e2ce9aa236e66d6b Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Wed, 30 Nov 2016 23:50:17 +0100 Subject: [PATCH 3/3] configure: fail if autodetect-libraries are requested but not found Signed-off-by: Andreas Cadhalpun --- Changelog | 1 + configure | 78 +++++++++++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 57 insertions(+), 22 deletions(-) diff --git a/Changelog b/Changelog index 71c9273..21d7ed4 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,7 @@ version : - add internal ebur128 library, remove external libebur128 dependency - Pro-MPEG CoP #3-R2 FEC protocol - premultiply video filter +- configure now fails if autodetect-libraries are requested but not found version 3.2: - libopenmpt demuxer diff --git a/configure b/configure index c0f31a7..2747694 100755 --- a/configure +++ b/configure @@ -597,6 +597,13 @@ popvar(){ done } +request(){ + for var in $*; do + eval ${var}_requested=yes + eval $var= + done +} + enable(){ set_all yes $* } @@ -653,6 +660,11 @@ enable_deep_weak(){ done } +requested(){ + test "${1#!}" = "$1" && op='=' || op=!= + eval test "x\$${1#!}_requested" $op "xyes" +} + enabled(){ test "${1#!}" = "$1" && op='=' || op=!= eval test "x\$${1#!}" $op "xyes" @@ -724,9 +736,9 @@ do_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 - enabled_any $dep_any || disable $cfg - disabled_any $dep_sel && disable $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_any $dep_sel && { disable $cfg && requested $cfg && die "ERROR: $cfg requested, but some selected dependency is unsatisfied: $dep_sel"; } if enabled $cfg; then enable_deep $dep_sel @@ -1481,10 +1493,25 @@ EXAMPLE_LIST=" transcode_aac_example transcoding_example " +EXTERNAL_AUTODETECT_LIBRARY_LIST=" + bzlib + iconv + libxcb + libxcb_shm + libxcb_shape + libxcb_xfixes + lzma + schannel + sdl + sdl2 + securetransport + xlib + zlib +" EXTERNAL_LIBRARY_LIST=" + $EXTERNAL_AUTODETECT_LIBRARY_LIST avisynth - bzlib chromaprint crystalhd decklink @@ -1492,7 +1519,6 @@ EXTERNAL_LIBRARY_LIST=" gcrypt gmp gnutls - iconv jni ladspa libass @@ -1545,42 +1571,26 @@ EXTERNAL_LIBRARY_LIST=" libx264 libx265 libxavs - libxcb - libxcb_shm - libxcb_shape - libxcb_xfixes libxvid libzimg libzmq libzvbi - lzma mediacodec netcdf openal opencl opengl openssl - schannel - sdl - sdl2 - securetransport videotoolbox x11grab - xlib - zlib " - -HWACCEL_LIBRARY_LIST=" +HWACCEL_AUTODETECT_LIBRARY_LIST=" audiotoolbox cuda cuvid d3d11va dxva2 - libmfx - libnpp - mmal nvenc - omx vaapi vda vdpau @@ -1588,6 +1598,14 @@ HWACCEL_LIBRARY_LIST=" xvmc " +HWACCEL_LIBRARY_LIST=" + $HWACCEL_AUTODETECT_LIBRARY_LIST + libmfx + libnpp + mmal + omx +" + DOCUMENT_LIST=" doc htmlpages @@ -1684,6 +1702,12 @@ ATOMICS_LIST=" atomics_win32 " +AUTODETECT_LIBS=" + $EXTERNAL_AUTODETECT_LIBRARY_LIST + $HWACCEL_AUTODETECT_LIBRARY_LIST + $THREADS_LIST +" + ARCH_LIST=" aarch64 alpha @@ -3482,6 +3506,11 @@ for e in $env; do eval "export $e" done +# Mark specifically enabled, but normally autodetected libraries as requested. +for lib in $AUTODETECT_LIBS; do + enabled $lib && request $lib +done + # Enable platform codecs by default. # Enable hwaccels by default. for lib in audiotoolbox d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc xlib \ @@ -6379,6 +6408,11 @@ for thread in $THREADS_LIST; do fi done +# Check if requested libraries were found. +for lib in $AUTODETECT_LIBS; do + requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found"; +done + enabled zlib && add_cppflags -DZLIB_CONST # conditional library dependencies, in linking order -- 2.10.2