Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to check version

2019-03-04 Thread Guo, Yejun
sorry for the disturbance, I missed "" in the command line, please ignore this 
patch, thanks.

> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Guo, Yejun
> Sent: Monday, March 04, 2019 7:57 PM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to
> check version
> 
> 
> 
> > -Original Message-
> > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
> Behalf
> > Of Timo Rothenpieler
> > Sent: Monday, March 04, 2019 5:43 PM
> > To: ffmpeg-devel@ffmpeg.org
> > Subject: Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config
> to
> > check version
> >
> > This seems weird to me, why would there only be an issue on Ubuntu 16.04?
> 
> I guess it is a common issue, I'm at home and do not have other systems for a
> test.
> 
> > I'd assume that the code in question has been tested quite a bit.
> >
> > Do you have an example of where and how it fails?
> 
> I've built and installed libvpx version 1.8 on my system with following 
> vpx.pc:
> $ cat /usr/local/lib/pkgconfig/vpx.pc
> # pkg-config file from libvpx v1.8.0-191-g503cb8e
> prefix=/usr/local
> exec_prefix=${prefix}
> libdir=${prefix}/lib
> includedir=${prefix}/include
> 
> Name: vpx
> Description: WebM Project VPx codec implementation
> Version: 1.8.0
> Requires:
> Conflicts:
> Libs: -L${libdir} -lvpx -lm
> Libs.private: -lm -lpthread
> Cflags: -I${includedir}
> 
> 
> I did the following experiments to say it is an issue for the version check.
> 
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors
> vpx >=1.2
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 0
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors
> vpx >=2.3
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 0
> 
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx --
> atleast-version=1.2
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 0
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx --
> atleast-version=2.3
> Requested 'vpx >= 2.3' but version of vpx is 1.8.0
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 1
> 
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >=
> 1.2
> Package 1.2 was not found in the pkg-config search path.
> Perhaps you should add the directory containing `1.2.pc'
> to the PKG_CONFIG_PATH environment variable
> No package '1.2' found
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 1
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >=
> 2.3
> Package 2.3 was not found in the pkg-config search path.
> Perhaps you should add the directory containing `2.3.pc'
> to the PKG_CONFIG_PATH environment variable
> No package '2.3' found
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 1
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to check version

2019-03-04 Thread Guo, Yejun


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Timo Rothenpieler
> Sent: Monday, March 04, 2019 5:43 PM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to
> check version
> 
> This seems weird to me, why would there only be an issue on Ubuntu 16.04?

I guess it is a common issue, I'm at home and do not have other systems for a 
test.

> I'd assume that the code in question has been tested quite a bit.
> 
> Do you have an example of where and how it fails?

I've built and installed libvpx version 1.8 on my system with following vpx.pc:
$ cat /usr/local/lib/pkgconfig/vpx.pc 
# pkg-config file from libvpx v1.8.0-191-g503cb8e
prefix=/usr/local
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

Name: vpx
Description: WebM Project VPx codec implementation
Version: 1.8.0
Requires:
Conflicts:
Libs: -L${libdir} -lvpx -lm
Libs.private: -lm -lpthread
Cflags: -I${includedir}


I did the following experiments to say it is an issue for the version check.

yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >=1.2
yguo18@yguo18-skl-u1604:/tmp$ echo $?
0
yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >=2.3
yguo18@yguo18-skl-u1604:/tmp$ echo $?
0

yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx 
--atleast-version=1.2
yguo18@yguo18-skl-u1604:/tmp$ echo $?
0
yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx 
--atleast-version=2.3
Requested 'vpx >= 2.3' but version of vpx is 1.8.0
yguo18@yguo18-skl-u1604:/tmp$ echo $?
1

yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >= 1.2
Package 1.2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `1.2.pc'
to the PKG_CONFIG_PATH environment variable
No package '1.2' found
yguo18@yguo18-skl-u1604:/tmp$ echo $?
1
yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >= 2.3
Package 2.3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `2.3.pc'
to the PKG_CONFIG_PATH environment variable
No package '2.3' found
yguo18@yguo18-skl-u1604:/tmp$ echo $?
1

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


Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to check version

2019-03-04 Thread myp...@gmail.com
On Mon, Mar 4, 2019 at 4:06 PM Guo, Yejun  wrote:
>
> I tried pkg-config on my local ubuntu16.04 system, the option like
> ">=1.2" or "<3.2" does not work, we have to use option --atleast-version
> and --max-version separately.
>
> Signed-off-by: Guo, Yejun 
> ---
>  configure | 57 ++---
>  1 file changed, 30 insertions(+), 27 deletions(-)
>
> diff --git a/configure b/configure
> index 3e2a487..e397d19 100755
> --- a/configure
> +++ b/configure
> @@ -6045,10 +6045,13 @@ fi
>
>  if ! disabled ffnvcodec; then
>  ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h 
> ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
> -check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.0" "$ffnv_hdr_list" "" 
> || \
> -  check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.8 ffnvcodec < 8.3" 
> "$ffnv_hdr_list" "" || \
> -  check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.9 ffnvcodec < 8.2" 
> "$ffnv_hdr_list" "" || \
> -  check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.9 ffnvcodec < 8.1" 
> "$ffnv_hdr_list" ""
> +check_pkg_config ffnvcodec "ffnvcodec --atleast-version=9.0.18.0" 
> "$ffnv_hdr_list" "" || \
> +  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.2.15.8" 
> "$ffnv_hdr_list" ""  && \
> +   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.2.99" 
> "$ffnv_hdr_list" "") || \
> +  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.1.24.9" 
> "$ffnv_hdr_list" ""  && \
> +   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.1.99" 
> "$ffnv_hdr_list" "") || \
> +  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.0.14.9" 
> "$ffnv_hdr_list" ""  && \
> +   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.0.99" 
> "$ffnv_hdr_list" "")
>  fi
>
>  check_cpp_condition winrt windows.h 
> "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
> @@ -6128,8 +6131,8 @@ enabled gmp   && require gmp gmp.h 
> mpz_export -lgmp
>  enabled gnutls&& require_pkg_config gnutls gnutls 
> gnutls/gnutls.h gnutls_global_init
>  enabled jni   && { [ $target_os = "android" ] && check_headers 
> jni.h && enabled pthreads || die "ERROR: jni not found"; }
>  enabled ladspa&& require_headers "ladspa.h dlfcn.h"
> -enabled libaom&& require_pkg_config libaom "aom >= 1.0.0" 
> aom/aom_codec.h aom_codec_version
> -enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 > 1.0.3" 
> "aribb24/aribb24.h" arib_instance_new ||
> +enabled libaom&& require_pkg_config libaom "aom 
> --atleast-version=1.0.0" aom/aom_codec.h aom_codec_version
> +enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 
> --atleast-version=1.0.4" "aribb24/aribb24.h" arib_instance_new ||
> { enabled gpl && require_pkg_config 
> libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
> die "ERROR: libaribb24 requires version 
> higher than 1.0.3 or --enable-gpl."; }
>  enabled lv2   && require_pkg_config lv2 lilv-0 "lilv/lilv.h" 
> lilv_world_new
> @@ -6142,8 +6145,8 @@ enabled libcelt   && require libcelt 
> celt/celt.h celt_decode -lcelt0 &&
> die "ERROR: libcelt must be installed and 
> version must be >= 0.11.0."; }
>  enabled libcaca   && require_pkg_config libcaca caca caca.h 
> caca_create_canvas
>  enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create 
> -lcodec2
> -enabled libdav1d  && require_pkg_config libdav1d "dav1d >= 0.1.0" 
> "dav1d/dav1d.h" dav1d_version
> -enabled libdavs2  && require_pkg_config libdavs2 "davs2 >= 1.6.0" 
> davs2.h davs2_decoder_open
> +enabled libdav1d  && require_pkg_config libdav1d "dav1d 
> --atleast-version=0.1.0" "dav1d/dav1d.h" dav1d_version
> +enabled libdavs2  && require_pkg_config libdavs2 "davs2 
> --atleast-version=1.6.0" davs2.h davs2_decoder_open
>  enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 
> dc1394/dc1394.h dc1394_new
>  enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h 
> drmGetVersion
>  enabled libfdk_aac&& { check_pkg_config libfdk_aac fdk-aac 
> "fdk-aac/aacenc_lib.h" aacEncOpen ||
> @@ -6162,7 +6165,7 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
> "gsm/gsm.h"; do
> done || die "ERROR: libgsm not found"; }
>  enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
> -lilbc $pthreads_extralibs
>  enabled libklvanc && require libklvanc libklvanc/vanc.h 
> klvanc_context_create -lklvanc
> -enabled libkvazaar&& require_pkg_config libkvazaar "kvazaar >= 
> 0.8.1" kvazaar.h kvz_api_get
> +enabled libkvazaar&& require_pkg_config libkvazaar "kvazaar 
> --atleast-version=0.8.1" kvazaar.h kvz_api_get
>  enabled liblensfun&& require_pkg_config liblensfun lensfun l

Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to check version

2019-03-04 Thread Timo Rothenpieler

This seems weird to me, why would there only be an issue on Ubuntu 16.04?
I'd assume that the code in question has been tested quite a bit.

Do you have an example of where and how it fails?



smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] use the correct option of pkg-config to check version

2019-03-04 Thread Guo, Yejun
I tried pkg-config on my local ubuntu16.04 system, the option like
">=1.2" or "<3.2" does not work, we have to use option --atleast-version
and --max-version separately.

Signed-off-by: Guo, Yejun 
---
 configure | 57 ++---
 1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/configure b/configure
index 3e2a487..e397d19 100755
--- a/configure
+++ b/configure
@@ -6045,10 +6045,13 @@ fi
 
 if ! disabled ffnvcodec; then
 ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h 
ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
-check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.0" "$ffnv_hdr_list" "" || \
-  check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.8 ffnvcodec < 8.3" 
"$ffnv_hdr_list" "" || \
-  check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.9 ffnvcodec < 8.2" 
"$ffnv_hdr_list" "" || \
-  check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.9 ffnvcodec < 8.1" 
"$ffnv_hdr_list" ""
+check_pkg_config ffnvcodec "ffnvcodec --atleast-version=9.0.18.0" 
"$ffnv_hdr_list" "" || \
+  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.2.15.8" 
"$ffnv_hdr_list" ""  && \
+   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.2.99" 
"$ffnv_hdr_list" "") || \
+  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.1.24.9" 
"$ffnv_hdr_list" ""  && \
+   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.1.99" 
"$ffnv_hdr_list" "") || \
+  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.0.14.9" 
"$ffnv_hdr_list" ""  && \
+   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.0.99" 
"$ffnv_hdr_list" "")
 fi
 
 check_cpp_condition winrt windows.h 
"!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
@@ -6128,8 +6131,8 @@ enabled gmp   && require gmp gmp.h mpz_export 
-lgmp
 enabled gnutls&& require_pkg_config gnutls gnutls gnutls/gnutls.h 
gnutls_global_init
 enabled jni   && { [ $target_os = "android" ] && check_headers 
jni.h && enabled pthreads || die "ERROR: jni not found"; }
 enabled ladspa&& require_headers "ladspa.h dlfcn.h"
-enabled libaom&& require_pkg_config libaom "aom >= 1.0.0" 
aom/aom_codec.h aom_codec_version
-enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 > 1.0.3" 
"aribb24/aribb24.h" arib_instance_new ||
+enabled libaom&& require_pkg_config libaom "aom 
--atleast-version=1.0.0" aom/aom_codec.h aom_codec_version
+enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 
--atleast-version=1.0.4" "aribb24/aribb24.h" arib_instance_new ||
{ enabled gpl && require_pkg_config libaribb24 
aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
die "ERROR: libaribb24 requires version higher 
than 1.0.3 or --enable-gpl."; }
 enabled lv2   && require_pkg_config lv2 lilv-0 "lilv/lilv.h" 
lilv_world_new
@@ -6142,8 +6145,8 @@ enabled libcelt   && require libcelt celt/celt.h 
celt_decode -lcelt0 &&
die "ERROR: libcelt must be installed and 
version must be >= 0.11.0."; }
 enabled libcaca   && require_pkg_config libcaca caca caca.h 
caca_create_canvas
 enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create 
-lcodec2
-enabled libdav1d  && require_pkg_config libdav1d "dav1d >= 0.1.0" 
"dav1d/dav1d.h" dav1d_version
-enabled libdavs2  && require_pkg_config libdavs2 "davs2 >= 1.6.0" 
davs2.h davs2_decoder_open
+enabled libdav1d  && require_pkg_config libdav1d "dav1d 
--atleast-version=0.1.0" "dav1d/dav1d.h" dav1d_version
+enabled libdavs2  && require_pkg_config libdavs2 "davs2 
--atleast-version=1.6.0" davs2.h davs2_decoder_open
 enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 
dc1394/dc1394.h dc1394_new
 enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h 
drmGetVersion
 enabled libfdk_aac&& { check_pkg_config libfdk_aac fdk-aac 
"fdk-aac/aacenc_lib.h" aacEncOpen ||
@@ -6162,7 +6165,7 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
"gsm/gsm.h"; do
done || die "ERROR: libgsm not found"; }
 enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
-lilbc $pthreads_extralibs
 enabled libklvanc && require libklvanc libklvanc/vanc.h 
klvanc_context_create -lklvanc
-enabled libkvazaar&& require_pkg_config libkvazaar "kvazaar >= 0.8.1" 
kvazaar.h kvz_api_get
+enabled libkvazaar&& require_pkg_config libkvazaar "kvazaar 
--atleast-version=0.8.1" kvazaar.h kvz_api_get
 enabled liblensfun&& require_pkg_config liblensfun lensfun lensfun.h 
lf_db_new
 # While it may appear that require is being used as a pkg-config
 # fallback for libmfx, it is actually being used to detect a different
@@ -6186,9 +6189,9 @@ enabled libopencv && { check_headers 
opencv2/core/core_c