gl/build: fixed failed compilation due to missing EGLuint64KHR typedef

[Matthew Waters]: add meson differences

https://bugzilla.gnome.org/show_bug.cgi?id=796820
diff --git a/gst-libs/gst/gl/egl/gsteglimage.c b/gst-libs/gst/gl/egl/gsteglimage.c
index f12baad..601e1fd 100644
--- a/gst-libs/gst/gl/egl/gsteglimage.c
+++ b/gst-libs/gst/gl/egl/gsteglimage.c
@@ -86,7 +86,7 @@
 #define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274
 #endif
 
-#ifdef USE_EGL_RPI
+#if !GST_GL_HAVE_EGLUINT64KHR
 typedef khronos_uint64_t EGLuint64KHR;
 #endif
 
diff --git a/gst-libs/gst/gl/gstglconfig.h.meson b/gst-libs/gst/gl/gstglconfig.h.meson
index 4f1fd02..11795c1 100644
--- a/gst-libs/gst/gl/gstglconfig.h.meson
+++ b/gst-libs/gst/gl/gstglconfig.h.meson
@@ -43,6 +43,7 @@
 #mesondefine GST_GL_HAVE_GLUINT64
 #mesondefine GST_GL_HAVE_GLINT64
 #mesondefine GST_GL_HAVE_EGLATTRIB
+#mesondefine GST_GL_HAVE_EGLUINT64KHR
 
 G_END_DECLS
 
diff --git a/gst-libs/gst/gl/meson.build b/gst-libs/gst/gl/meson.build
index a483066..e32d415 100644
--- a/gst-libs/gst/gl/meson.build
+++ b/gst-libs/gst/gl/meson.build
@@ -122,6 +122,7 @@
     'GST_GL_HAVE_GLUINT64',
     'GST_GL_HAVE_GLINT64',
     'GST_GL_HAVE_EGLATTRIB',
+    'GST_GL_HAVE_EGLUINT64KHR',
 ]
 
 foreach option : glconf_options
@@ -692,6 +693,9 @@
   if egl_dep.found() and cc.has_type('EGLAttrib', prefix : gl_include_block + egl_includes, dependencies : gl_lib_deps + [egl_dep])
     glconf.set('GST_GL_HAVE_EGLATTRIB', 1)
   endif
+  if egl_dep.found() and cc.has_type('EGLuint64KHR', prefix : gl_include_block + egl_includes, dependencies : gl_lib_deps + [egl_dep], include_directories : gl_includes)
+    glconf.set('GST_GL_HAVE_EGLUINT64KHR', 1)
+  endif
 
   message('Building libgstgl with GL api:      ' + ' '.join(enabled_gl_apis))
   message('Building libgstgl with GL platform: ' + ' '.join(enabled_gl_platforms))
diff --git a/m4/gst-gl.m4 b/m4/gst-gl.m4
index 1e97240..c9c7602 100644
--- a/m4/gst-gl.m4
+++ b/m4/gst-gl.m4
@@ -897,6 +897,7 @@
 GST_GL_HAVE_GLUINT64=0
 GST_GL_HAVE_GLINT64=0
 GST_GL_HAVE_EGLATTRIB=0
+GST_GL_HAVE_EGLUINT64KHR=0
 
 old_CFLAGS=$CFLAGS
 CFLAGS="$GL_CFLAGS $CFLAGS"
@@ -945,6 +946,11 @@
   if test "x$ac_cv_type_EGLAttrib" = "xyes"; then
     GST_GL_HAVE_EGLATTRIB=1
   fi
+
+  AC_CHECK_TYPES(EGLuint64KHR, [], [], [[$EGL_INCLUDES]])
+  if test "x$ac_cv_type_EGLuint64KHR" = "xyes"; then
+    GST_GL_HAVE_EGLUINT64KHR=1
+  fi
 fi
 
 CFLAGS=$old_CFLAGS
@@ -958,6 +964,7 @@
 #define GST_GL_HAVE_GLUINT64 $GST_GL_HAVE_GLUINT64
 #define GST_GL_HAVE_GLINT64 $GST_GL_HAVE_GLINT64
 #define GST_GL_HAVE_EGLATTRIB $GST_GL_HAVE_EGLATTRIB
+#define GST_GL_HAVE_EGLUINT64KHR $GST_GL_HAVE_EGLUINT64KHR
 "
 
 AC_CONFIG_COMMANDS([gst-libs/gst/gl/gstglconfig.h], [