aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
blob: f6b59a11fe2d8491b83db6d5dab3d9be6bc1a6df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
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