File: 02-makefile.diff

package info (click to toggle)
linux-igd 1.0%2Bcvs20070630-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 888 kB
  • ctags: 618
  • sloc: ansic: 2,066; xml: 593; sh: 136; makefile: 50
file content (137 lines) | stat: -rw-r--r-- 4,698 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
Description: Fix include files and include paths
Author: Nick Leverton <nick@leverton.org>

Index: linux-igd-1.0+cvs20070630-libupnp6/Makefile
===================================================================
--- linux-igd-1.0+cvs20070630-libupnp6.orig/Makefile	2014-10-07 23:35:42.000000000 +0100
+++ linux-igd-1.0+cvs20070630-libupnp6/Makefile	2014-10-07 23:35:47.000000000 +0100
@@ -1,18 +1,32 @@
-PREFIX=/usr
-LIBUPNP_PREFIX=/usr
+PREFIX ?= /usr
 #LIBIPTC_PREFIX=/usr
 
-CC=gcc
-INCLUDES= -I$(LIBUPNP_PREFIX)/include -I../include
-LIBS= -lpthread -lupnp -lixml -lthreadutil -L$(LIBUPNP_PREFIX)/lib -L../libs
-FILES= main.o gatedevice.o pmlist.o util.o config.o
+# libupnp version for use with pkgconfig
+LIBUPNP=libupnp
+
+CC ?= gcc
+CFLAGS ?= -Wall -g -O2
 
-CFLAGS += -Wall -g -O2
+INCLUDES += $(shell pkg-config --cflags $(LIBUPNP))
+LIBS += $(shell pkg-config --libs $(LIBUPNP))
+FILES= main.o gatedevice.o pmlist.o util.o config.o
 
 ifdef HAVE_LIBIPTC
 ifdef LIBIPTC_PREFIX
-LIBS += -L$(LIBIPTC_PREFIX)/lib
-INCLUDES += -I$(LIBIPTC_PREFIX)/include
+INCLUDES += $(shell pkg-config --cflags libiptc)
+LIBS += $(shell pkg-config --libs libiptc)
+endif
+
+# iptables 1.4.3 moves some functions from ip_ namespace to nf_
+ifdef HAVE_IPTABLES_143
+INCLUDES += -DIPTABLES_143
+endif
+
+# xtables now makes available some formerly private iptables bits
+ifdef HAVE_XTABLES
+INCLUDES += -DHAVE_XTABLES
+INCLUDES += $(shell pkg-config --cflags xtables)
+LIBS += $(shell pkg-config --libs xtables)
 endif
 
 LIBS += -liptc
@@ -23,7 +37,7 @@
 all: upnpd
 
 upnpd: $(FILES)
-	$(CC) $(CFLAGS) $(FILES) $(LIBS) -o $@
+	$(CC) $(LDFLAGS) $(FILES) $(LIBS) -o $@
 	@echo "make $@ finished on `date`"
 
 %.o:	%.c
@@ -33,11 +47,11 @@
 	rm -f *.o upnpd
 
 install: upnpd
-	install -d /etc/linuxigd
-	install etc/gatedesc.xml /etc/linuxigd
-	install etc/gateconnSCPD.xml  /etc/linuxigd
-	install etc/gateicfgSCPD.xml /etc/linuxigd
-	install etc/dummy.xml /etc/linuxigd
-	install upnpd $(PREFIX)/sbin
-	install upnpd.8 $(PREFIX)/share/man/man8
-	if [ ! -f /etc/upnpd.conf ]; then install etc/upnpd.conf /etc; fi
+	install -d $(DESTDIR)/etc/linuxigd
+	install -m0644 -p etc/gatedesc.xml $(DESTDIR)/etc/linuxigd
+	install -m0644 -p etc/gateconnSCPD.xml  $(DESTDIR)/etc/linuxigd
+	install -m0644 -p etc/gateicfgSCPD.xml $(DESTDIR)/etc/linuxigd
+	install -m0644 -p etc/dummy.xml $(DESTDIR)/etc/linuxigd
+	install -D upnpd $(DESTDIR)$(PREFIX)/sbin/upnpd
+	install -D -m0644 -p upnpd.8 $(DESTDIR)$(PREFIX)/share/man/man8/upnpd.8
+	if [ ! -f $(DESTDIR)/etc/upnpd.conf ]; then install -p -m0644 etc/upnpd.conf $(DESTDIR)/etc; fi
Index: linux-igd-1.0+cvs20070630-libupnp6/gatedevice.c
===================================================================
--- linux-igd-1.0+cvs20070630-libupnp6.orig/gatedevice.c	2014-10-07 23:35:42.000000000 +0100
+++ linux-igd-1.0+cvs20070630-libupnp6/gatedevice.c	2014-10-07 23:35:47.000000000 +0100
@@ -1,11 +1,11 @@
 #include <syslog.h>
 #include <stdlib.h>
-#include <upnp/ixml.h>
 #include <string.h>
 #include <time.h>
-#include <upnp/upnp.h>
-#include <upnp/upnptools.h>
-#include <upnp/TimerThread.h>
+#include <ixml.h>
+#include <upnp.h>
+#include <upnptools.h>
+#include <TimerThread.h>
 #include "globals.h"
 #include "gatedevice.h"
 #include "pmlist.h"
Index: linux-igd-1.0+cvs20070630-libupnp6/gatedevice.h
===================================================================
--- linux-igd-1.0+cvs20070630-libupnp6.orig/gatedevice.h	2014-10-07 23:35:42.000000000 +0100
+++ linux-igd-1.0+cvs20070630-libupnp6/gatedevice.h	2014-10-07 23:35:47.000000000 +0100
@@ -1,7 +1,7 @@
 #ifndef _GATEDEVICE_H_
 #define _GATEDEVICE_H_ 1
 
-#include <upnp/upnp.h>
+#include <upnp.h>
 
 /* interface statistics */
 typedef enum {
Index: linux-igd-1.0+cvs20070630-libupnp6/main.c
===================================================================
--- linux-igd-1.0+cvs20070630-libupnp6.orig/main.c	2014-10-07 23:35:42.000000000 +0100
+++ linux-igd-1.0+cvs20070630-libupnp6/main.c	2014-10-07 23:35:47.000000000 +0100
@@ -9,7 +9,7 @@
 #include <sys/resource.h>
 #include <time.h>
 #include <net/if.h>
-#include <upnp/upnp.h>
+#include <upnp.h>
 #include "globals.h"
 #include "config.h"
 #include "gatedevice.h"
Index: linux-igd-1.0+cvs20070630-libupnp6/pmlist.c
===================================================================
--- linux-igd-1.0+cvs20070630-libupnp6.orig/pmlist.c	2014-10-07 23:35:42.000000000 +0100
+++ linux-igd-1.0+cvs20070630-libupnp6/pmlist.c	2014-10-07 23:35:47.000000000 +0100
@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <sys/wait.h>
 #include <unistd.h>
-#include <upnp/upnp.h>
+#include <upnp.h>
 #include "globals.h"
 #include "config.h"
 #include "pmlist.h"