From b25e9c675cf560b8b037dc855c6b3b1d09957867 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Wed, 9 Jul 2014 14:23:41 +0200 Subject: [PATCH 3/9] 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 --- configure.ac | 49 ++++++++++++++++++++--------- src/Makefile.am | 14 ++++++--- src/demos/Makefile.am | 73 ++++++++++++++++++++++++------------------- src/egl/Makefile.am | 8 +++-- src/egl/opengles1/Makefile.am | 44 +++++++++++++++----------- src/egl/opengles2/Makefile.am | 33 ++++++++++--------- 6 files changed, 135 insertions(+), 86 deletions(-) diff --git a/configure.ac b/configure.ac index 9445424..bc4c8d1 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], [], + [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..754c47c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,14 +23,18 @@ # Eric Anholt +if HAVE_GLEW +UTIL = util +endif + SUBDIRS = \ - util \ + $(UTIL) \ data \ demos \ egl \ fp \ fpglsl \ glsl \ - gs \ + gs \ objviewer \ osdemos \ perf \ @@ -40,8 +39,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 7a9828d..3455e75 100644 --- a/src/egl/opengles1/Makefile.am +++ b/src/egl/opengles1/Makefile.am @@ -36,28 +36,43 @@ AM_LDFLAGS = \ $(EGL_LIBS) \ -lm +noinst_PROGRAMS = + if HAVE_EGL if HAVE_GLESV1 -noinst_PROGRAMS = \ - bindtex \ - clear \ +noinst_PROGRAMS += \ drawtex_screen \ + gears_screen \ + torus_screen \ + tri_screen + +drawtex_screen_SOURCES = drawtex.c +gears_screen_SOURCES = gears.c +torus_screen_SOURCES = torus.c +tri_screen_SOURCES = tri.c + +drawtex_screen_LDADD = ../eglut/libeglut_screen.la +gears_screen_LDADD = ../eglut/libeglut_screen.la +torus_screen_LDADD = ../eglut/libeglut_screen.la +tri_screen_LDADD = ../eglut/libeglut_screen.la + +if HAVE_X11 +noinst_PROGRAMS += \ + clear + +bin_PROGRAMS = \ + bindtex \ drawtex_x11 \ eglfbdev \ es1_info \ - gears_screen \ gears_x11 \ msaa \ pbuffer\ render_tex \ texture_from_pixmap \ - torus_screen \ torus_x11 \ - tri_screen \ tri_x11 \ two_win -endif -endif bindtex_LDADD = $(X11_LIBS) es1_info_LDADD = $(X11_LIBS) @@ -71,22 +86,15 @@ two_win_LDADD = $(X11_LIBS) clear_LDADD = ../eglut/libeglut_x11.la $(EGL_LIBS) $(X11_LIBS) clear_LDFLAGS = -drawtex_screen_SOURCES = drawtex.c -gears_screen_SOURCES = gears.c -torus_screen_SOURCES = torus.c -tri_screen_SOURCES = tri.c - drawtex_x11_SOURCES = drawtex.c gears_x11_SOURCES = gears.c torus_x11_SOURCES = torus.c tri_x11_SOURCES = tri.c -drawtex_screen_LDADD = ../eglut/libeglut_screen.la -gears_screen_LDADD = ../eglut/libeglut_screen.la -torus_screen_LDADD = ../eglut/libeglut_screen.la -tri_screen_LDADD = ../eglut/libeglut_screen.la - 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 41c1b80..74af460 100644 --- a/src/egl/opengles2/Makefile.am +++ b/src/egl/opengles2/Makefile.am @@ -36,26 +36,29 @@ AM_LDFLAGS = \ if HAVE_EGL if HAVE_GLESV2 bin_PROGRAMS = \ - es2_info \ - es2gears_screen \ - es2gears_x11 \ - es2tri + es2gears_screen + +es2gears_screen_SOURCES = es2gears.c +es2gears_screen_LDADD = ../eglut/libeglut_screen.la + if HAVE_WAYLAND bin_PROGRAMS += es2gears_wayland -endif -endif -endif -es2_info_LDADD = $(X11_LIBS) -es2tri_LDADD = $(X11_LIBS) +es2gears_wayland_SOURCES = es2gears.c +es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la +endif -es2gears_screen_SOURCES = es2gears.c +if HAVE_X11 +bin_PROGRAMS += \ + es2tri \ + es2_info \ + es2gears_x11 +es2_info_LDADD = $(X11_LIBS) es2gears_x11_SOURCES = es2gears.c - -es2gears_screen_LDADD = ../eglut/libeglut_screen.la - 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.0.0