0010-opengl-missing-library-check.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 4ab41404cb85684125d73977cadebf83bbc246f5 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
  3. Date: Sat, 22 Jan 2022 11:34:38 +0200
  4. Subject: [PATCH] opengl: missing library check
  5. Traditionally the presence of the header file was not considered
  6. sufficient, though this was somewhat forgotten with the prevalence of
  7. pkg-config.
  8. However most libraries have portable headers, while the shared library
  9. is platform-dependent. It is common for the header to be present while
  10. the library is absent with "multilib" installations (i.e. Linux
  11. installation with multiple architectures).
  12. Downloaded from upstream commit:
  13. https://code.videolan.org/videolan/vlc/-/commit/4ab41404cb85684125d73977cadebf83bbc246f5
  14. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  15. ---
  16. configure.ac | 9 ++++++---
  17. 1 file changed, 6 insertions(+), 3 deletions(-)
  18. diff --git a/configure.ac b/configure.ac
  19. index 2f50808d597..0d57fadbf8b 100644
  20. --- a/configure.ac
  21. +++ b/configure.ac
  22. @@ -3169,7 +3169,6 @@ have_gl="no"
  23. PKG_CHECK_MODULES([GL], [gl], [
  24. have_gl="yes"
  25. ], [
  26. - AC_MSG_CHECKING([for OpenGL])
  27. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  28. #ifdef _WIN32
  29. # include <GL/glew.h>
  30. @@ -3179,13 +3178,17 @@ PKG_CHECK_MODULES([GL], [gl], [
  31. [int t0 = GL_TEXTURE0;]])
  32. ], [
  33. GL_CFLAGS=""
  34. - have_gl="yes"
  35. AS_IF([test "${SYS}" != "mingw32"], [
  36. - GL_LIBS="-lGL"
  37. + AC_CHECK_LIB([GL], [glTexture2D], [
  38. + have_gl="yes"
  39. + GL_LIBS="-lGL"
  40. + ])
  41. ], [
  42. + have_gl="yes"
  43. GL_LIBS="-lopengl32"
  44. ])
  45. ])
  46. + AC_MSG_CHECKING([for OpenGL])
  47. AC_MSG_RESULT([${have_gl}])
  48. ])
  49. AM_CONDITIONAL([HAVE_GL], [test "${have_gl}" = "yes"])
  50. --
  51. GitLab