---
- splitted the auto detection and the different testing / adding flags
  into 2 patches
- use check_*flags since I'm unsure how widely -isystem is supported
  (shouldn't cause problems though since the check_header should have
   failed if the compiler does not understand -isystem)

 configure | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index e395e38..a577b76 100755
--- a/configure
+++ b/configure
@@ -4622,14 +4622,6 @@ enabled libx265           && require_pkg_config x265 
x265.h x265_api_get &&
                                die "ERROR: libx265 version must be >= 57."; }
 enabled libxavs           && require libxavs xavs.h xavs_encoder_encode -lxavs
 enabled libxvid           && require libxvid xvid.h xvid_global -lxvidcore
-enabled mmal              && { check_lib interface/mmal/mmal.h 
mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
-                                { ! enabled cross_compile && {
-                                    add_cflags -isystem/opt/vc/include/ 
-isystem/opt/vc/include/interface/vmcs_host/linux 
-isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline ;
-                                    add_extralibs -L/opt/vc/lib/ -lmmal_core 
-lmmal_util -lmmal_vc_client -lbcm_host ;
-                                    check_lib interface/mmal/mmal.h 
mmal_port_connect ; }
-                                check_lib interface/mmal/mmal.h 
mmal_port_connect ; } ||
-                               die "ERROR: mmal not found"; }
-enabled mmal && check_func_headers interface/mmal/mmal.h 
"MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"
 enabled omx_rpi && enable omx
 enabled omx               && { check_header OMX_Core.h ||
                                 { ! enabled cross_compile && enabled omx_rpi 
&& {
@@ -4743,6 +4735,24 @@ if enabled x11grab; then
     require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
 fi
 
+if enabled mmal ; then
+    check_lib interface/mmal/mmal.h mmal_port_connect
+    check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util 
-lmmal_vc_client -lbcm_host
+
+    # check for mmal on raspbian
+    raspbian_mmal_cflags="-isystem/opt/vc/include/ 
-isystem/opt/vc/include/interface/vmcs_host/linux 
-isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline"
+    raspbian_mmal_ldflags="-L/opt/vc/lib/"
+    ! enabled interface_mmal_mmal_h &&
+        check_header interface/mmal/mmal.h $raspbian_mmal_cflags &&
+        check_cflags $raspbian_mmal_cflags                       &&
+        check_ldflags $raspbian_mmal_ldflags                     &&
+        check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core 
-lmmal_util -lmmal_vc_client -lbcm_host
+
+    enabled mmal_port_connect || die "ERROR: mmal not found"
+
+    check_code cc interface/mmal/mmal.h "int v = 
MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS" && enable 
MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
+fi
+
 enabled vaapi &&
     check_code cc "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" ||
     disable vaapi
-- 
2.8.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to