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 Upstream-Status: Pending
11 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14 Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
16 configure.ac | 49 ++++++++++++++++++++---------
17 src/Makefile.am | 18 ++++++++---
18 src/demos/Makefile.am | 73 ++++++++++++++++++++++++-------------------
19 src/egl/Makefile.am | 8 +++--
20 src/egl/opengles1/Makefile.am | 10 ++++--
21 src/egl/opengles2/Makefile.am | 29 ++++++++---------
22 6 files changed, 117 insertions(+), 70 deletions(-)
24 diff --git a/configure.ac b/configure.ac
25 index 0525b09..28834cd 100644
28 @@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
29 [AC_DEFINE(HAVE_FREEGLUT)],
33 -PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
34 -DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
35 -DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
36 +AC_ARG_ENABLE([glew],
37 + [AS_HELP_STRING([--enable-glew],
38 + [build demos which require glew @<:@default=yes@:>@])],
39 + [enable_glew="$enableval"],
43 +if test "x$enable_glew" = xyes; then
45 + PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no])
46 + DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
47 + DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
50 # LIBS was set by AC_CHECK_LIB above
53 -PKG_CHECK_MODULES(GLU, [glu], [],
54 - [AC_CHECK_HEADER([GL/glu.h],
56 - AC_MSG_ERROR([GLU not found]))
60 - AC_MSG_ERROR([GLU required])) ])
62 + [AS_HELP_STRING([--enable-glu],
63 + [build demos which require glu @<:@default=yes@:>@])],
64 + [enable_glu="$enableval"],
68 -DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
69 -DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
70 +if test "x$enable_glu" = xyes; then
71 + PKG_CHECK_MODULES(GLU, [glu], [glu_enabled=yes],
72 + [AC_CHECK_HEADER([GL/glu.h],
74 + AC_MSG_ERROR([GLU not found]))
79 + AC_MSG_ERROR([GLU required])) ])
81 + DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
82 + DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
86 [AS_HELP_STRING([--enable-egl],
87 @@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS])
88 AC_SUBST([WAYLAND_LIBS])
91 +AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
92 +AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
93 AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
94 AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
95 AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
96 diff --git a/src/Makefile.am b/src/Makefile.am
97 index 1647d64..8b89dee 100644
102 # Eric Anholt <eric@anholt.net>
122 @@ -40,8 +44,12 @@ SUBDIRS = \
138 diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
139 index 41603fa..ab1e3ab 100644
140 --- a/src/demos/Makefile.am
141 +++ b/src/demos/Makefile.am
142 @@ -30,91 +30,100 @@ AM_LDFLAGS = \
184 +copypix_LDADD = ../util/libutil.la
185 +cubemap_LDADD = ../util/libutil.la
186 +cuberender_LDADD = ../util/libutil.la
187 +engine_LDADD = ../util/libutil.la
188 +fbo_firecube_LDADD = ../util/libutil.la
189 +gloss_LDADD = ../util/libutil.la
190 +isosurf_LDADD = ../util/libutil.la
191 +multiarb_LDADD = ../util/libutil.la
192 +projtex_LDADD = ../util/libutil.la
193 +textures_LDADD = ../util/libutil.la
194 +winpos_LDADD = ../util/libutil.la
247 -copypix_LDADD = ../util/libutil.la
248 -cubemap_LDADD = ../util/libutil.la
249 -cuberender_LDADD = ../util/libutil.la
250 -drawpix_LDADD = ../util/libutil.la
251 dissolve_LDADD = ../util/libutil.la
252 -engine_LDADD = ../util/libutil.la
253 -fbo_firecube_LDADD = ../util/libutil.la
254 +drawpix_LDADD = ../util/libutil.la
255 fire_LDADD = ../util/libutil.la
256 -gloss_LDADD = ../util/libutil.la
257 ipers_LDADD = ../util/libutil.la
258 -isosurf_LDADD = ../util/libutil.la
259 lodbias_LDADD = ../util/libutil.la
260 -multiarb_LDADD = ../util/libutil.la
261 -projtex_LDADD = ../util/libutil.la
262 readpix_LDADD = ../util/libutil.la
263 reflect_LDADD = ../util/libutil.la
264 teapot_LDADD = ../util/libutil.la
265 texcyl_LDADD = ../util/libutil.la
266 -textures_LDADD = ../util/libutil.la
267 tunnel_LDADD = ../util/libutil.la
268 tunnel2_LDADD = ../util/libutil.la
269 -winpos_LDADD = ../util/libutil.la
275 diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
276 index d64a49e..4fe1ca8 100644
277 --- a/src/egl/Makefile.am
278 +++ b/src/egl/Makefile.am
294 diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
295 index fa397c2..21853e8 100644
296 --- a/src/egl/opengles1/Makefile.am
297 +++ b/src/egl/opengles1/Makefile.am
298 @@ -36,9 +36,12 @@ AM_LDFLAGS = \
312 @@ -52,8 +55,6 @@ noinst_PROGRAMS = \
319 bindtex_LDADD = $(X11_LIBS)
320 es1_info_LDADD = $(X11_LIBS)
321 @@ -76,3 +77,6 @@ drawtex_x11_LDADD = ../eglut/libeglut_x11.la
322 gears_x11_LDADD = ../eglut/libeglut_x11.la
323 torus_x11_LDADD = ../eglut/libeglut_x11.la
324 tri_x11_LDADD = ../eglut/libeglut_x11.la
328 diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
329 index b80ba50..17f8d49 100644
330 --- a/src/egl/opengles2/Makefile.am
331 +++ b/src/egl/opengles2/Makefile.am
332 @@ -33,27 +33,28 @@ AM_LDFLAGS = \
348 bin_PROGRAMS += es2gears_wayland
352 +es2gears_wayland_SOURCES = es2gears.c
353 +es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
356 -es2_info_LDADD = $(X11_LIBS)
357 -es2tri_LDADD = $(X11_LIBS)
364 +es2_info_LDADD = $(X11_LIBS)
365 es2gears_x11_SOURCES = es2gears.c
367 es2gears_x11_LDADD = ../eglut/libeglut_x11.la
368 +es2tri_LDADD = $(X11_LIBS)
373 -es2gears_wayland_SOURCES = es2gears.c
374 -es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la