blob: b9f5ad591c1004ebee98adc7c2538575ca7cc705 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001From e8716a7755eef93e1033bb913e1eb4faee54658f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 15 Apr 2020 18:29:26 -0700
4Subject: [PATCH] Use packageconfig to detect mmal support
5
6This needs userland graphics libraries, because distros may install it
7in different locations, therefore its best to rely on pkgconf to find
8the libs and header locations instead of assuming /opt/vc which might
9work on some distros ( like raspbian ) but not everywhere
10
Patrick Williams8e7b46e2023-05-01 14:19:06 -050011Upstream-Status: Pending
Andrew Geissler82c905d2020-04-13 13:39:40 -050012Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 configure.ac | 31 +++++++++++--------------------
15 1 file changed, 11 insertions(+), 20 deletions(-)
16
Andrew Geissler82c905d2020-04-13 13:39:40 -050017--- a/configure.ac
18+++ b/configure.ac
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050019@@ -3461,27 +3461,18 @@ AC_ARG_ENABLE(mmal,
Andrew Geissler82c905d2020-04-13 13:39:40 -050020 AS_HELP_STRING([--enable-mmal],
21 [Multi-Media Abstraction Layer (MMAL) hardware plugin (default enable)]))
22 if test "${enable_mmal}" != "no"; then
23- VLC_SAVE_FLAGS
24- LDFLAGS="${LDFLAGS} -L/opt/vc/lib -lvchostif"
25- CPPFLAGS="${CPPFLAGS} -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux"
26- AC_CHECK_HEADERS(interface/mmal/mmal.h,
27- [ AC_CHECK_LIB(bcm_host, vc_tv_unregister_callback_full, [
28- have_mmal="yes"
29- VLC_ADD_PLUGIN([mmal])
30- VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
31- VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
32- VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
33- AS_IF([test "${enable_mmal}" = "yes"],
34- [ AC_MSG_ERROR([Cannot find bcm library...]) ],
35- [ AC_MSG_WARN([Cannot find bcm library...]) ])
36- ],
37- [])
38- ] , [ AS_IF([test "${enable_mmal}" = "yes"],
39- [ AC_MSG_ERROR([Cannot find development headers for mmal...]) ],
40- [ AC_MSG_WARN([Cannot find development headers for mmal...]) ]) ])
41- VLC_RESTORE_FLAGS
42+ PKG_CHECK_MODULES(BCMHOST, [bcm_host], [
43+ HAVE_BCMHOST=yes
44+ AC_DEFINE(HAVE_BCMHOST, 1, [Define this if you have have userlang graphics installed])
45+ VLC_ADD_LIBS([bcmhost],[$BCMHOST_LIBS])
46+ VLC_ADD_CFLAGS([bcmhost],[$BCMHOST_CFLAGS])
47+ ],:
48+ [AC_MSG_WARN([${BCMHOST_PKG_ERRORS}: userland graphics not available.])
49+ HAVE_BCMHOST=no])
50+
51+ AC_CHECK_HEADERS(interface/mmal/mmal.h)
52 fi
53-AM_CONDITIONAL([HAVE_MMAL], [test "${have_mmal}" = "yes"])
54+AM_CONDITIONAL([HAVE_MMAL], [test "${have_bcmhost}" = "yes"])
55
56 dnl
57 dnl evas plugin