From ea40fa36eef15384b4c0218fb102f92f5cd1cdff Mon Sep 17 00:00:00 2001 From: Ilya Tumaykin Date: Fri, 27 Jan 2017 21:20:29 +0300 Subject: build: rpi: rely on pkgconfig for compiler flags Upstream provides pkgconfig files for quite some time now [1,2]. Use them to determine the required flags instead of hard coding. This makes cross-compilation easy, which I dare to say is important for many raspberry-pi users. This also prevents picking libEGL and libGLESv2 from mesa when they are present, which can happen with the current code. Good distros should put these pkgconfig files into default pkg-config search path or populate PKG_CONFIG_PATH for users. However, be nice to everybody and manually look into '/opt/vc/lib/pkgconfig' just in case. Hence the PKG_CONFIG_PATH mangling. [1]: https://github.com/raspberrypi/userland/issues/245 [2]: https://github.com/raspberrypi/userland/commit/05d60a01d53dca363bb4286594db1826ffff8762 --- wscript | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 81a048df5d..ab853e7ad8 100644 --- a/wscript +++ b/wscript @@ -738,27 +738,9 @@ video_output_features = [ 'desc': 'Android support', 'func': check_statement('android/api-level.h', '(void)__ANDROID__'), # arbitrary android-specific header }, { - # We need MMAL/bcm_host/dispmanx APIs. Also, most RPI distros require - # every project to hardcode the paths to the include directories. Also, - # these headers are so broken that they spam tons of warnings by merely - # including them (compensate with -isystem and -fgnu89-inline). 'name': '--rpi', 'desc': 'Raspberry Pi support', - 'func': compose_checks( - check_cc(cflags="-isystem/opt/vc/include/ "+ - "-isystem/opt/vc/include/interface/vcos/pthreads " + - "-isystem/opt/vc/include/interface/vmcs_host/linux " + - "-fgnu89-inline", - linkflags="-L/opt/vc/lib", - header_name="bcm_host.h", - lib=['mmal_core', 'mmal_util', 'mmal_vc_client', 'bcm_host']), - # We still need all OpenGL symbols, because the vo_opengl code is - # generic and supports anything from GLES2/OpenGL 2.1 to OpenGL 4 core. - check_cc(lib="EGL"), - check_cc(lib="GLESv2"), - check_statement('GL/gl.h', '(void)GL_RGB32F'), # arbitrary OpenGL 3.0 symbol - check_statement('GL/gl.h', '(void)GL_LUMINANCE16') # arbitrary OpenGL legacy-only symbol - ), + 'func': check_rpi, }, { 'name': '--standard-gl', 'desc': 'Desktop standard OpenGL support', -- cgit v1.2.3