Commit 41b5dca1 authored by Martin Storsjö's avatar Martin Storsjö Committed by Hugo Beauzée-Luyssen

contribs: glew: Simplify/improve the win32 patch, fix building with lld

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: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent a943285a
......@@ -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 @@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment