You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-libs/libnatpmp/files/respect-FLAGS.patch

41 lines
999 B

--- libnatpmp-20110808/Makefile
+++ libnatpmp-20110808/Makefile
@@ -4,13 +4,12 @@
# http://miniupnp.free.fr/libnatpmp.html
OS = $(shell uname -s)
-CC = gcc
+CC ?= gcc
INSTALL = install
# APIVERSION is used in soname
APIVERSION = 1
-#LDFLAGS = -Wl,--no-undefined
-CFLAGS = -O -fPIC -Wall -DENABLE_STRNATPMPERR
+CFLAGS := -Wall -DENABLE_STRNATPMPERR $(CFLAGS)
LIBOBJS = natpmp.o getgateway.o
@@ -75,16 +75,18 @@
testgetgateway: testgetgateway.o getgateway.o
natpmpc-shared: natpmpc.o $(SHAREDLIB)
- $(CC) $(LDFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+getgateway.o natpmp.o: CFLAGS += -fPIC
$(STATICLIB): $(LIBOBJS)
$(AR) crs $@ $?
$(SHAREDLIB): $(LIBOBJS)
ifeq ($(OS), Darwin)
- $(CC) -dynamiclib -Wl,-install_name,$(SONAME) -o $@ $^
+ $(CC) $(CFLAGS) $(LDFLAGS) -dynamiclib -Wl,-install_name,$(SONAME) -o $@ $^
else
- $(CC) -shared -Wl,-soname,$(SONAME) -o $@ $^
+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^
endif
# DO NOT DELETE