Re: [libav-devel] [PATCH 06/12] configure: Add require_cpp_condition() convenience function

2017-02-01 Thread Vittorio Giovara
On Tue, Jan 24, 2017 at 6:12 PM, Diego Biurrun  wrote:
> Simplifies checking for conditions in external library headers and
> aborting if said conditions are not met.
> ---
>  configure | 17 +++--
>  1 file changed, 11 insertions(+), 6 deletions(-)

probably ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 06/12] configure: Add require_cpp_condition() convenience function

2017-01-24 Thread Diego Biurrun
Simplifies checking for conditions in external library headers and
aborting if said conditions are not met.
---
 configure | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index a5d8274..747ce17 100755
--- a/configure
+++ b/configure
@@ -1124,6 +1124,14 @@ require_header(){
 check_header "$header" "$@" || die "ERROR: $header not found"
 }
 
+require_cpp_condition(){
+log require "$@"
+header="$1"
+condition="$2"
+shift 2
+check_cpp_condition "$header" "$condition" "$@" || die "ERROR: $condition 
not satisfied"
+}
+
 require_pkg_config(){
 log require_pkg_config "$@"
 pkg_version="$1"
@@ -4685,13 +4693,11 @@ enabled libvpx&& require_pkg_config "vpx >= 
1.3.0" vpx/vpx_codec.h v
 enabled libwavpack&& require libwavpack wavpack/wavpack.h 
WavpackOpenFileOutput  -lwavpack
 enabled libwebp   && require_pkg_config libwebp webp/encode.h 
WebPGetEncoderVersion
 enabled libx264   && require_pkg_config x264 "stdint.h x264.h" 
x264_encoder_encode &&
- { check_cpp_condition x264.h "X264_BUILD >= 118" 
||
-   die "ERROR: libx264 version must be >= 0.118."; 
} &&
+ require_cpp_condition x264.h "X264_BUILD >= 118" 
&&
  { check_cpp_condition x264.h "X264_MPEG2" &&
enable libx262; }
 enabled libx265   && require_pkg_config x265 x265.h x265_api_get &&
- { check_cpp_condition x265.h "X265_BUILD >= 57" ||
-   die "ERROR: libx265 version must be >= 57."; }
+ require_cpp_condition x265.h "X265_BUILD >= 57"
 enabled libxavs   && require libxavs "stdint.h xavs.h" 
xavs_encoder_encode -lxavs
 enabled libxvid   && require libxvid xvid.h xvid_global -lxvidcore
 enabled mmal  && { check_lib mmal interface/mmal/mmal.h 
mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
@@ -4717,8 +4723,7 @@ enabled gnutls&& check_lib gmp gmp.h 
mpz_export -lgmp
 
 if enabled nvenc; then
 require_header nvEncodeAPI.h
-check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6" ||
-die "ERROR: NVENC API version 5 or older is not supported"
+require_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6"
 fi
 
 if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
-- 
2.1.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel