--- a/Makefile.openwrt +++ b/Makefile.openwrt @@ -59,8 +59,8 @@ depend: config.h $(ALLOBJS:.o=.c) $(TESTUPNPDESCGENOBJS:.o=.c) \ 2>/dev/null -config.h: config.h.openwrt - $(CP) $< $@ +config.h: genconfig.sh + ./genconfig.sh # DO NOT DELETE --- a/genconfig.sh +++ b/genconfig.sh @@ -28,6 +28,12 @@ if [ -f /etc/platform ]; then fi fi +# OpenWRT special case +if [ -f ./os.openwrt ]; then + OS_NAME=OpenWRT + OS_VERSION=$(cat ./os.openwrt) +fi + ${RM} ${CONFIGFILE} echo "/* MiniUPnP Project" >> ${CONFIGFILE} @@ -176,6 +182,11 @@ case $OS_NAME in echo "#define USE_NETFILTER 1" >> ${CONFIGFILE} FW=netfilter ;; + OpenWRT) + OS_URL=http://www.openwrt.org/ + echo "#define USE_NETFILTER 1" >> ${CONFIGFILE} + FW=netfilter + ;; Darwin) echo "#define USE_IPFW 1" >> ${CONFIGFILE} FW=ipfw --- a/config.h.openwrt +++ /dev/null @@ -1,29 +0,0 @@ -/* $Id: config.h.openwrt,v 1.4 2011/02/28 17:30:24 nanard Exp $ */ -/* MiniUPnP Project - * http:///miniupnp.free.fr - * (c) 2006-2011 Thomas Bernard - */ -#ifndef __CONFIG_H__ -#define __CONFIG_H__ - -#define MINIUPNPD_VERSION "1.5" - -#define UPNP_VERSION "20070228" -#define USE_NETFILTER 1 -#define OS_NAME "OpenWRT" -/* OS/version */ -#define OS_VERSION "OpenWRT/kamikaze" -#define OS_URL "http://openwrt.org/" - -#define LOG_MINIUPNPD LOG_DAEMON - -/* Comment the following line to disable NAT-PMP operations */ -#define ENABLE_NATPMP - -/* Comment the following line to use home made daemonize() func instead - * of BSD daemon() */ -#define USE_DAEMON - -#define ENABLE_L3F_SERVICE - -#endif --- /dev/null +++ b/config.h.openwrt.old @@ -0,0 +1,29 @@ +/* $Id: config.h.openwrt,v 1.4 2011/02/28 17:30:24 nanard Exp $ */ +/* MiniUPnP Project + * http:///miniupnp.free.fr + * (c) 2006-2011 Thomas Bernard + */ +#ifndef __CONFIG_H__ +#define __CONFIG_H__ + +#define MINIUPNPD_VERSION "1.5" + +#define UPNP_VERSION "20070228" +#define USE_NETFILTER 1 +#define OS_NAME "OpenWRT" +/* OS/version */ +#define OS_VERSION "OpenWRT/kamikaze" +#define OS_URL "http://openwrt.org/" + +#define LOG_MINIUPNPD LOG_DAEMON + +/* Comment the following line to disable NAT-PMP operations */ +#define ENABLE_NATPMP + +/* Comment the following line to use home made daemonize() func instead + * of BSD daemon() */ +#define USE_DAEMON + +#define ENABLE_L3F_SERVICE + +#endif