From 9c3d2ffcdff40754b2207eb84c1ff0843e225c71 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 21 Sep 2008 22:02:26 +0000 Subject: add new build knobs and jigger some existing controls to improve control over the result of buildworld and installworld; this especially helps packaging systems such as nanobsd Reviewed by: various (posted to arch) MFC after: 1 month --- usr.bin/Makefile | 102 ++++++++++++++++++++++++++++++++++------------ usr.bin/netstat/Makefile | 13 ++++-- usr.bin/netstat/main.c | 10 ++++- usr.bin/netstat/netstat.h | 2 + 4 files changed, 95 insertions(+), 32 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 7e947e9..2abc3d4 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -13,12 +13,12 @@ SUBDIR= alias \ apply \ ${_ar} \ asa \ - at \ + ${_at} \ ${_atm} \ awk \ banner \ basename \ - biff \ + ${_biff} \ ${_bluetooth} \ brandelf \ bsdiff \ @@ -30,24 +30,24 @@ SUBDIR= alias \ cap_mkdb \ ${_catman} \ chat \ - checknr \ + ${_checknr} \ ${_chkey} \ chpass \ cksum \ cmp \ col \ - colcrt \ + ${_colcrt} \ colldef \ colrm \ column \ comm \ - compile_et \ + ${_compile_et} \ compress \ ${_cpio} \ cpuset \ csplit \ ${_csup} \ - ctags \ + ${_ctags} \ cut \ ${_dig} \ dirname \ @@ -61,12 +61,12 @@ SUBDIR= alias \ false \ fetch \ file \ - file2c \ + ${_file2c} \ find \ finger \ - fmt \ + ${_fmt} \ fold \ - from \ + ${_from} \ fstat \ fsync \ ftp \ @@ -82,7 +82,7 @@ SUBDIR= alias \ hexdump \ ${_host} \ id \ - indent \ + ${_indent} \ ipcrm \ ipcs \ join \ @@ -104,7 +104,7 @@ SUBDIR= alias \ ${_lex} \ limits \ locale \ - locate \ + ${_locate} \ lock \ lockf \ logger \ @@ -115,8 +115,8 @@ SUBDIR= alias \ lorder \ lsvfs \ m4 \ - mail \ - make \ + ${_mail} \ + ${_make} \ makewhatis \ mesg \ minigzip \ @@ -124,10 +124,10 @@ SUBDIR= alias \ mkdep \ mkfifo \ mklocale \ - mkstr \ + ${_mkstr} \ mktemp \ mkuzip \ - msgs \ + ${_msgs} \ mt \ ${_nc} \ ncal \ @@ -153,19 +153,19 @@ SUBDIR= alias \ printenv \ printf \ procstat \ - quota \ + ${_quota} \ renice \ rev \ ${_rlogin} \ - rpcgen \ + ${_rpcgen} \ rpcinfo \ rs \ ${_rsh} \ rup \ - ruptime \ + ${_ruptime} \ rusers \ rwall \ - rwho \ + ${_rwho} \ script \ sed \ shar \ @@ -182,7 +182,7 @@ SUBDIR= alias \ tar \ tcopy \ tee \ - telnet \ + ${_telnet} \ tftp \ time \ tip \ @@ -196,10 +196,10 @@ SUBDIR= alias \ tset \ tsort \ tty \ - ul \ + ${_ul} \ uname \ unexpand \ - unifdef \ + ${_unifdef} \ uniq \ units \ unvis \ @@ -209,7 +209,7 @@ SUBDIR= alias \ uudecode \ uuencode \ ${_vacation} \ - vgrind \ + ${_vgrind} \ vi \ vis \ vmstat \ @@ -226,7 +226,7 @@ SUBDIR= alias \ xargs \ xinstall \ ${_xlint} \ - xstr \ + ${_xstr} \ ${_yacc} \ yes \ ${_ypcat} \ @@ -237,6 +237,12 @@ SUBDIR= alias \ _truss= truss .endif +# NB: keep these sorted by MK_* knobs + +.if ${MK_AT} != "no" +_at= at +.endif + .if ${MK_ATM} != "no" _atm= atm .endif @@ -264,6 +270,10 @@ _cpio= cpio _calendar= calendar .endif +.if ${MK_HESIOD} != "no" +_hesinfo= hesinfo +.endif + .if ${MK_OPENSSL} != "no" _chkey= chkey _newkey= newkey @@ -272,8 +282,21 @@ _csup= csup .endif .endif -.if ${MK_HESIOD} != "no" -_hesinfo= hesinfo +.if ${MK_LOCATE} != "no" +_locate= locate +.endif + +# XXX msgs? +.if ${MK_MAIL} != "no" +_biff= biff +_fmt= fmt +_from= from +_mail= mail +_msgs= msgs +.endif + +.if ${MK_MAKE} != "no" +_make= make .endif .if ${MK_NETCAT} != "no" @@ -286,22 +309,47 @@ _ypmatch= ypmatch _ypwhich= ypwhich .endif +.if ${MK_QUOTAS} != "no" +_quota= quota +.endif + .if ${MK_RCMDS} != "no" _rlogin= rlogin _rsh= rsh +_ruptime= ruptime +_rwho= rwho .endif .if ${MK_SENDMAIL} != "no" _vacation= vacation .endif +.if ${MK_TELNET} != "no" +_telnet= telnet +.endif + +.if ${MK_TEXTPROC} != "no" +_checknr= checknr +_colcrt= colcrt +_ul= ul +.endif + .if ${MK_TOOLCHAIN} != "no" -_ar= ar _c89= c89 _c99= c99 +_compile_et= compile_et +_ctags= ctags +_file2c= file2c _gprof= gprof +_indent= indent _lex= lex +_mkstr= mkstr +_rpcgen= rpcgen +_unifdef= unifdef _xlint= xlint +_xstr= xstr +# XXX maybe under textproc? +_vgrind= vgrind _yacc= yacc .endif diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile index c781556..bb73c67 100644 --- a/usr.bin/netstat/Makefile +++ b/usr.bin/netstat/Makefile @@ -5,7 +5,7 @@ PROG= netstat SRCS= if.c inet.c main.c mbuf.c mcast.c mroute.c route.c \ - unix.c atalk.c netgraph.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c + unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c WARNS?= 3 CFLAGS+=-fno-strict-aliasing @@ -20,8 +20,15 @@ CFLAGS+=-DINET6 BINGRP= kmem BINMODE=2555 -DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBNETGRAPH} ${LIBUTIL} -LDADD= -lkvm -lmemstat -lnetgraph -lutil +DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL} +LDADD= -lkvm -lmemstat -lutil + +.if ${MK_NETGRAPH_SUPPORT} != "no" +SRCS+= netgraph.c +DPADD+= ${LIBNETGRAPH} +LDADD+= -lnetgraph +CFLAGS+=-DNETGRAPH +.endif .if ${MK_IPX_SUPPORT} != "no" SRCS+= ipx.c diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 3b130b2..1f2f0e1 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$"); #include +#ifdef NETGRAPH #include +#endif #include #include @@ -272,7 +274,7 @@ struct protox atalkprotox[] = { { -1, -1, 0, NULL, NULL, NULL, NULL, 0, 0 } }; - +#ifdef NETGRAPH struct protox netgraphprotox[] = { { N_NGSOCKS, -1, 1, netgraphprotopr, NULL, NULL, "ctrl", 0, 0 }, @@ -281,7 +283,7 @@ struct protox netgraphprotox[] = { { -1, -1, 0, NULL, NULL, NULL, NULL, 0, 0 } }; - +#endif #ifdef IPX struct protox ipxprotox[] = { { N_IPX, N_IPXSTAT, 1, ipxprotopr, @@ -384,9 +386,11 @@ main(int argc, char *argv[]) af = AF_UNIX; else if (strcmp(optarg, "atalk") == 0) af = AF_APPLETALK; +#ifdef NETGRAPH else if (strcmp(optarg, "ng") == 0 || strcmp(optarg, "netgraph") == 0) af = AF_NETGRAPH; +#endif else if (strcmp(optarg, "link") == 0) af = AF_LINK; else { @@ -584,9 +588,11 @@ main(int argc, char *argv[]) if (af == AF_APPLETALK || af == AF_UNSPEC) for (tp = atalkprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); +#ifdef NETGRAPH if (af == AF_NETGRAPH || af == AF_UNSPEC) for (tp = netgraphprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); +#endif /* NETGRAPH */ if ((af == AF_UNIX || af == AF_UNSPEC) && !Lflag && !sflag) unixpr(nl[N_UNP_COUNT].n_value, nl[N_UNP_GENCNT].n_value, nl[N_UNP_DHEAD].n_value, nl[N_UNP_SHEAD].n_value); diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index 0b7f439..3812e63 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -145,7 +145,9 @@ void nserr_stats(u_long, const char *, int, int); void atalkprotopr(u_long, const char *, int, int); void ddp_stats(u_long, const char *, int, int); +#ifdef NETGRAPH void netgraphprotopr(u_long, const char *, int, int); +#endif void unixpr(u_long, u_long, u_long, u_long); -- cgit v1.1