diff mbox

[FFmpeg-devel,2/2] configure: add pkg-config check for openal

Message ID 20171129203941.10598-3-qyot27@gmail.com
State New
Headers show

Commit Message

Stephen Hutchinson Nov. 29, 2017, 8:39 p.m. UTC
---
 configure | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Hendrik Leppkes Nov. 29, 2017, 8:58 p.m. UTC | #1
On Wed, Nov 29, 2017 at 9:39 PM, Stephen Hutchinson <qyot27@gmail.com> wrote:
> ---
>  configure | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/configure b/configure
> index 3c08125da3..141c8b742f 100755
> --- a/configure
> +++ b/configure
> @@ -5952,11 +5952,13 @@ enabled mmal              && { check_lib mmal interface/mmal/mmal.h mmal_port_co
>                                   check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
>                                 die "ERROR: mmal not found" &&
>                                 check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
> -enabled openal            && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
> -                               check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
> -                               die "ERROR: openal not found"; } &&
> -                             { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
> -                               die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
> +enabled openal            && { check_pkg_config openal openal AL/al.h alGetError ||
> +                               { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
> +                                 check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } &&
> +                                 warn "using openal without pkg-config"; ||
> +                                 die "ERROR: openal not found"; } &&
> +                               { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
> +                                 die "ERROR: openal must be installed and version must be 1.1 or compatible"; } }


The same applies here as with twolame, we don't really want to
duplicate all sorts of checks, so if pkg-config has been available for
a sufficiently long time, then just use it always.

- hendrik
Stephen Hutchinson Nov. 30, 2017, 1:39 a.m. UTC | #2
On 11/29/2017 3:58 PM, Hendrik Leppkes wrote:
> The same applies here as with twolame, we don't really want to
> duplicate all sorts of checks, so if pkg-config has been available for
> a sufficiently long time, then just use it always.
> 

Ok.  TwoLAME is pretty clear-cut, but OpenAL raises more questions.

The configure check says 'OpenAL 1.1 or compatible'. If we're
assuming openal-soft rather than the really old Creative SDK,
then the git history of openal.pc.in its current location dates
back to version 1.11.753, in 2009 (the .pc.in file first appeared in
2008, which appears to be with version 1.5.304).

Practically, I think it's safe to assume users are going to fetch
a reasonably current version of openal-soft, but for precision's
sake should that mean we force a version check so that version
1.11.753 (or 1.12 for convenience?) or higher is required?
And at that point the description for --enable-openal would
probably need to change so that it explicitly states using
openal-soft.

I thought I remembered OpenAL coming up in a discussion on
ffmpeg-devel on pkg-config sometime a few months ago
(or maybe it was on Trac?), and there was something mentioned
about OS X or file paths not always leading to the correct .pc file,
and that using pkg-config couldn't always find it.  I can't seem to
find that now, though.
diff mbox

Patch

diff --git a/configure b/configure
index 3c08125da3..141c8b742f 100755
--- a/configure
+++ b/configure
@@ -5952,11 +5952,13 @@  enabled mmal              && { check_lib mmal interface/mmal/mmal.h mmal_port_co
                                  check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
                                die "ERROR: mmal not found" &&
                                check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
-enabled openal            && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
-                               check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
-                               die "ERROR: openal not found"; } &&
-                             { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
-                               die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
+enabled openal            && { check_pkg_config openal openal AL/al.h alGetError ||
+                               { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
+                                 check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } &&
+                                 warn "using openal without pkg-config"; ||
+                                 die "ERROR: openal not found"; } &&
+                               { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
+                                 die "ERROR: openal must be installed and version must be 1.1 or compatible"; } }
 enabled opencl            && { check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
                                check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
                                die "ERROR: opencl not found"; } &&