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