configure: Simplify AMF check with a helper function

Message ID 20180307123128.29657-1-diego@biurrun.de
State Committed
Commit 121314895f6360852b2807d5dfafea576b2e6fed
Headers show
Series
  • configure: Simplify AMF check with a helper function
Related show

Commit Message

Diego Biurrun March 7, 2018, 12:31 p.m.
---
 configure | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Diego Biurrun March 7, 2018, 12:55 p.m. | #1
On Wed, Mar 07, 2018 at 01:31:28PM +0100, Diego Biurrun wrote:
> --- a/configure
> +++ b/configure
> @@ -4598,11 +4598,7 @@ for func in $MATH_FUNCS; do
>  # these are off by default, so fail if requested and not available
> -
> -enabled amf &&
> -    check_cpp_condition "AMF/core/Version.h" \
> -        "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001" ||
> -    disable amf
> +enabled amf               && require_cpp_condition AMF/core/Version.h "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001"

Log message amended locally to

  configure: Fix logic of AMF external library check

  Fail if AMF is requested but unavailable, as we do for all
  other external libraries that need to be explicitly enabled.

Diego
Luca Barbato March 7, 2018, 1 p.m. | #2
On 07/03/2018 13:31, Diego Biurrun wrote:
> ---
>   configure | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/configure b/configure
> index 1c35f9dc64..d882d4c73f 100755
> --- a/configure
> +++ b/configure
> @@ -4598,11 +4598,7 @@ for func in $MATH_FUNCS; do
>   done
>   
>   # these are off by default, so fail if requested and not available
> -
> -enabled amf &&
> -    check_cpp_condition "AMF/core/Version.h" \
> -        "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001" ||
> -    disable amf
> +enabled amf               && require_cpp_condition AMF/core/Version.h "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001"
>   enabled avisynth          && require_header avisynth/avisynth_c.h
>   enabled avxsynth          && require_header avxsynth/avxsynth_c.h
>   enabled cuda              && require cuda cuda.h cuInit -lcuda
> 

Seems fine.

Patch

diff --git a/configure b/configure
index 1c35f9dc64..d882d4c73f 100755
--- a/configure
+++ b/configure
@@ -4598,11 +4598,7 @@  for func in $MATH_FUNCS; do
 done
 
 # these are off by default, so fail if requested and not available
-
-enabled amf &&
-    check_cpp_condition "AMF/core/Version.h" \
-        "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001" ||
-    disable amf
+enabled amf               && require_cpp_condition AMF/core/Version.h "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001"
 enabled avisynth          && require_header avisynth/avisynth_c.h
 enabled avxsynth          && require_header avxsynth/avxsynth_c.h
 enabled cuda              && require cuda cuda.h cuInit -lcuda