miniupnpd: get rid of OpenSSL dependencies in miniupnpd
parent
c403c378b1
commit
dff9e4183c
@ -0,0 +1,306 @@
|
|||||||
|
# $Id: Makefile.linux,v 1.105 2019/10/05 21:30:36 nanard Exp $
|
||||||
|
# MiniUPnP project
|
||||||
|
# (c) 2006-2019 Thomas Bernard
|
||||||
|
# http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||||
|
# Author : Thomas Bernard
|
||||||
|
# for use with GNU Make
|
||||||
|
#
|
||||||
|
# options can be passed to genconfig.sh through CONFIG_OPTIONS :
|
||||||
|
# $ CONFIG_OPTIONS="--ipv6 --igd2" make -f Makefile.linux
|
||||||
|
#
|
||||||
|
# To install use :
|
||||||
|
# $ DESTDIR=/dummyinstalldir make -f Makefile.linux install
|
||||||
|
# or :
|
||||||
|
# $ INSTALLPREFIX=/usr/local make -f Makefile.linux install
|
||||||
|
# or :
|
||||||
|
# $ make -f Makefile.linux install
|
||||||
|
# (default INSTALLPREFIX is /usr)
|
||||||
|
#
|
||||||
|
# if your system hasn't iptables libiptc headers and binary correctly
|
||||||
|
# installed, you need to get iptables sources from http://netfilter.org/
|
||||||
|
# ./configure them and build them then miniupnpd will build using :
|
||||||
|
# $ IPTABLESPATH=/path/to/iptables-1.4.1 make -f Makefile.linux
|
||||||
|
#
|
||||||
|
CONFIG_OPTIONS += --firewall=iptables
|
||||||
|
#CFLAGS = -O -g -DDEBUG
|
||||||
|
CFLAGS ?= -Os
|
||||||
|
CFLAGS += -fno-strict-aliasing
|
||||||
|
CFLAGS += -fno-common
|
||||||
|
CFLAGS += -fstack-protector -fPIE
|
||||||
|
CFLAGS += -D_FORTIFY_SOURCE=2
|
||||||
|
CFLAGS += -D_GNU_SOURCE
|
||||||
|
CFLAGS += -Wall
|
||||||
|
CFLAGS += -Wextra -Wstrict-prototypes -Wdeclaration-after-statement
|
||||||
|
#CFLAGS += -Wno-missing-field-initializers
|
||||||
|
#CFLAGS += -ansi # iptables headers does use typeof which is a gcc extension
|
||||||
|
CFLAGS += -I$(TOP)/shared
|
||||||
|
CFLAGS += $(EXTRACFLAGS)
|
||||||
|
LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
|
||||||
|
CC ?= gcc
|
||||||
|
RM = rm -f
|
||||||
|
INSTALL = install
|
||||||
|
STRIP ?= strip
|
||||||
|
PKG_CONFIG ?= pkg-config
|
||||||
|
CP = cp
|
||||||
|
|
||||||
|
|
||||||
|
INSTALLPREFIX ?= $(PREFIX)/usr
|
||||||
|
SBININSTALLDIR = $(INSTALLPREFIX)/sbin
|
||||||
|
ETCINSTALLDIR = $(PREFIX)/etc/miniupnpd
|
||||||
|
MANINSTALLDIR = $(INSTALLPREFIX)/share/man/man8
|
||||||
|
|
||||||
|
BASEOBJS = miniupnpd.o upnphttp.o upnpdescgen.o upnpsoap.o \
|
||||||
|
upnpreplyparse.o minixml.o portinuse.o \
|
||||||
|
upnpredirect.o getifaddr.o daemonize.o upnpglobalvars.o \
|
||||||
|
options.o upnppermissions.o minissdp.o natpmp.o pcpserver.o \
|
||||||
|
upnpevents.o upnputils.o getconnstatus.o \
|
||||||
|
upnpstun.o \
|
||||||
|
upnppinhole.o pcplearndscp.o asyncsendto.o
|
||||||
|
|
||||||
|
LNXOBJS = linux/getifstats.o linux/ifacewatcher.o linux/getroute.o
|
||||||
|
NETFILTEROBJS = netfilter/iptcrdr.o netfilter/iptpinhole.o netfilter/nfct_get.o
|
||||||
|
|
||||||
|
ALLOBJS = $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS)
|
||||||
|
|
||||||
|
PCFILE_FOUND := $(shell $(PKG_CONFIG) --exists libiptc; echo $$?)
|
||||||
|
|
||||||
|
ifeq (${PCFILE_FOUND},0)
|
||||||
|
|
||||||
|
IPTABLESVERSION := $(shell $(PKG_CONFIG) --modversion libiptc)
|
||||||
|
IPTVER1 := $(shell echo $(IPTABLESVERSION) | cut -d. -f1 )
|
||||||
|
IPTVER2 := $(shell echo $(IPTABLESVERSION) | cut -d. -f2 )
|
||||||
|
IPTVER3 := $(shell echo $(IPTABLESVERSION) | cut -d. -f3 )
|
||||||
|
# test if iptables version >= 1.4.3
|
||||||
|
TEST := $(shell [ $(IPTVER1) -gt 1 ] || \
|
||||||
|
[ \( $(IPTVER1) -eq 1 \) -a \
|
||||||
|
\( \( $(IPTVER2) -gt 4 \) -o \
|
||||||
|
\( \( $(IPTVER2) -eq 4 \) -a \( $(IPTVER3) -ge 3 \) \) \) ] && echo 1 )
|
||||||
|
ifeq ($(TEST), 1)
|
||||||
|
CPPFLAGS += -DIPTABLES_143
|
||||||
|
endif
|
||||||
|
|
||||||
|
CFLAGS += $(shell $(PKG_CONFIG) --cflags libiptc)
|
||||||
|
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libiptc)
|
||||||
|
LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libiptc)
|
||||||
|
LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-other libiptc)
|
||||||
|
else
|
||||||
|
|
||||||
|
LDLIBS ?= -liptc
|
||||||
|
|
||||||
|
ifdef IPTABLESPATH
|
||||||
|
CPPFLAGS := $(CPPFLAGS) -I$(IPTABLESPATH)/include/
|
||||||
|
LDFLAGS := $(LDFLAFGS) -L$(IPTABLESPATH)/libiptc/
|
||||||
|
|
||||||
|
# get iptables version and set IPTABLES_143 macro if needed
|
||||||
|
IPTABLESVERSION := $(shell grep "\#define VERSION" $(IPTABLESPATH)/config.h | tr -d \" |cut -d" " -f3 )
|
||||||
|
IPTVER1 := $(shell echo $(IPTABLESVERSION) | cut -d. -f1 )
|
||||||
|
IPTVER2 := $(shell echo $(IPTABLESVERSION) | cut -d. -f2 )
|
||||||
|
IPTVER3 := $(shell echo $(IPTABLESVERSION) | cut -d. -f3 )
|
||||||
|
# test if iptables version >= 1.4.3
|
||||||
|
TEST := $(shell [ $(IPTVER1) -gt 1 ] || \
|
||||||
|
[ \( $(IPTVER1) -eq 1 \) -a \
|
||||||
|
\( \( $(IPTVER2) -gt 4 \) -o \
|
||||||
|
\( \( $(IPTVER2) -eq 4 \) -a \( $(IPTVER3) -ge 3 \) \) \) ] && echo 1 )
|
||||||
|
|
||||||
|
ifeq ($(TEST), 1)
|
||||||
|
CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143
|
||||||
|
# the following sucks, but works
|
||||||
|
LDLIBS = $(IPTABLESPATH)/libiptc/.libs/libip4tc.o
|
||||||
|
ifeq ($(TCONFIG_IPV6),y)
|
||||||
|
LDLIBS += $(IPTABLESPATH)/libiptc/.libs/libip6tc.o
|
||||||
|
endif # ($(TCONFIG_IPV6),y)
|
||||||
|
else # ifeq ($(TEST), 1)
|
||||||
|
LDLIBS = $(IPTABLESPATH)/libiptc/libiptc.a
|
||||||
|
endif # ifeq ($(TEST), 1)
|
||||||
|
endif # ifdef IPTABLESPATH
|
||||||
|
endif # ifdef PCFILE_FOUND
|
||||||
|
|
||||||
|
|
||||||
|
TEST := $(shell $(PKG_CONFIG) --atleast-version=1.0.2 libnetfilter_conntrack && $(PKG_CONFIG) --atleast-version=1.0.3 libmnl && echo 1)
|
||||||
|
ifeq ($(TEST),1)
|
||||||
|
CPPFLAGS += -DUSE_NFCT
|
||||||
|
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libmnl)
|
||||||
|
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libnetfilter_conntrack)
|
||||||
|
endif # ($(TEST),1)
|
||||||
|
|
||||||
|
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l)
|
||||||
|
|
||||||
|
TEST := $(shell $(PKG_CONFIG) --exists uuid && echo 1)
|
||||||
|
ifeq ($(TEST),1)
|
||||||
|
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l uuid)
|
||||||
|
else
|
||||||
|
$(info please install uuid-dev package / libuuid)
|
||||||
|
endif # ($(TEST),1)
|
||||||
|
|
||||||
|
GLIBC_VERSION := $(shell ldd --version | head -n 1 | sed 's/^.* //')
|
||||||
|
GLIBC_VERSION_MAJOR = $(shell echo $(GLIBC_VERSION) | cut -f 1 -d . )
|
||||||
|
GLIBC_VERSION_MINOR = $(shell echo $(GLIBC_VERSION) | cut -f 2 -d . )
|
||||||
|
# clock_gettime() needs -lrt when glibc version < 2.17
|
||||||
|
LDLIBS += $(shell if [ $(GLIBC_VERSION_MAJOR) -lt 2 ] \
|
||||||
|
|| [ \( $(GLIBC_VERSION_MAJOR) -eq 2 \) -a \( $(GLIBC_VERSION_MINOR) -lt 17 \) ] ; \
|
||||||
|
then echo "-lrt" ; fi )
|
||||||
|
|
||||||
|
TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o
|
||||||
|
|
||||||
|
EXECUTABLES = miniupnpd testupnpdescgen testgetifstats \
|
||||||
|
testupnppermissions miniupnpdctl testgetifaddr \
|
||||||
|
testgetroute testasyncsendto testportinuse \
|
||||||
|
testssdppktgen testminissdp
|
||||||
|
|
||||||
|
.PHONY: all clean install depend genuuid
|
||||||
|
|
||||||
|
all: $(EXECUTABLES)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) config.h
|
||||||
|
$(RM) $(ALLOBJS)
|
||||||
|
$(RM) $(EXECUTABLES)
|
||||||
|
$(RM) testupnpdescgen.o testgetifstats.o
|
||||||
|
$(RM) testupnppermissions.o testgetifaddr.o
|
||||||
|
$(RM) testgetroute.o testasyncsendto.o
|
||||||
|
$(RM) testportinuse.o
|
||||||
|
$(RM) testminissdp.o
|
||||||
|
$(RM) testssdppktgen.o
|
||||||
|
$(RM) miniupnpdctl.o
|
||||||
|
|
||||||
|
install: miniupnpd miniupnpd.8 miniupnpd.conf genuuid \
|
||||||
|
netfilter/iptables_init.sh netfilter/iptables_removeall.sh \
|
||||||
|
netfilter/ip6tables_init.sh netfilter/ip6tables_removeall.sh \
|
||||||
|
netfilter/miniupnpd_functions.sh \
|
||||||
|
linux/miniupnpd.init.d.script
|
||||||
|
$(STRIP) miniupnpd
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(SBININSTALLDIR)
|
||||||
|
$(INSTALL) miniupnpd $(DESTDIR)$(SBININSTALLDIR)
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(ETCINSTALLDIR)
|
||||||
|
$(INSTALL) netfilter/iptables_init.sh $(DESTDIR)$(ETCINSTALLDIR)
|
||||||
|
$(INSTALL) netfilter/iptables_removeall.sh $(DESTDIR)$(ETCINSTALLDIR)
|
||||||
|
$(INSTALL) netfilter/ip6tables_init.sh $(DESTDIR)$(ETCINSTALLDIR)
|
||||||
|
$(INSTALL) netfilter/ip6tables_removeall.sh $(DESTDIR)$(ETCINSTALLDIR)
|
||||||
|
$(INSTALL) netfilter/miniupnpd_functions.sh $(DESTDIR)$(ETCINSTALLDIR)
|
||||||
|
$(INSTALL) --mode=0644 -b miniupnpd.conf $(DESTDIR)$(ETCINSTALLDIR)
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(PREFIX)/etc/init.d
|
||||||
|
$(INSTALL) linux/miniupnpd.init.d.script $(DESTDIR)$(PREFIX)/etc/init.d/miniupnpd
|
||||||
|
$(INSTALL) -d $(DESTDIR)$(MANINSTALLDIR)
|
||||||
|
$(INSTALL) --mode=0644 miniupnpd.8 $(DESTDIR)$(MANINSTALLDIR)
|
||||||
|
gzip -f $(DESTDIR)$(MANINSTALLDIR)/miniupnpd.8
|
||||||
|
|
||||||
|
# genuuid is using the uuidgen CLI tool which is part of libuuid
|
||||||
|
# from the e2fsprogs
|
||||||
|
# 'cat /proc/sys/kernel/random/uuid' could be also used
|
||||||
|
genuuid:
|
||||||
|
sed -i -e "s/^uuid=[-0-9a-f]*/uuid=`($(STAGING_DIR_HOST)/bin/genuuid||$(STAGING_DIR_HOST)/bin/uuidgen||$(STAGING_DIR_HOST)/bin/uuid) 2>/dev/null`/" miniupnpd.conf
|
||||||
|
|
||||||
|
miniupnpd: $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS)
|
||||||
|
|
||||||
|
testupnpdescgen: $(TESTUPNPDESCGENOBJS)
|
||||||
|
|
||||||
|
testgetifstats: testgetifstats.o linux/getifstats.o
|
||||||
|
|
||||||
|
testupnppermissions: testupnppermissions.o upnppermissions.o
|
||||||
|
|
||||||
|
testgetifaddr: testgetifaddr.o getifaddr.o
|
||||||
|
|
||||||
|
testgetroute: testgetroute.o linux/getroute.o upnputils.o
|
||||||
|
|
||||||
|
testssdppktgen: testssdppktgen.o
|
||||||
|
|
||||||
|
testasyncsendto: testasyncsendto.o asyncsendto.o upnputils.o \
|
||||||
|
linux/getroute.o
|
||||||
|
|
||||||
|
testportinuse: testportinuse.o portinuse.o getifaddr.o \
|
||||||
|
netfilter/iptcrdr.o
|
||||||
|
|
||||||
|
testminissdp: testminissdp.o minissdp.o upnputils.o upnpglobalvars.o \
|
||||||
|
asyncsendto.o linux/getroute.o
|
||||||
|
|
||||||
|
|
||||||
|
miniupnpdctl: miniupnpdctl.o
|
||||||
|
|
||||||
|
config.h: genconfig.sh VERSION
|
||||||
|
./genconfig.sh $(CONFIG_OPTIONS)
|
||||||
|
|
||||||
|
depend: config.h
|
||||||
|
makedepend -f$(MAKEFILE_LIST) -Y \
|
||||||
|
$(ALLOBJS:.o=.c) $(TESTUPNPDESCGENOBJS:.o=.c) \
|
||||||
|
testgetifstats.c testupnppermissions.c testgetifaddr.c \
|
||||||
|
testgetroute.c testasyncsendto.c testportinuse.c \
|
||||||
|
miniupnpdctl.c testssdppktgen.c 2>/dev/null
|
||||||
|
|
||||||
|
# DO NOT DELETE
|
||||||
|
|
||||||
|
miniupnpd.o: config.h macros.h upnpglobalvars.h upnppermissions.h
|
||||||
|
miniupnpd.o: miniupnpdtypes.h upnphttp.h upnpdescgen.h miniupnpdpath.h
|
||||||
|
miniupnpd.o: getifaddr.h upnpsoap.h options.h minissdp.h upnpredirect.h
|
||||||
|
miniupnpd.o: upnppinhole.h daemonize.h upnpevents.h asyncsendto.h natpmp.h
|
||||||
|
miniupnpd.o: pcpserver.h commonrdr.h upnputils.h ifacewatcher.h
|
||||||
|
upnphttp.o: config.h upnphttp.h upnpdescgen.h miniupnpdpath.h upnpsoap.h
|
||||||
|
upnphttp.o: upnpevents.h upnputils.h upnpglobalvars.h upnppermissions.h
|
||||||
|
upnphttp.o: miniupnpdtypes.h
|
||||||
|
upnpdescgen.o: config.h getifaddr.h upnpredirect.h upnpdescgen.h
|
||||||
|
upnpdescgen.o: miniupnpdpath.h upnpglobalvars.h upnppermissions.h
|
||||||
|
upnpdescgen.o: miniupnpdtypes.h upnpdescstrings.h upnpurns.h getconnstatus.h
|
||||||
|
upnpsoap.o: macros.h config.h upnpglobalvars.h upnppermissions.h
|
||||||
|
upnpsoap.o: miniupnpdtypes.h upnphttp.h upnpsoap.h upnpreplyparse.h
|
||||||
|
upnpsoap.o: upnpredirect.h upnppinhole.h getifaddr.h getifstats.h
|
||||||
|
upnpsoap.o: getconnstatus.h upnpurns.h
|
||||||
|
upnpreplyparse.o: upnpreplyparse.h minixml.h
|
||||||
|
minixml.o: minixml.h
|
||||||
|
portinuse.o: macros.h config.h upnpglobalvars.h upnppermissions.h
|
||||||
|
portinuse.o: miniupnpdtypes.h getifaddr.h portinuse.h netfilter/iptcrdr.h
|
||||||
|
portinuse.o: commonrdr.h
|
||||||
|
upnpredirect.o: macros.h config.h upnpredirect.h upnpglobalvars.h
|
||||||
|
upnpredirect.o: upnppermissions.h miniupnpdtypes.h upnpevents.h portinuse.h
|
||||||
|
upnpredirect.o: netfilter/iptcrdr.h commonrdr.h
|
||||||
|
getifaddr.o: config.h getifaddr.h
|
||||||
|
daemonize.o: daemonize.h config.h
|
||||||
|
upnpglobalvars.o: config.h upnpglobalvars.h upnppermissions.h
|
||||||
|
upnpglobalvars.o: miniupnpdtypes.h upnpdescstrings.h
|
||||||
|
options.o: config.h options.h upnppermissions.h upnpglobalvars.h
|
||||||
|
options.o: miniupnpdtypes.h
|
||||||
|
upnppermissions.o: config.h upnppermissions.h
|
||||||
|
minissdp.o: config.h upnpdescstrings.h miniupnpdpath.h upnphttp.h
|
||||||
|
minissdp.o: upnpglobalvars.h upnppermissions.h miniupnpdtypes.h minissdp.h
|
||||||
|
minissdp.o: upnputils.h getroute.h asyncsendto.h codelength.h macros.h
|
||||||
|
natpmp.o: macros.h config.h natpmp.h upnpglobalvars.h upnppermissions.h
|
||||||
|
natpmp.o: miniupnpdtypes.h getifaddr.h upnpredirect.h commonrdr.h upnputils.h
|
||||||
|
natpmp.o: portinuse.h asyncsendto.h
|
||||||
|
pcpserver.o: config.h pcpserver.h macros.h upnpglobalvars.h upnppermissions.h
|
||||||
|
pcpserver.o: miniupnpdtypes.h pcplearndscp.h upnpredirect.h commonrdr.h
|
||||||
|
pcpserver.o: getifaddr.h asyncsendto.h pcp_msg_struct.h netfilter/iptcrdr.h
|
||||||
|
pcpserver.o: commonrdr.h
|
||||||
|
upnpevents.o: config.h upnpevents.h miniupnpdpath.h upnpglobalvars.h
|
||||||
|
upnpevents.o: upnppermissions.h miniupnpdtypes.h upnpdescgen.h upnputils.h
|
||||||
|
upnputils.o: config.h upnputils.h upnpglobalvars.h upnppermissions.h
|
||||||
|
upnputils.o: miniupnpdtypes.h getroute.h
|
||||||
|
getconnstatus.o: getconnstatus.h getifaddr.h
|
||||||
|
upnppinhole.o: macros.h config.h upnpredirect.h upnpglobalvars.h
|
||||||
|
upnppinhole.o: upnppermissions.h miniupnpdtypes.h upnpevents.h upnppinhole.h
|
||||||
|
upnppinhole.o: netfilter/iptpinhole.h
|
||||||
|
pcplearndscp.o: config.h upnpglobalvars.h upnppermissions.h miniupnpdtypes.h
|
||||||
|
pcplearndscp.o: pcplearndscp.h
|
||||||
|
asyncsendto.o: asyncsendto.h upnputils.h
|
||||||
|
linux/getifstats.o: config.h getifstats.h
|
||||||
|
linux/ifacewatcher.o: config.h ifacewatcher.h config.h minissdp.h
|
||||||
|
linux/ifacewatcher.o: miniupnpdtypes.h getifaddr.h upnpglobalvars.h
|
||||||
|
linux/ifacewatcher.o: upnppermissions.h natpmp.h
|
||||||
|
linux/getroute.o: getroute.h upnputils.h
|
||||||
|
netfilter/iptcrdr.o: macros.h config.h netfilter/iptcrdr.h commonrdr.h
|
||||||
|
netfilter/iptcrdr.o: config.h upnpglobalvars.h upnppermissions.h
|
||||||
|
netfilter/iptcrdr.o: miniupnpdtypes.h
|
||||||
|
netfilter/iptpinhole.o: config.h netfilter/iptpinhole.h upnpglobalvars.h
|
||||||
|
netfilter/iptpinhole.o: upnppermissions.h config.h miniupnpdtypes.h
|
||||||
|
testupnpdescgen.o: macros.h config.h upnpdescgen.h upnpdescstrings.h
|
||||||
|
testupnpdescgen.o: getifaddr.h
|
||||||
|
upnpdescgen.o: config.h getifaddr.h upnpredirect.h upnpdescgen.h
|
||||||
|
upnpdescgen.o: miniupnpdpath.h upnpglobalvars.h upnppermissions.h
|
||||||
|
upnpdescgen.o: miniupnpdtypes.h upnpdescstrings.h upnpurns.h getconnstatus.h
|
||||||
|
testgetifstats.o: getifstats.h
|
||||||
|
testupnppermissions.o: upnppermissions.h config.h
|
||||||
|
testgetifaddr.o: config.h getifaddr.h
|
||||||
|
testgetroute.o: getroute.h upnputils.h upnpglobalvars.h upnppermissions.h
|
||||||
|
testgetroute.o: config.h miniupnpdtypes.h
|
||||||
|
testasyncsendto.o: miniupnpdtypes.h config.h upnputils.h asyncsendto.h
|
||||||
|
testportinuse.o: macros.h config.h portinuse.h
|
||||||
|
miniupnpdctl.o: macros.h
|
||||||
|
testssdppktgen.o: macros.h config.h miniupnpdpath.h upnphttp.h
|
||||||
|
upnpstun.o: config.h upnpstun.h netfilter/iptcrdr.h
|
@ -1,57 +0,0 @@
|
|||||||
--- miniupnpd/genconfig.sh
|
|
||||||
+++ miniupnpd/genconfig.sh
|
|
||||||
@@ -99,7 +99,7 @@ fi
|
|
||||||
# Tomato USB special case
|
|
||||||
if [ -f ../shared/tomato_version ]; then
|
|
||||||
OS_NAME=Tomato
|
|
||||||
- TOMATO_VER=`cat ../shared/tomato_version | cut -d' ' -f2,3`
|
|
||||||
+ TOMATO_VER=`cat ../shared/tomato_version | cut -d' ' -f1,2`
|
|
||||||
OS_VERSION="Tomato $TOMATO_VER"
|
|
||||||
fi
|
|
||||||
|
|
||||||
--- miniupnpd/Makefile.linux
|
|
||||||
+++ miniupnpd/Makefile.linux
|
|
||||||
@@ -28,7 +28,7 @@ CFLAGS += -fno-strict-aliasing
|
|
||||||
CFLAGS += -fno-common
|
|
||||||
CFLAGS += -fstack-protector -fPIE
|
|
||||||
CFLAGS += -D_FORTIFY_SOURCE=2
|
|
||||||
-CPPFLAGS += -D_GNU_SOURCE
|
|
||||||
+CFLAGS += -D_GNU_SOURCE
|
|
||||||
CFLAGS += -Wall
|
|
||||||
CFLAGS += -Wextra -Wstrict-prototypes -Wdeclaration-after-statement
|
|
||||||
#CFLAGS += -Wno-missing-field-initializers
|
|
||||||
@@ -42,6 +42,8 @@ PKG_CONFIG ?= pkg-config
|
|
||||||
CP = cp
|
|
||||||
DOXYGEN ?= doxygen
|
|
||||||
|
|
||||||
+# for Tomato ARM (router/shared)
|
|
||||||
+CFLAGS += -I$(TOP)/shared
|
|
||||||
|
|
||||||
INSTALLPREFIX ?= $(PREFIX)/usr
|
|
||||||
SBININSTALLDIR = $(INSTALLPREFIX)/sbin
|
|
||||||
@@ -117,7 +119,13 @@ TEST := $(shell [ $(IPTVER1) -gt 1 ] ||
|
|
||||||
ifeq ($(TEST), 1)
|
|
||||||
CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143
|
|
||||||
# the following sucks, but works
|
|
||||||
+# for Tomato ARM - check IPv6 support
|
|
||||||
+ifeq ($(TCONFIG_IPV6),y)
|
|
||||||
LDLIBS = $(IPTABLESPATH)/libiptc/.libs/libip4tc.o
|
|
||||||
+LDLIBS += $(IPTABLESPATH)/libiptc/.libs/libip6tc.o
|
|
||||||
+else # ($(TCONFIG_IPV6),y)
|
|
||||||
+LDLIBS = $(IPTABLESPATH)/libiptc/.libs/libip4tc.o
|
|
||||||
+endif # ($(TCONFIG_IPV6),y)
|
|
||||||
#LDLIBS = $(IPTABLESPATH)/libiptc/.libs/libiptc.a
|
|
||||||
else # ifeq ($(TEST), 1)
|
|
||||||
LDLIBS = $(IPTABLESPATH)/libiptc/libiptc.a
|
|
||||||
|
|
||||||
--- miniupnpd/getifaddr.c
|
|
||||||
+++ miniupnpd/getifaddr.c
|
|
||||||
@@ -24,6 +24,8 @@
|
|
||||||
#include "getifaddr.h"
|
|
||||||
#if defined(USE_GETIFADDRS) || defined(ENABLE_IPV6) || defined(ENABLE_PCP)
|
|
||||||
#include <ifaddrs.h>
|
|
||||||
+/* for Tomato ARM - Add getifaddr support to Tomato ARM builds (missing) */
|
|
||||||
+#include "ifaddrs.c"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
@ -0,0 +1,39 @@
|
|||||||
|
--- miniupnpd/genconfig.sh
|
||||||
|
+++ miniupnpd/genconfig.sh
|
||||||
|
@@ -96,11 +96,11 @@ if [ -f ./os.astlinux ]; then
|
||||||
|
OS_VERSION=$(cat ./os.astlinux)
|
||||||
|
fi
|
||||||
|
|
||||||
|
-# Tomato USB special case
|
||||||
|
+# Tomato special case
|
||||||
|
if [ -f ../shared/tomato_version ]; then
|
||||||
|
OS_NAME=Tomato
|
||||||
|
- TOMATO_VER=`cat ../shared/tomato_version | cut -d' ' -f2,3`
|
||||||
|
- OS_VERSION="Tomato $TOMATO_VER"
|
||||||
|
+ TOMATO_VER=`cat ../shared/tomato_version | cut -d' ' -f1,2`
|
||||||
|
+ OS_VERSION="FreshTomato $TOMATO_VER"
|
||||||
|
fi
|
||||||
|
|
||||||
|
${RM} ${CONFIGFILE}
|
||||||
|
@@ -352,8 +352,8 @@ case $OS_NAME in
|
||||||
|
FW=iptables
|
||||||
|
;;
|
||||||
|
Tomato)
|
||||||
|
- OS_NAME=UPnP
|
||||||
|
- OS_URL=http://tomatousb.org/
|
||||||
|
+ OS_NAME=FreshTomato
|
||||||
|
+ OS_URL=https://freshtomato.org/
|
||||||
|
echo "" >> ${CONFIGFILE}
|
||||||
|
echo "#ifndef TOMATO" >> ${CONFIGFILE}
|
||||||
|
echo "#define TOMATO" >> ${CONFIGFILE}
|
||||||
|
--- miniupnpd/getifaddr.c
|
||||||
|
+++ miniupnpd/getifaddr.c
|
||||||
|
@@ -24,6 +24,8 @@
|
||||||
|
#include "getifaddr.h"
|
||||||
|
#if defined(USE_GETIFADDRS) || defined(ENABLE_IPV6) || defined(ENABLE_PCP)
|
||||||
|
#include <ifaddrs.h>
|
||||||
|
+/* for Tomato ARM - Add getifaddr support to Tomato ARM builds (missing) */
|
||||||
|
+#include "ifaddrs.c"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
Loading…
Reference in New Issue