From a4ef9e58bc0c07110a54ba0fa88eb118c5377e6f Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Sun, 28 Nov 2021 12:50:13 -0500 Subject: [PATCH] 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 --- sbin/Makefile | 5 ++++- sbin/ping/main.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/Makefile b/sbin/Makefile index 7eb497e3e3dd..69cf51a83e26 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -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 diff --git a/sbin/ping/main.c b/sbin/ping/main.c index c021e2c26b14..1d0b714f1480 100644 --- a/sbin/ping/main.c +++ b/sbin/ping/main.c @@ -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