0001-demos-makes-opengl-an-optional-component.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. From bb0ffae7164d296d32da24fa5499534de259169a Mon Sep 17 00:00:00 2001
  2. From: Spenser Gilliland <spenser@gillilanding.com>
  3. Date: Sat, 24 Feb 2018 11:36:17 +0100
  4. Subject: [PATCH] demos: makes opengl an optional component
  5. Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
  6. [Romain: convert to git patch, rebase on 8.4.0]
  7. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  8. ---
  9. configure.ac | 12 +++++++++++-
  10. src/egl/opengl/Makefile.am | 2 ++
  11. src/util/Makefile.am | 2 ++
  12. 3 files changed, 15 insertions(+), 1 deletion(-)
  13. diff --git a/configure.ac b/configure.ac
  14. index 0b5e9a76..24298c44 100644
  15. --- a/configure.ac
  16. +++ b/configure.ac
  17. @@ -51,6 +51,14 @@ m4_ifndef([PKG_PROG_PKG_CONFIG],
  18. ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
  19. PKG_PROG_PKG_CONFIG()
  20. +AC_ARG_ENABLE([gl],
  21. + [AS_HELP_STRING([--enable-gl],
  22. + [enable GL library @<:@default=no@:>@])],
  23. + [gl_enabled="$enableval"],
  24. + [gl_enabled=auto])
  25. +
  26. +if test "x$gl_enabled" != "xno"; then
  27. +
  28. dnl Get the pkg-config definitions for libGL. We include a fallback
  29. dnl path for GL implementation that don't provide a .pc file
  30. PKG_CHECK_MODULES(GL, [gl], [], [
  31. @@ -112,6 +120,8 @@ PKG_CHECK_MODULES(GLU, [glu], [],
  32. DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
  33. DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
  34. +fi
  35. +
  36. AC_ARG_ENABLE([egl],
  37. [AS_HELP_STRING([--enable-egl],
  38. [enable EGL library @<:@default=auto@:>@])],
  39. @@ -302,7 +312,7 @@ AC_SUBST([MESA_GLAPI])
  40. AC_SUBST([WAYLAND_CFLAGS])
  41. AC_SUBST([WAYLAND_LIBS])
  42. -
  43. +AM_CONDITIONAL(HAVE_GL, test "x$gl_enabled" = "xyes")
  44. AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
  45. AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
  46. AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
  47. diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
  48. index 6d184ff6..219ab850 100644
  49. --- a/src/egl/opengl/Makefile.am
  50. +++ b/src/egl/opengl/Makefile.am
  51. @@ -56,6 +56,7 @@ endif
  52. endif
  53. if HAVE_EGL
  54. +if HAVE_GL
  55. bin_PROGRAMS = \
  56. eglinfo
  57. noinst_PROGRAMS = \
  58. @@ -64,6 +65,7 @@ noinst_PROGRAMS = \
  59. $(EGL_X11_DEMOS) \
  60. $(EGL_WL_DEMOS)
  61. endif
  62. +endif
  63. egltri_x11_SOURCES = egltri.c
  64. eglgears_x11_SOURCES = eglgears.c
  65. diff --git a/src/util/Makefile.am b/src/util/Makefile.am
  66. index 759a293a..012b9c75 100644
  67. --- a/src/util/Makefile.am
  68. +++ b/src/util/Makefile.am
  69. @@ -27,7 +27,9 @@ AM_CFLAGS = \
  70. AM_LDFLAGS = \
  71. $(DEMO_LIBS)
  72. +if HAVE_GL
  73. noinst_LTLIBRARIES = libutil.la
  74. +endif
  75. if HAVE_GLUT
  76. AM_CFLAGS += \
  77. --
  78. 2.14.3