termux-packages/x11-packages/glew/Makefile.patch

90 lines
2.5 KiB
Diff
Raw Normal View History

2021-10-26 00:08:46 +02:00
diff -uNr glew-2.2.0/config/Makefile.linux glew-2.2.0.mod/config/Makefile.linux
--- glew-2.2.0/config/Makefile.linux 2020-03-15 13:53:59.000000000 +0200
+++ glew-2.2.0.mod/config/Makefile.linux 2021-11-04 18:03:36.790712457 +0200
2021-10-26 00:08:46 +02:00
@@ -1,32 +1,17 @@
NAME = $(GLEW_NAME)
-CC = cc
-LD = cc
-M_ARCH ?= $(shell uname -m)
-ARCH64 = false
-ifeq (x86_64,${M_ARCH})
- ARCH64 = true
-endif
-ifeq (ppc64,${M_ARCH})
- ARCH64 = true
-endif
-ifeq (e2k,${M_ARCH})
- ARCH64 = true
-endif
-ifeq (${ARCH64},true)
- LDFLAGS.EXTRA = -L/usr/X11R6/lib64 -L/usr/lib64
- LIBDIR = $(GLEW_DEST)/lib64
-else
- LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib
- LIBDIR = $(GLEW_DEST)/lib
-endif
+CC ?= cc
+LD ?= cc
+LIBDIR = $(GLEW_DEST)/lib
+LDFLAGS.EXTRA = -L@TERMUX_PREFIX@/lib
LDFLAGS.GL = -lGL -lX11
LDFLAGS.STATIC = -Wl,-Bstatic
-LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+LDFLAGS.DYNAMIC = -Wl,-Bdynamic -Wl,-rpath=@TERMUX_PREFIX@/lib -Wl,--enable-new-dtags
NAME = GLEW
WARN += -Wall -W
WARN += -Wshadow
WARN += -pedantic
POPT = -O2
+CFLAGS.EXTRA += -I@TERMUX_PREFIX@/include
CFLAGS.EXTRA += -fPIC
CFLAGS.EXTRA += -Wcast-qual
CFLAGS.EXTRA += -ansi -pedantic
@@ -36,4 +21,4 @@
LIB.DEVLNK = lib$(NAME).so
LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
LIB.STATIC = lib$(NAME).a
-LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME)
+LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME) -Wl,-rpath=@TERMUX_PREFIX@/lib -Wl,--enable-new-dtags
diff -uNr glew-2.2.0/Makefile glew-2.2.0.mod/Makefile
--- glew-2.2.0/Makefile 2020-03-15 13:53:59.000000000 +0200
+++ glew-2.2.0.mod/Makefile 2021-11-04 18:06:35.454704596 +0200
@@ -40,12 +40,12 @@
$(error "Platform '$(SYSTEM)' not supported")
endif
-GLEW_PREFIX ?= /usr
-GLEW_DEST ?= /usr
-BINDIR ?= $(GLEW_DEST)/bin
-LIBDIR ?= $(GLEW_DEST)/lib
-INCDIR ?= $(GLEW_DEST)/include/GL
-PKGDIR ?= $(GLEW_DEST)/lib/pkgconfig
+GLEW_PREFIX = @TERMUX_PREFIX@
+GLEW_DEST = @TERMUX_PREFIX@
+BINDIR = $(GLEW_DEST)/bin
+LIBDIR = $(GLEW_DEST)/lib
+INCDIR = $(GLEW_DEST)/include/GL
+PKGDIR = $(GLEW_DEST)/lib/pkgconfig
ifneq ($(GLEW_NO_GLU), -DGLEW_NO_GLU)
LIBGLU = glu
@@ -115,9 +115,6 @@
else ifneq ($(LIBTOOL),)
$(LIBTOOL) $@ $^
endif
-ifneq ($(STRIP),)
- $(STRIP) -x $@
-endif
$(LIB.SHARED.DIR)/$(LIB.SHARED): $(LIB.SOBJS)
$(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
@@ -126,7 +123,7 @@
$(LN) $(LIB.SHARED) $(LIB.SHARED.DIR)/$(LIB.DEVLNK)
endif
ifneq ($(STRIP),)
- $(STRIP) -x $@
+ $(STRIP) --strip-unneeded $@
endif
tmp/$(SYSTEM)/default/static/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h