mesa: Upgrade Mesa for Raspberry Pi 4
[AGL/meta-agl.git] / meta-agl-bsp / meta-raspberrypi / recipes-graphics / mesa / mesa-demos / 0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch b/meta-agl-bsp/meta-raspberrypi/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
new file mode 100644 (file)
index 0000000..f6b59a1
--- /dev/null
@@ -0,0 +1,377 @@
+From 779438770bedf3d53e6ad8f7cd6889b7f50daf3b Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Wed, 9 Jul 2014 14:23:41 +0200
+Subject: [PATCH] configure: Allow to disable demos which require GLEW or GLU
+
+* in some systems without X11 support we don't have GLEW, but
+  mesa-demos are still useful
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Port to 8.3.0
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac                  | 49 ++++++++++++++++++++---------
+ src/Makefile.am               | 18 ++++++++---
+ src/demos/Makefile.am         | 73 ++++++++++++++++++++++++-------------------
+ src/egl/Makefile.am           |  8 +++--
+ src/egl/opengles1/Makefile.am | 10 ++++--
+ src/egl/opengles2/Makefile.am | 29 ++++++++---------
+ 6 files changed, 117 insertions(+), 70 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0525b09..28834cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
+               [AC_DEFINE(HAVE_FREEGLUT)],
+               [])
+-dnl Check for GLEW
+-PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
+-DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
+-DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
++AC_ARG_ENABLE([glew],
++    [AS_HELP_STRING([--enable-glew],
++        [build demos which require glew @<:@default=yes@:>@])],
++    [enable_glew="$enableval"],
++    [enable_glew=yes]
++)
++
++if test "x$enable_glew" = xyes; then
++    dnl Check for GLEW
++    PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no])
++    DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
++    DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
++fi
+ # LIBS was set by AC_CHECK_LIB above
+ LIBS=""
+-PKG_CHECK_MODULES(GLU, [glu], [],
+-                [AC_CHECK_HEADER([GL/glu.h],
+-                                 [],
+-                                 AC_MSG_ERROR([GLU not found]))
+-                 AC_CHECK_LIB([GLU],
+-                              [gluBeginCurve],
+-                              [GLU_LIBS=-lGLU],
+-                              AC_MSG_ERROR([GLU required])) ])
++AC_ARG_ENABLE([glu],
++    [AS_HELP_STRING([--enable-glu],
++        [build demos which require glu @<:@default=yes@:>@])],
++    [enable_glu="$enableval"],
++    [enable_glu=yes]
++)
+-DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
+-DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
++if test "x$enable_glu" = xyes; then
++    PKG_CHECK_MODULES(GLU, [glu], [glu_enabled=yes],
++                     [AC_CHECK_HEADER([GL/glu.h],
++                                      [],
++                                      AC_MSG_ERROR([GLU not found]))
++                      AC_CHECK_LIB([GLU],
++                                   [gluBeginCurve],
++                                   [GLU_LIBS=-lGLU
++                                  glu_enabled=yes],
++                                   AC_MSG_ERROR([GLU required])) ])
++
++    DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
++    DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
++fi
+ AC_ARG_ENABLE([egl],
+     [AS_HELP_STRING([--enable-egl],
+@@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS])
+ AC_SUBST([WAYLAND_LIBS])
++AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
++AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 1647d64..8b89dee 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -22,15 +22,19 @@
+ # Authors:
+ #    Eric Anholt <eric@anholt.net>
++if HAVE_GLEW
++UTIL = util
++endif
++
+ SUBDIRS = \
+-      util \
++      $(UTIL) \
+       data \
+       demos \
+       egl \
+       fp \
+       fpglsl \
+       glsl \
+-        gs \
++      gs \
+       objviewer \
+       osdemos \
+       perf \
+@@ -40,8 +44,12 @@ SUBDIRS = \
+       slang \
+       tests \
+       tools \
+-      trivial \
+-      vp \
+-      vpglsl \
+       wgl \
+       xdemos
++
++if HAVE_GLEW
++SUBDIRS += \
++      vp \
++      vpglsl \
++      trivial
++endif
+diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
+index 41603fa..ab1e3ab 100644
+--- a/src/demos/Makefile.am
++++ b/src/demos/Makefile.am
+@@ -30,91 +30,100 @@ AM_LDFLAGS = \
+       $(DEMO_LIBS) \
+       $(GLUT_LIBS)
++bin_PROGRAMS =
++
+ if HAVE_GLUT
+-bin_PROGRAMS = \
++if HAVE_GLEW
++bin_PROGRAMS += \
+       arbfplight \
+       arbfslight \
+       arbocclude \
+       arbocclude2 \
+-      bounce \
+-      clearspd \
+       copypix \
+       cubemap \
+       cuberender \
+       dinoshade \
+-      dissolve \
+-      drawpix \
+       engine \
+       fbo_firecube \
+       fbotexture \
+-      fire \
+       fogcoord \
+       fplight \
+       fslight \
++      gloss \
++      isosurf \
++      multiarb \
++      paltex \
++      pointblast \
++      projtex \
++      shadowtex \
++      spriteblast \
++      stex3d \
++      textures \
++      vao_demo \
++      winpos
++
++copypix_LDADD = ../util/libutil.la
++cubemap_LDADD = ../util/libutil.la
++cuberender_LDADD = ../util/libutil.la
++engine_LDADD = ../util/libutil.la
++fbo_firecube_LDADD = ../util/libutil.la
++gloss_LDADD = ../util/libutil.la
++isosurf_LDADD = ../util/libutil.la
++multiarb_LDADD = ../util/libutil.la
++projtex_LDADD = ../util/libutil.la
++textures_LDADD = ../util/libutil.la
++winpos_LDADD = ../util/libutil.la
++endif
++
++if HAVE_GLU
++bin_PROGRAMS += \
++      bounce \
++      clearspd \
++      dissolve \
++      drawpix \
++      fire \
+       gamma \
+       gearbox \
+       gears \
+       geartrain \
+       glinfo \
+-      gloss \
+       gltestperf \
+       ipers \
+-      isosurf \
+       lodbias \
+       morph3d \
+-      multiarb \
+-      paltex \
+       pixeltest \
+-      pointblast \
+-      projtex \
+       ray \
+       readpix \
+       reflect \
+       renormal \
+-      shadowtex \
+       singlebuffer \
+       spectex \
+-      spriteblast \
+-      stex3d \
+       teapot \
+       terrain \
+       tessdemo \
+       texcyl \
+       texenv \
+-      textures \
+       trispd \
+       tunnel2 \
+-      tunnel \
+-      vao_demo \
+-      winpos
+-endif
++      tunnel
+ tunnel_SOURCES = \
+       tunnel.c \
+       tunneldat.h
+-copypix_LDADD = ../util/libutil.la
+-cubemap_LDADD = ../util/libutil.la
+-cuberender_LDADD = ../util/libutil.la
+-drawpix_LDADD = ../util/libutil.la
+ dissolve_LDADD = ../util/libutil.la
+-engine_LDADD = ../util/libutil.la
+-fbo_firecube_LDADD = ../util/libutil.la
++drawpix_LDADD = ../util/libutil.la
+ fire_LDADD = ../util/libutil.la
+-gloss_LDADD = ../util/libutil.la
+ ipers_LDADD = ../util/libutil.la
+-isosurf_LDADD = ../util/libutil.la
+ lodbias_LDADD = ../util/libutil.la
+-multiarb_LDADD = ../util/libutil.la
+-projtex_LDADD = ../util/libutil.la
+ readpix_LDADD = ../util/libutil.la
+ reflect_LDADD = ../util/libutil.la
+ teapot_LDADD = ../util/libutil.la
+ texcyl_LDADD = ../util/libutil.la
+-textures_LDADD = ../util/libutil.la
+ tunnel_LDADD = ../util/libutil.la
+ tunnel2_LDADD = ../util/libutil.la
+-winpos_LDADD = ../util/libutil.la
++endif
++endif
+ EXTRA_DIST = \
+       README
+diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
+index d64a49e..4fe1ca8 100644
+--- a/src/egl/Makefile.am
++++ b/src/egl/Makefile.am
+@@ -24,8 +24,12 @@
+ SUBDIRS = \
+       eglut \
+-      opengl \
+-      openvg \
+       opengles1 \
+       opengles2 \
+       oes_vg
++
++if HAVE_GLU
++SUBDIRS += \
++      opengl \
++      openvg
++endif
+diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
+index fa397c2..21853e8 100644
+--- a/src/egl/opengles1/Makefile.am
++++ b/src/egl/opengles1/Makefile.am
+@@ -36,9 +36,12 @@ AM_LDFLAGS = \
+       $(EGL_LIBS) \
+       -lm
++noinst_PROGRAMS =
++
+ if HAVE_EGL
+ if HAVE_GLESV1
+-noinst_PROGRAMS = \
++if HAVE_X11
++bin_PROGRAMS = \
+       bindtex \
+       clear \
+       drawtex_x11 \
+@@ -52,8 +55,6 @@ noinst_PROGRAMS = \
+       torus_x11 \
+       tri_x11 \
+       two_win
+-endif
+-endif
+ bindtex_LDADD = $(X11_LIBS)
+ es1_info_LDADD = $(X11_LIBS)
+@@ -76,3 +77,6 @@ drawtex_x11_LDADD = ../eglut/libeglut_x11.la
+ gears_x11_LDADD = ../eglut/libeglut_x11.la
+ torus_x11_LDADD = ../eglut/libeglut_x11.la
+ tri_x11_LDADD = ../eglut/libeglut_x11.la
++endif
++endif
++endif
+diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
+index b80ba50..17f8d49 100644
+--- a/src/egl/opengles2/Makefile.am
++++ b/src/egl/opengles2/Makefile.am
+@@ -33,27 +33,28 @@ AM_LDFLAGS = \
+       $(EGL_LIBS) \
+       -lm
++bin_PROGRAMS =
++
+ if HAVE_EGL
+ if HAVE_GLESV2
+-bin_PROGRAMS =
+-if HAVE_X11
+-bin_PROGRAMS += \
+-      es2_info \
+-      es2gears_x11 \
+-      es2tri
+-endif
+ if HAVE_WAYLAND
+ bin_PROGRAMS += es2gears_wayland
+-endif
+-endif
++
++es2gears_wayland_SOURCES = es2gears.c
++es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
+ endif
+-es2_info_LDADD = $(X11_LIBS)
+-es2tri_LDADD = $(X11_LIBS)
++if HAVE_X11
++bin_PROGRAMS += \
++      es2tri \
++      es2_info \
++      es2gears_x11
++es2_info_LDADD = $(X11_LIBS)
+ es2gears_x11_SOURCES = es2gears.c
+-
+ es2gears_x11_LDADD = ../eglut/libeglut_x11.la
++es2tri_LDADD = $(X11_LIBS)
++endif
++endif
++endif
+-es2gears_wayland_SOURCES = es2gears.c
+-es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
+-- 
+2.1.4
+