[FFmpeg-devel] [PATCH 3/3] configure: fail if autodetect-libraries are requested but not found
Michael Niedermayer
michael at niedermayer.cc
Thu Dec 1 02:34:17 EET 2016
On Thu, Dec 01, 2016 at 12:22:50AM +0100, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
> configure | 72 ++++++++++++++++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 53 insertions(+), 19 deletions(-)
>
> diff --git a/configure b/configure
> index 28c78ef..0e9695b 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"
> @@ -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 audiotoolbox
>
> @@ -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 unless i miss
something
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= ...
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
also off topic but this can eventually be extended to cover more
things than just these libs
actually i wanted to cleanup configure and that stuff but
its one of these things that kept sliding down on my todo ..
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161201/4c7a0cb1/attachment.sig>
More information about the ffmpeg-devel
mailing list