autotools: use correct gl.pc LIBS when using glvnd
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 23 Feb 2018 19:32:08 +0000 (19:32 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 8 Aug 2018 12:37:09 +0000 (13:37 +0100)
This is more of a hack, since glvnd itself should be providing the file.
Until that happens, ensure the libs is correctly set to -lGL

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
configure.ac
src/mesa/gl.pc.in

index e2c48a455c26cf153fe1a20c73d22a990f22cdde..c2155a541b09385b01b1af8cb349fef34cf4bc7d 100644 (file)
@@ -1534,6 +1534,15 @@ fi
 AC_SUBST([GL_LIB])
 AC_SUBST([OSMESA_LIB])
 
+dnl HACK when building glx + glvnd we ship gl.pc, despite that glvnd should do it
+dnl Thus we need to use GL as a DSO name.
+if test "x$enable_libglvnd" = xyes -a "x$enable_glx" != xno; then
+  GL_PKGCONF_LIB="GL"
+else
+  GL_PKGCONF_LIB="$GL_LIB"
+fi
+AC_SUBST([GL_PKGCONF_LIB])
+
 # Check for libdrm
 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
                   [have_libdrm=yes], [have_libdrm=no])
index 181724b97bf10e61c139d5ee3f1efb5ad37f02be..680f7427768c7115a0215a91c96ab32bda30c67f 100644 (file)
@@ -7,7 +7,7 @@ Name: gl
 Description: Mesa OpenGL library
 Requires.private: @GL_PC_REQ_PRIV@
 Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -l@GL_LIB@
+Libs: -L${libdir} -l@GL_PKGCONF_LIB@
 Libs.private: @GL_PC_LIB_PRIV@
 Cflags: -I${includedir} @GL_PC_CFLAGS@
 glx_tls: @GLX_TLS@