openbsd-ports/graphics/glew/patches/patch-Makefile
sthen a4318369a4 - don't strip the shared lib when installing
- make sure to pass the PIC flag to the compiler when linking
the shared lib

from Brad (maintainer)
2009-08-02 12:32:36 +00:00

37 lines
1.1 KiB
Plaintext

$OpenBSD: patch-Makefile,v 1.2 2009/08/02 12:32:36 sthen Exp $
--- Makefile.orig Sun Aug 2 06:31:42 2009
+++ Makefile Sun Aug 2 06:32:54 2009
@@ -59,7 +59,7 @@ else
OPT = $(POPT)
endif
INCLUDE = -Iinclude
-CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA)
+CFLAGS += $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA)
LIB.SRCS = src/glew.c
LIB.OBJS = $(LIB.SRCS:.c=.o)
@@ -84,12 +84,7 @@ lib/$(LIB.STATIC): $(LIB.OBJS)
$(AR) cr $@ $^
lib/$(LIB.SHARED): $(LIB.SOBJS)
- $(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
-ifeq ($(patsubst mingw%,mingw,$(SYSTEM)), mingw)
-else
- $(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
- $(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
-endif
+ $(LD) $(LDFLAGS.SO) -fPIC -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.SRCS) lib/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.SRCS) $(BIN.LIBS)
@@ -99,6 +94,9 @@ bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.SRCS) lib/$(LI
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
+
+%.so: %.c
+ $(CC) -c $(CFLAGS) -fPIC -o $@ $<
src/glew.o: src/glew.c include/GL/glew.h include/GL/wglew.h include/GL/glxew.h
$(CC) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<