[vlc-devel] [3.0 PATCH v2 15/20] contribs: glew: Simplify/improve the win32 patch, fix building with lld
Steve Lhomme
robux4 at ycbcr.xyz
Thu Apr 2 13:38:13 CEST 2020
From: Martin Storsjö <martin at martin.st>
The previous version of win32.patch left things in a bit more broken state
than necessary.
The previous version of the patch removed LD=gcc and removed a number of
flags, making the build trying to build a DLL (but without the option
-shared), actually producing an EXE. (The linked DLLs are later
actually removed by the contribs build system.) Instead of removing LD=gcc,
change it into LD=$(CC) which is more what glew originally intended, and
keep the flags for linking shared libraries (but remove the -soname option
which isn't supported by neither GNU ld nor lld).
This fixes building in setups where $(LD) points to lld.
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
(cherry picked from commit 41b5dca1f870aa1fbc32703daf875c35aa979fd9)
---
contrib/src/glew/win32.patch | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/contrib/src/glew/win32.patch b/contrib/src/glew/win32.patch
index 4205695b791..49dded7bd89 100644
--- a/contrib/src/glew/win32.patch
+++ b/contrib/src/glew/win32.patch
@@ -73,29 +73,30 @@
diff -ruN glew/config/Makefile.mingw glew.new/config/Makefile.mingw
--- glew/config/Makefile.mingw 2011-08-25 16:17:55.000000000 +0200
-+++ glew.new/config/Makefile.mingw 2012-02-25 16:42:36.603751173 +0100
-@@ -1,8 +1,6 @@
++++ glew.new/config/Makefile.mingw 2017-12-21 21:13:03.115385406 +0000
+@@ -1,8 +1,7 @@
NAME = glew32
-CC = gcc
# use gcc for linking, with ld it does not work
-LD = gcc
-CFLAGS.SO = -DGLEW_BUILD
++LD = $(CC)
+CFLAGS.SO = -DGLEW_BUILD -DSTATIC
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
LDFLAGS.EXTRA = -L/mingw/lib
WARN = -Wall -W
-@@ -12,9 +10,9 @@
+@@ -12,9 +11,9 @@
LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib
LIB.SHARED = $(NAME).dll
LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO)
-LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
-+#LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
++LDFLAGS.SO = -shared -Wl,--out-implib,lib/$(LIB.DEVLNK)
LIB.SONAME.MX = lib$(NAME)mx.dll
LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib
LIB.SHARED.MX = $(NAME)mx.dll
LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO)
-LDFLAGS.SO.MX = -shared -Wl,-soname,$(LIB.SONAME.MX) -Wl,--out-implib,lib/$(LIB.DEVLNK.MX)
-+#LDFLAGS.SO.MX = -shared -Wl,-soname,$(LIB.SONAME.MX) -Wl,--out-implib,lib/$(LIB.DEVLNK.MX)
++LDFLAGS.SO.MX = -shared -Wl,--out-implib,lib/$(LIB.DEVLNK.MX)
--- glew/include/GL/glew.h 2011-08-25 16:17:55.000000000 +0200
+++ glew.new/include/GL/glew.h 2012-02-25 16:39:44.970410007 +0100
@@ -151,7 +151,7 @@
--
2.17.1
More information about the vlc-devel
mailing list