blob: f1538275d218fedfe3293da40ff50755b035390d [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From 01e738a8f1414acd0102e432bbc15b4e603fd956 Mon Sep 17 00:00:00 2001
2From: Vincent Davis Jr <vince@underview.tech>
3Date: Thu, 8 Dec 2022 10:34:20 -0600
4Subject: [PATCH] configure: setup for OE-core usage
5
6Upstream-Status: Inappropriate
7
8RPI-Distro repo clones original ffmpeg and applies patches to enable
9raspiberry pi support.
10
11Add global CFLAGS and LDFLAGS. So, that when
12./configure runs test it's able to locate proper
13headers and libs in a cross-compile environment.
14
15Add new check to opengl. None of the above headers
16exists and we also should be using GLESv2.
17
18Update where compiler finds OMX_Core.h
19
20Only check that sdl2 version greater than 2.0.1
21
22Signed-off-by: Vincent Davis Jr <vince@underview.tech>
23---
24 configure | 16 +++++++++-------
25 1 file changed, 9 insertions(+), 7 deletions(-)
26
27diff --git a/configure b/configure
28index 723b81f1..0c7f2654 100755
29--- a/configure
30+++ b/configure
31@@ -5746,6 +5746,9 @@ enable_weak_pic() {
32 }
33
34 enabled pic && enable_weak_pic
35+# Set CFLAGS and LDFLAGS globally
36+add_cflags -I${sysroot}/usr/include/ -I${sysroot}/usr/include/IL -I${sysroot}/usr/include/drm
37+add_ldflags -L${sysroot}/usr/lib/
38
39 test_cc <<EOF || die "Symbol mangling check failed."
40 int ff_extern;
41@@ -6471,8 +6474,7 @@ enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt
42 die "ERROR: mbedTLS not found"; }
43 enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
44 ( enabled rpi ||
45- enabled mmal ) && { { add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
46- add_ldflags -L/opt/vc/lib/ &&
47+ enabled mmal ) && { { add_cflags -I${sysroot}/usr/include/interface/vmcs_host/linux -I${sysroot}/usr/include/interface/vcos/pthreads -fgnu89-inline &&
48 check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -lvcsm -lvchostif -lvchiq_arm -lvcos; } ||
49 die "ERROR: mmal not found" &&
50 check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
51@@ -6492,15 +6494,15 @@ enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL
52 check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
53 check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
54 check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
55+ check_lib opengl GLES2/gl2.h glGetError "-lGLESv2" ||
56 die "ERROR: opengl not found."
57 }
58-enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
59+enabled omx_rpi && { test_code cc IL/OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
60 { ! enabled cross_compile &&
61- add_cflags -isystem/opt/vc/include/IL &&
62- test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
63+ test_code cc IL/OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
64 die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
65 enable omx
66-enabled omx && require_headers OMX_Core.h
67+enabled omx && require_headers IL/OMX_Core.h
68 enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
69 check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
70 check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
71@@ -6540,7 +6542,7 @@ fi
72
73 if enabled sdl2; then
74 SDL2_CONFIG="${cross_prefix}sdl2-config"
75- test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent
76+ test_pkg_config sdl2 "sdl2 >= 2.0.1" SDL_events.h SDL_PollEvent
77 if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
78 sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
79 sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
80--
812.38.1
82