RPI: add Mesa override & update vendor library names
authorConn O'Griofa <connogriofa@gmail.com>
Mon, 16 Oct 2017 16:50:42 +0000 (17:50 +0100)
committerConn O'Griofa <connogriofa@gmail.com>
Tue, 17 Oct 2017 03:16:50 +0000 (03:16 +0000)
* Update RPI vendor library names to allow compatibility with recent
firmwares that have obsoleted the originally named duplicate libraries.
* Add override to build against VC4 Mesa driver via "VIDEOCORE=no"

configure

index 4d9b566..c3ff68f 100755 (executable)
--- a/configure
+++ b/configure
@@ -442,13 +442,14 @@ EOF
 fi
 
 # check for VideoCore stuff for Raspberry Pi
-if [ -d /opt/vc/include -a -d /opt/vc/lib ]; then
+if [ -d /opt/vc/include -a -d /opt/vc/lib -a "$VIDEOCORE" != "no" ]; then
   CFLAGS_GLES="$CFLAGS_GLES -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
   LDLIBS_GLES="$LDLIBS_GLES -L/opt/vc/lib"
   if [ -f /opt/vc/lib/libbcm_host.so ]; then
     LDLIBS_GLES="$LDLIBS_GLES -lbcm_host"
   fi
   need_xlib="yes"
+  VIDEOCORE="yes"
 fi
 
 # check for GLES headers
@@ -459,7 +460,10 @@ int main(void) {
   return (int)eglGetDisplay( (EGLNativeDisplayType)0 );
 }
 EOF
-if compile_binary $CFLAGS_GLES -lEGL -lGLES_CM $LDLIBS_GLES; then
+if [ "$VIDEOCORE" = "yes" ] && compile_binary $CFLAGS_GLES -lbrcmEGL -lbrcmGLESv2 $LDLIBS_GLES; then
+  have_gles="yes"
+  LDLIBS_GLES="-lbrcmEGL -lbrcmGLESv2 $LDLIBS_GLES"
+elif compile_binary $CFLAGS_GLES -lEGL -lGLES_CM $LDLIBS_GLES; then
   have_gles="yes"
   LDLIBS_GLES="-lEGL -lGLES_CM $LDLIBS_GLES"
 elif compile_binary $CFLAGS_GLES -lEGL -lGLESv1_CM $LDLIBS_GLES; then