sbin: build ping if at least one of INET & INET6 is enabled

It does not build (and serves no purpose) if neither is true (i.e.,
building WITHOUT_INET and WITHOUT_INET6).  Also add an explicit error
in ping to make this case clear.

PR:		260082
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2021-11-28 12:50:13 -05:00
parent b8cf1c5c30
commit a4ef9e58bc
2 changed files with 6 additions and 1 deletions

View File

@ -53,7 +53,6 @@ SUBDIR=adjkerntz \
nfsiod \
nos-tun \
pfilctl \
ping \
rcorder \
reboot \
recoverdisk \
@ -68,6 +67,10 @@ SUBDIR=adjkerntz \
tunefs \
umount
.if ${MK_INET} != "no" || ${MK_INET6} != "no"
SUBDIR+= ping
.endif
SUBDIR.${MK_CCD}+= ccdconfig
SUBDIR.${MK_CXX}+= devd
SUBDIR.${MK_HAST}+= hastctl

View File

@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$");
#define OPTSTR PING4OPTS
#elif defined(INET6)
#define OPTSTR PING6OPTS
#else
#error At least one of INET and INET6 is required
#endif
int