diff -Naur libnatpmp-20120821.orig/Makefile libnatpmp-20120821/Makefile --- libnatpmp-20120821.orig/Makefile 2012-08-21 13:24:15.000000000 -0400 +++ libnatpmp-20120821/Makefile 2012-08-26 20:22:40.000000000 -0400 @@ -5,12 +5,13 @@ # 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 +GENTOO_CFLAGS := $(CFLAGS) CFLAGS = -Os #CFLAGS = -g -O0 CFLAGS += -fPIC @@ -32,6 +33,8 @@ SONAME = $(SHAREDLIB).$(APIVERSION) endif +CFLAGS := $(CFLAGS) $(GENTOO_CFLAGS) + HEADERS = natpmp.h EXECUTABLES = testgetgateway natpmpc-shared natpmpc-static @@ -79,19 +82,19 @@ testgetgateway: testgetgateway.o getgateway.o natpmpc-static: natpmpc.o $(STATICLIB) - $(CC) $(LDFLAGS) -o $@ $^ + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ natpmpc-shared: natpmpc.o $(SHAREDLIB) - $(CC) $(LDFLAGS) -o $@ $^ + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(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