1 From b25e9c675cf560b8b037dc855c6b3b1d09957867 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 3/9] configure: Allow to disable demos which require GLEW or
7 * in some systems without X11 support we don't have GLEW, but
8 mesa-demos are still useful
10 Upstream-Status: Pending
12 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14 configure.ac | 49 ++++++++++++++++++++---------
15 src/Makefile.am | 14 ++++++---
16 src/demos/Makefile.am | 73 ++++++++++++++++++++++++-------------------
17 src/egl/Makefile.am | 8 +++--
18 src/egl/opengles1/Makefile.am | 44 +++++++++++++++-----------
19 src/egl/opengles2/Makefile.am | 33 ++++++++++---------
20 6 files changed, 135 insertions(+), 86 deletions(-)
22 diff --git a/configure.ac b/configure.ac
23 index 9445424..bc4c8d1 100644
26 @@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
27 [AC_DEFINE(HAVE_FREEGLUT)],
31 -PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
32 -DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
33 -DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
34 +AC_ARG_ENABLE([glew],
35 + [AS_HELP_STRING([--enable-glew],
36 + [build demos which require glew @<:@default=yes@:>@])],
37 + [enable_glew="$enableval"],
41 +if test "x$enable_glew" = xyes; then
43 + PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no])
44 + DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
45 + DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
48 # LIBS was set by AC_CHECK_LIB above
51 -PKG_CHECK_MODULES(GLU, [glu], [],
52 - [AC_CHECK_HEADER([GL/glu.h],
54 - AC_MSG_ERROR([GLU not found]))
58 - AC_MSG_ERROR([GLU required])) ])
60 + [AS_HELP_STRING([--enable-glu],
61 + [build demos which require glu @<:@default=yes@:>@])],
62 + [enable_glu="$enableval"],
66 -DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
67 -DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
68 +if test "x$enable_glu" = xyes; then
69 + PKG_CHECK_MODULES(GLU, [glu], [glu_enabled=yes],
70 + [AC_CHECK_HEADER([GL/glu.h],
72 + AC_MSG_ERROR([GLU not found]))
77 + AC_MSG_ERROR([GLU required])) ])
79 + DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
80 + DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
84 [AS_HELP_STRING([--enable-egl],
85 @@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS])
86 AC_SUBST([WAYLAND_LIBS])
89 +AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
90 +AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
91 AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
92 AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
93 AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
94 diff --git a/src/Makefile.am b/src/Makefile.am
95 index 1647d64..754c47c 100644
99 # Eric Anholt <eric@anholt.net>
119 @@ -40,8 +39,12 @@ SUBDIRS = \
135 diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
136 index 41603fa..ab1e3ab 100644
137 --- a/src/demos/Makefile.am
138 +++ b/src/demos/Makefile.am
139 @@ -30,91 +30,100 @@ AM_LDFLAGS = \
181 +copypix_LDADD = ../util/libutil.la
182 +cubemap_LDADD = ../util/libutil.la
183 +cuberender_LDADD = ../util/libutil.la
184 +engine_LDADD = ../util/libutil.la
185 +fbo_firecube_LDADD = ../util/libutil.la
186 +gloss_LDADD = ../util/libutil.la
187 +isosurf_LDADD = ../util/libutil.la
188 +multiarb_LDADD = ../util/libutil.la
189 +projtex_LDADD = ../util/libutil.la
190 +textures_LDADD = ../util/libutil.la
191 +winpos_LDADD = ../util/libutil.la
244 -copypix_LDADD = ../util/libutil.la
245 -cubemap_LDADD = ../util/libutil.la
246 -cuberender_LDADD = ../util/libutil.la
247 -drawpix_LDADD = ../util/libutil.la
248 dissolve_LDADD = ../util/libutil.la
249 -engine_LDADD = ../util/libutil.la
250 -fbo_firecube_LDADD = ../util/libutil.la
251 +drawpix_LDADD = ../util/libutil.la
252 fire_LDADD = ../util/libutil.la
253 -gloss_LDADD = ../util/libutil.la
254 ipers_LDADD = ../util/libutil.la
255 -isosurf_LDADD = ../util/libutil.la
256 lodbias_LDADD = ../util/libutil.la
257 -multiarb_LDADD = ../util/libutil.la
258 -projtex_LDADD = ../util/libutil.la
259 readpix_LDADD = ../util/libutil.la
260 reflect_LDADD = ../util/libutil.la
261 teapot_LDADD = ../util/libutil.la
262 texcyl_LDADD = ../util/libutil.la
263 -textures_LDADD = ../util/libutil.la
264 tunnel_LDADD = ../util/libutil.la
265 tunnel2_LDADD = ../util/libutil.la
266 -winpos_LDADD = ../util/libutil.la
272 diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
273 index d64a49e..4fe1ca8 100644
274 --- a/src/egl/Makefile.am
275 +++ b/src/egl/Makefile.am
291 diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
292 index 7a9828d..3455e75 100644
293 --- a/src/egl/opengles1/Makefile.am
294 +++ b/src/egl/opengles1/Makefile.am
295 @@ -36,28 +36,43 @@ AM_LDFLAGS = \
306 +noinst_PROGRAMS += \
312 +drawtex_screen_SOURCES = drawtex.c
313 +gears_screen_SOURCES = gears.c
314 +torus_screen_SOURCES = torus.c
315 +tri_screen_SOURCES = tri.c
317 +drawtex_screen_LDADD = ../eglut/libeglut_screen.la
318 +gears_screen_LDADD = ../eglut/libeglut_screen.la
319 +torus_screen_LDADD = ../eglut/libeglut_screen.la
320 +tri_screen_LDADD = ../eglut/libeglut_screen.la
323 +noinst_PROGRAMS += \
336 texture_from_pixmap \
345 bindtex_LDADD = $(X11_LIBS)
346 es1_info_LDADD = $(X11_LIBS)
347 @@ -71,22 +86,15 @@ two_win_LDADD = $(X11_LIBS)
348 clear_LDADD = ../eglut/libeglut_x11.la $(EGL_LIBS) $(X11_LIBS)
351 -drawtex_screen_SOURCES = drawtex.c
352 -gears_screen_SOURCES = gears.c
353 -torus_screen_SOURCES = torus.c
354 -tri_screen_SOURCES = tri.c
356 drawtex_x11_SOURCES = drawtex.c
357 gears_x11_SOURCES = gears.c
358 torus_x11_SOURCES = torus.c
359 tri_x11_SOURCES = tri.c
361 -drawtex_screen_LDADD = ../eglut/libeglut_screen.la
362 -gears_screen_LDADD = ../eglut/libeglut_screen.la
363 -torus_screen_LDADD = ../eglut/libeglut_screen.la
364 -tri_screen_LDADD = ../eglut/libeglut_screen.la
366 drawtex_x11_LDADD = ../eglut/libeglut_x11.la
367 gears_x11_LDADD = ../eglut/libeglut_x11.la
368 torus_x11_LDADD = ../eglut/libeglut_x11.la
369 tri_x11_LDADD = ../eglut/libeglut_x11.la
373 diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
374 index 41c1b80..74af460 100644
375 --- a/src/egl/opengles2/Makefile.am
376 +++ b/src/egl/opengles2/Makefile.am
377 @@ -36,26 +36,29 @@ AM_LDFLAGS = \
387 +es2gears_screen_SOURCES = es2gears.c
388 +es2gears_screen_LDADD = ../eglut/libeglut_screen.la
391 bin_PROGRAMS += es2gears_wayland
396 -es2_info_LDADD = $(X11_LIBS)
397 -es2tri_LDADD = $(X11_LIBS)
398 +es2gears_wayland_SOURCES = es2gears.c
399 +es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
402 -es2gears_screen_SOURCES = es2gears.c
409 +es2_info_LDADD = $(X11_LIBS)
410 es2gears_x11_SOURCES = es2gears.c
412 -es2gears_screen_LDADD = ../eglut/libeglut_screen.la
414 es2gears_x11_LDADD = ../eglut/libeglut_x11.la
415 +es2tri_LDADD = $(X11_LIBS)
420 -es2gears_wayland_SOURCES = es2gears.c
421 -es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la