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], [],
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>
114 @@ -40,8 +39,13 @@ SUBDIRS = \
131 diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
132 index 41603fa..ab1e3ab 100644
133 --- a/src/demos/Makefile.am
134 +++ b/src/demos/Makefile.am
135 @@ -30,91 +30,100 @@ AM_LDFLAGS = \
177 +copypix_LDADD = ../util/libutil.la
178 +cubemap_LDADD = ../util/libutil.la
179 +cuberender_LDADD = ../util/libutil.la
180 +engine_LDADD = ../util/libutil.la
181 +fbo_firecube_LDADD = ../util/libutil.la
182 +gloss_LDADD = ../util/libutil.la
183 +isosurf_LDADD = ../util/libutil.la
184 +multiarb_LDADD = ../util/libutil.la
185 +projtex_LDADD = ../util/libutil.la
186 +textures_LDADD = ../util/libutil.la
187 +winpos_LDADD = ../util/libutil.la
240 -copypix_LDADD = ../util/libutil.la
241 -cubemap_LDADD = ../util/libutil.la
242 -cuberender_LDADD = ../util/libutil.la
243 -drawpix_LDADD = ../util/libutil.la
244 dissolve_LDADD = ../util/libutil.la
245 -engine_LDADD = ../util/libutil.la
246 -fbo_firecube_LDADD = ../util/libutil.la
247 +drawpix_LDADD = ../util/libutil.la
248 fire_LDADD = ../util/libutil.la
249 -gloss_LDADD = ../util/libutil.la
250 ipers_LDADD = ../util/libutil.la
251 -isosurf_LDADD = ../util/libutil.la
252 lodbias_LDADD = ../util/libutil.la
253 -multiarb_LDADD = ../util/libutil.la
254 -projtex_LDADD = ../util/libutil.la
255 readpix_LDADD = ../util/libutil.la
256 reflect_LDADD = ../util/libutil.la
257 teapot_LDADD = ../util/libutil.la
258 texcyl_LDADD = ../util/libutil.la
259 -textures_LDADD = ../util/libutil.la
260 tunnel_LDADD = ../util/libutil.la
261 tunnel2_LDADD = ../util/libutil.la
262 -winpos_LDADD = ../util/libutil.la
268 diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
269 index d64a49e..4fe1ca8 100644
270 --- a/src/egl/Makefile.am
271 +++ b/src/egl/Makefile.am
287 diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
288 index 7a9828d..3455e75 100644
289 --- a/src/egl/opengles1/Makefile.am
290 +++ b/src/egl/opengles1/Makefile.am
291 @@ -36,28 +36,43 @@ AM_LDFLAGS = \
302 +noinst_PROGRAMS += \
308 +drawtex_screen_SOURCES = drawtex.c
309 +gears_screen_SOURCES = gears.c
310 +torus_screen_SOURCES = torus.c
311 +tri_screen_SOURCES = tri.c
313 +drawtex_screen_LDADD = ../eglut/libeglut_screen.la
314 +gears_screen_LDADD = ../eglut/libeglut_screen.la
315 +torus_screen_LDADD = ../eglut/libeglut_screen.la
316 +tri_screen_LDADD = ../eglut/libeglut_screen.la
319 +noinst_PROGRAMS += \
332 texture_from_pixmap \
341 bindtex_LDADD = $(X11_LIBS)
342 es1_info_LDADD = $(X11_LIBS)
343 @@ -71,22 +86,15 @@ two_win_LDADD = $(X11_LIBS)
344 clear_LDADD = ../eglut/libeglut_x11.la $(EGL_LIBS) $(X11_LIBS)
347 -drawtex_screen_SOURCES = drawtex.c
348 -gears_screen_SOURCES = gears.c
349 -torus_screen_SOURCES = torus.c
350 -tri_screen_SOURCES = tri.c
352 drawtex_x11_SOURCES = drawtex.c
353 gears_x11_SOURCES = gears.c
354 torus_x11_SOURCES = torus.c
355 tri_x11_SOURCES = tri.c
357 -drawtex_screen_LDADD = ../eglut/libeglut_screen.la
358 -gears_screen_LDADD = ../eglut/libeglut_screen.la
359 -torus_screen_LDADD = ../eglut/libeglut_screen.la
360 -tri_screen_LDADD = ../eglut/libeglut_screen.la
362 drawtex_x11_LDADD = ../eglut/libeglut_x11.la
363 gears_x11_LDADD = ../eglut/libeglut_x11.la
364 torus_x11_LDADD = ../eglut/libeglut_x11.la
365 tri_x11_LDADD = ../eglut/libeglut_x11.la
369 diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
370 index 41c1b80..74af460 100644
371 --- a/src/egl/opengles2/Makefile.am
372 +++ b/src/egl/opengles2/Makefile.am
373 @@ -36,26 +36,29 @@ AM_LDFLAGS = \
383 +es2gears_screen_SOURCES = es2gears.c
384 +es2gears_screen_LDADD = ../eglut/libeglut_screen.la
387 bin_PROGRAMS += es2gears_wayland
392 -es2_info_LDADD = $(X11_LIBS)
393 -es2tri_LDADD = $(X11_LIBS)
394 +es2gears_wayland_SOURCES = es2gears.c
395 +es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
398 -es2gears_screen_SOURCES = es2gears.c
405 +es2_info_LDADD = $(X11_LIBS)
406 es2gears_x11_SOURCES = es2gears.c
408 -es2gears_screen_LDADD = ../eglut/libeglut_screen.la
410 es2gears_x11_LDADD = ../eglut/libeglut_x11.la
411 +es2tri_LDADD = $(X11_LIBS)
416 -es2gears_wayland_SOURCES = es2gears.c
417 -es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la