summaryrefslogtreecommitdiff
blob: df36e2d4a4a04b0c521658dab43781d4a4d889d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
diff -Naur libnatpmp-20130911.orig/Makefile libnatpmp-20130911/Makefile
--- libnatpmp-20130911.orig/Makefile	2013-09-10 16:15:06.000000000 -0400
+++ libnatpmp-20130911/Makefile	2013-09-12 13:20:29.191447842 -0400
@@ -5,7 +5,7 @@
 # http://miniupnp.free.fr/libnatpmp.html
 
 OS = $(shell uname -s)
-CC = gcc
+CC ?= gcc
 INSTALL = install
 VERSION = $(shell cat VERSION)
 
@@ -22,6 +22,7 @@
 # APIVERSION is used in soname
 APIVERSION = 1
 #LDFLAGS = -Wl,--no-undefined
+GENTOO_CFLAGS := $(CFLAGS)
 CFLAGS = -Os
 #CFLAGS = -g -O0
 CFLAGS += -fPIC
@@ -52,6 +53,8 @@
 endif
 endif
 
+CFLAGS := $(CFLAGS) $(GENTOO_CFLAGS)
+
 HEADERS = natpmp.h
 
 EXECUTABLES = testgetgateway natpmpc-shared natpmpc-static
@@ -144,19 +147,19 @@
 	$(CC) $(LDFLAGS) -o $@ $^ $(EXTRA_LD)
 
 natpmpc-static:	natpmpc.o $(STATICLIB)
-	$(CC) $(LDFLAGS) -o $@ $^ $(EXTRA_LD)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRA_LD)
 
 natpmpc-shared:	natpmpc.o $(SHAREDLIB)
-	$(CC) $(LDFLAGS) -o $@ $^ $(EXTRA_LD)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRA_LD)
 
 $(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 $@ $^ $(EXTRA_LD)
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ $(EXTRA_LD)
 endif