1 From 779438770bedf3d53e6ad8f7cd6889b7f50daf3b Mon Sep 17 00:00:00 2001
2 From: Martin Jansa <Martin.Jansa@gmail.com>
3 Date: Wed, 9 Jul 2014 14:23:41 +0200
4 Subject: [PATCH] configure: Allow to disable demos which require GLEW or GLU
6 * in some systems without X11 support we don't have GLEW, but
7 mesa-demos are still useful
9 This isn't currently appropriate for upstream submission as glew has
10 been replaced with glad there; glu situation would need to be re-assesed
11 when upstream makes a new release, requested here:
12 https://gitlab.freedesktop.org/mesa/demos/-/issues/22
14 Upstream-Status: Inappropriate [see above]
16 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
19 Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
21 configure.ac | 49 ++++++++++++++++++++---------
22 src/Makefile.am | 18 ++++++++---
23 src/demos/Makefile.am | 73 ++++++++++++++++++++++++-------------------
24 src/egl/Makefile.am | 8 +++--
25 src/egl/opengles1/Makefile.am | 10 ++++--
26 src/egl/opengles2/Makefile.am | 29 ++++++++---------
27 6 files changed, 117 insertions(+), 70 deletions(-)
29 diff --git a/configure.ac b/configure.ac
30 index 0525b09..28834cd 100644
33 @@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
34 [AC_DEFINE(HAVE_FREEGLUT)],
38 -PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
39 -DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
40 -DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
41 +AC_ARG_ENABLE([glew],
42 + [AS_HELP_STRING([--enable-glew],
43 + [build demos which require glew @<:@default=yes@:>@])],
44 + [enable_glew="$enableval"],
48 +if test "x$enable_glew" = xyes; then
50 + PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no])
51 + DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
52 + DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
55 # LIBS was set by AC_CHECK_LIB above
58 -PKG_CHECK_MODULES(GLU, [glu], [],
59 - [AC_CHECK_HEADER([GL/glu.h],
61 - AC_MSG_ERROR([GLU not found]))
65 - AC_MSG_ERROR([GLU required])) ])
67 + [AS_HELP_STRING([--enable-glu],
68 + [build demos which require glu @<:@default=yes@:>@])],
69 + [enable_glu="$enableval"],
73 -DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
74 -DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
75 +if test "x$enable_glu" = xyes; then
76 + PKG_CHECK_MODULES(GLU, [glu], [glu_enabled=yes],
77 + [AC_CHECK_HEADER([GL/glu.h],
79 + AC_MSG_ERROR([GLU not found]))
84 + AC_MSG_ERROR([GLU required])) ])
86 + DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
87 + DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
91 [AS_HELP_STRING([--enable-egl],
92 @@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS])
93 AC_SUBST([WAYLAND_LIBS])
96 +AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
97 +AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
98 AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
99 AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
100 AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
101 diff --git a/src/Makefile.am b/src/Makefile.am
102 index 1647d64..8b89dee 100644
103 --- a/src/Makefile.am
104 +++ b/src/Makefile.am
107 # Eric Anholt <eric@anholt.net>
127 @@ -40,8 +44,12 @@ SUBDIRS = \
143 diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
144 index 41603fa..ab1e3ab 100644
145 --- a/src/demos/Makefile.am
146 +++ b/src/demos/Makefile.am
147 @@ -30,91 +30,100 @@ AM_LDFLAGS = \
189 +copypix_LDADD = ../util/libutil.la
190 +cubemap_LDADD = ../util/libutil.la
191 +cuberender_LDADD = ../util/libutil.la
192 +engine_LDADD = ../util/libutil.la
193 +fbo_firecube_LDADD = ../util/libutil.la
194 +gloss_LDADD = ../util/libutil.la
195 +isosurf_LDADD = ../util/libutil.la
196 +multiarb_LDADD = ../util/libutil.la
197 +projtex_LDADD = ../util/libutil.la
198 +textures_LDADD = ../util/libutil.la
199 +winpos_LDADD = ../util/libutil.la
252 -copypix_LDADD = ../util/libutil.la
253 -cubemap_LDADD = ../util/libutil.la
254 -cuberender_LDADD = ../util/libutil.la
255 -drawpix_LDADD = ../util/libutil.la
256 dissolve_LDADD = ../util/libutil.la
257 -engine_LDADD = ../util/libutil.la
258 -fbo_firecube_LDADD = ../util/libutil.la
259 +drawpix_LDADD = ../util/libutil.la
260 fire_LDADD = ../util/libutil.la
261 -gloss_LDADD = ../util/libutil.la
262 ipers_LDADD = ../util/libutil.la
263 -isosurf_LDADD = ../util/libutil.la
264 lodbias_LDADD = ../util/libutil.la
265 -multiarb_LDADD = ../util/libutil.la
266 -projtex_LDADD = ../util/libutil.la
267 readpix_LDADD = ../util/libutil.la
268 reflect_LDADD = ../util/libutil.la
269 teapot_LDADD = ../util/libutil.la
270 texcyl_LDADD = ../util/libutil.la
271 -textures_LDADD = ../util/libutil.la
272 tunnel_LDADD = ../util/libutil.la
273 tunnel2_LDADD = ../util/libutil.la
274 -winpos_LDADD = ../util/libutil.la
280 diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
281 index d64a49e..4fe1ca8 100644
282 --- a/src/egl/Makefile.am
283 +++ b/src/egl/Makefile.am
299 diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
300 index fa397c2..21853e8 100644
301 --- a/src/egl/opengles1/Makefile.am
302 +++ b/src/egl/opengles1/Makefile.am
303 @@ -36,9 +36,12 @@ AM_LDFLAGS = \
317 @@ -52,8 +55,6 @@ noinst_PROGRAMS = \
324 bindtex_LDADD = $(X11_LIBS)
325 es1_info_LDADD = $(X11_LIBS)
326 @@ -76,3 +77,6 @@ drawtex_x11_LDADD = ../eglut/libeglut_x11.la
327 gears_x11_LDADD = ../eglut/libeglut_x11.la
328 torus_x11_LDADD = ../eglut/libeglut_x11.la
329 tri_x11_LDADD = ../eglut/libeglut_x11.la
333 diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
334 index b80ba50..17f8d49 100644
335 --- a/src/egl/opengles2/Makefile.am
336 +++ b/src/egl/opengles2/Makefile.am
337 @@ -33,27 +33,28 @@ AM_LDFLAGS = \
353 bin_PROGRAMS += es2gears_wayland
357 +es2gears_wayland_SOURCES = es2gears.c
358 +es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
361 -es2_info_LDADD = $(X11_LIBS)
362 -es2tri_LDADD = $(X11_LIBS)
369 +es2_info_LDADD = $(X11_LIBS)
370 es2gears_x11_SOURCES = es2gears.c
372 es2gears_x11_LDADD = ../eglut/libeglut_x11.la
373 +es2tri_LDADD = $(X11_LIBS)
378 -es2gears_wayland_SOURCES = es2gears.c
379 -es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la