From 9cc22e5c8903f1d455cd3246a667dd017fb75878 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Fri, 5 Aug 2005 18:45:49 +0000 Subject: [PATCH] Make IPX support depend on NO_IPX --- usr.bin/netstat/Makefile | 9 ++++++++- usr.bin/netstat/main.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile index 483e8ef2b502..3c3eeeb6ba6f 100644 --- a/usr.bin/netstat/Makefile +++ b/usr.bin/netstat/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= netstat -SRCS= if.c inet.c inet6.c main.c mbuf.c mcast.c mroute.c ipx.c route.c \ +SRCS= if.c inet.c inet6.c main.c mbuf.c mcast.c mroute.c route.c \ unix.c atalk.c netgraph.c mroute6.c ipsec.c WARNS?= 2 @@ -18,4 +18,11 @@ BINMODE=2555 DPADD= ${LIBKVM} ${LIBIPX} ${LIBMEMSTAT} ${LIBNETGRAPH} ${LIBUTIL} LDADD= -lkvm -lipx -lmemstat -lnetgraph -lutil +.if !defined(NO_IPX) +SRCS+= ipx.c +DPADD+= ${LIBIPX} +LDADD+= -lipx +CFLAGS+=-DIPX +.endif + .include diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index ecdcd01e6210..61a0ec19daff 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -235,6 +235,7 @@ struct protox netgraphprotox[] = { NULL, NULL, NULL, 0 } }; +#ifdef IPX struct protox ipxprotox[] = { { N_IPX, N_IPXSTAT, 1, ipxprotopr, ipx_stats, NULL, "ipx", 0 }, @@ -243,6 +244,7 @@ struct protox ipxprotox[] = { { -1, -1, 0, NULL, NULL, NULL, 0, 0 } }; +#endif struct protox *protoprotox[] = { protox, @@ -252,7 +254,10 @@ struct protox *protoprotox[] = { #ifdef IPSEC pfkeyprotox, #endif - ipxprotox, atalkprotox, NULL }; +#ifdef IPX + ipxprotox, +#endif + atalkprotox, NULL }; const char *pluralies(int); static void printproto(struct protox *, const char *); @@ -517,11 +522,13 @@ main(int argc, char *argv[]) for (tp = pfkeyprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); #endif /*IPSEC*/ +#ifdef IPX if (af == AF_IPX || af == AF_UNSPEC) { kread(0, 0, 0); for (tp = ipxprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name); } +#endif /* IPX */ if (af == AF_APPLETALK || af == AF_UNSPEC) for (tp = atalkprotox; tp->pr_name; tp++) printproto(tp, tp->pr_name);