miniupnpd/Makefile: make firewall detection consistent with genconfig.sh; assume PF if /etc/rc.subr and/or /etc/rc.conf not found on *BSD

This commit is contained in:
Daniel Becker 2014-06-20 23:23:16 -07:00
parent 78d32ba012
commit dcf658c55e
1 changed files with 18 additions and 6 deletions

View File

@ -45,25 +45,37 @@ FWNAME = pf
.endif
# better way to find if we are using ipf or pf
.if exists(/etc/rc.subr) && exists(/etc/rc.conf)
.if $(OSNAME) == "FreeBSD"
.if exists(/etc/rc.subr) && exists(/etc/rc.conf)
FWNAME != . /etc/rc.subr; . /etc/rc.conf; \
if checkyesno ipfilter_enable; then \
echo "ipf"; elif checkyesno pf_enable; then \
echo "pf"; else echo "ipfw"; fi
echo "pf"; elif checkyesno firewall_enable; then \
echo "ipfw"; else echo "pf"; fi
.else
FWNAME = pf
.endif
.endif
.if $(OSNAME) == "NetBSD"
.if exists(/etc/rc.subr) && exists(/etc/rc.conf)
FWNAME != . /etc/rc.subr; . /etc/rc.conf; \
if checkyesno ipfilter; then \
if checkyesno pf; then \
echo "pf"; elif checkyesno ipfilter; then \
echo "ipf"; else echo "pf"; fi
.else
FWNAME = pf
.endif
.endif
.if $(OSNAME) == "DragonFly"
.if exists(/etc/rc.subr) && exists(/etc/rc.conf)
FWNAME != . /etc/rc.subr; . /etc/rc.conf; \
if checkyesno ipfilter; then \
echo "ipf"; elif checkyesno pf_enable; then \
echo "pf"; else echo "ipfw"; fi
if checkyesno pf; then \
echo "pf"; elif checkyesno ipfilter; then \
echo "ipf"; else echo "pf"; fi
.else
FWNAME = pf
.endif
.endif