From 8bbe5d5c1564b3dc90ce25249d4845b18b2fe348 Mon Sep 17 00:00:00 2001 From: np Date: Fri, 3 Mar 2017 03:11:58 +0000 Subject: [PATCH] Add cxgbetool(8) to the base system. Move cxgbetool from tools/tools to usr.sbin. Compile and install it on platforms where cxgbe(4) is built by default. Knobs (WITH_CXGBETOOL and WITHOUT_CXGBETOOL) have been added so that the user can override the default setting. Reviewed by: ngie@, gnn@, bdrewery@ MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D9854 --- share/mk/src.opts.mk | 7 +++++++ targets/pseudo/userland/Makefile.depend | 4 ++++ tools/build/options/WITHOUT_CXGBETOOL | 3 +++ tools/build/options/WITH_CXGBETOOL | 3 +++ tools/tools/cxgbetool/Makefile | 9 --------- usr.sbin/Makefile | 1 + usr.sbin/cxgbetool/Makefile | 8 ++++++++ usr.sbin/cxgbetool/Makefile.depend | 19 +++++++++++++++++++ .../tools => usr.sbin}/cxgbetool/cxgbetool.8 | 0 .../tools => usr.sbin}/cxgbetool/cxgbetool.c | 0 .../cxgbetool/reg_defs_t4.c | 0 .../cxgbetool/reg_defs_t4vf.c | 0 .../cxgbetool/reg_defs_t5.c | 0 .../cxgbetool/reg_defs_t6.c | 0 14 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 tools/build/options/WITHOUT_CXGBETOOL create mode 100644 tools/build/options/WITH_CXGBETOOL delete mode 100644 tools/tools/cxgbetool/Makefile create mode 100644 usr.sbin/cxgbetool/Makefile create mode 100644 usr.sbin/cxgbetool/Makefile.depend rename {tools/tools => usr.sbin}/cxgbetool/cxgbetool.8 (100%) rename {tools/tools => usr.sbin}/cxgbetool/cxgbetool.c (100%) rename {tools/tools => usr.sbin}/cxgbetool/reg_defs_t4.c (100%) rename {tools/tools => usr.sbin}/cxgbetool/reg_defs_t4vf.c (100%) rename {tools/tools => usr.sbin}/cxgbetool/reg_defs_t5.c (100%) rename {tools/tools => usr.sbin}/cxgbetool/reg_defs_t6.c (100%) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index ec4bf66fc9e3..23065688d999 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -275,6 +275,13 @@ BROKEN_OPTIONS+=SSP BROKEN_OPTIONS+=EFI .endif +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T} == "powerpc64" || ${__T} == "sparc64" +__DEFAULT_YES_OPTIONS+=CXGBETOOL +.else +__DEFAULT_NO_OPTIONS+=CXGBETOOL +.endif + .include # diff --git a/targets/pseudo/userland/Makefile.depend b/targets/pseudo/userland/Makefile.depend index 1201a233c36d..43fe71d61984 100644 --- a/targets/pseudo/userland/Makefile.depend +++ b/targets/pseudo/userland/Makefile.depend @@ -895,6 +895,10 @@ DIRDEPS+= \ usr.sbin/blacklistd .endif +.if ${MK_CXGBETOOL} != "no" +DIRDEPS+= usr.sbin/cxgbetool +.endif + .if ${MK_GPL_DTC} != "yes" DIRDEPS+= usr.bin/dtc .endif diff --git a/tools/build/options/WITHOUT_CXGBETOOL b/tools/build/options/WITHOUT_CXGBETOOL new file mode 100644 index 000000000000..d7aef386344b --- /dev/null +++ b/tools/build/options/WITHOUT_CXGBETOOL @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build +.Xr cxgbetool 8 diff --git a/tools/build/options/WITH_CXGBETOOL b/tools/build/options/WITH_CXGBETOOL new file mode 100644 index 000000000000..b9c26a09c2e5 --- /dev/null +++ b/tools/build/options/WITH_CXGBETOOL @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build +.Xr cxgbetool 8 diff --git a/tools/tools/cxgbetool/Makefile b/tools/tools/cxgbetool/Makefile deleted file mode 100644 index 1430a5a09062..000000000000 --- a/tools/tools/cxgbetool/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $FreeBSD$ - -PROG= cxgbetool -SRCS= cxgbetool.c -MAN= cxgbetool.8 -CFLAGS+= -I${.CURDIR}/../../../sys/dev/cxgbe -I${.CURDIR}/../../../sys -I. -BINDIR?= /usr/sbin - -.include diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 9eb92da76f23..ac33d277b73a 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -123,6 +123,7 @@ SUBDIR.${MK_BOOTPARAMD}+= bootparamd SUBDIR.${MK_BSDINSTALL}+= bsdinstall SUBDIR.${MK_BSNMP}+= bsnmpd SUBDIR.${MK_CTM}+= ctm +SUBDIR.${MK_CXGBETOOL}+= cxgbetool SUBDIR.${MK_DIALOG}+= bsdconfig SUBDIR.${MK_EFI}+= efivar SUBDIR.${MK_FLOPPY}+= fdcontrol diff --git a/usr.sbin/cxgbetool/Makefile b/usr.sbin/cxgbetool/Makefile new file mode 100644 index 000000000000..f8291aff0a1b --- /dev/null +++ b/usr.sbin/cxgbetool/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= cxgbetool +MAN= cxgbetool.8 +CFLAGS+= -I${SRCTOP}/sys/dev/cxgbe -I${SRCTOP}/sys -I. +WARNS?= 2 + +.include diff --git a/usr.sbin/cxgbetool/Makefile.depend b/usr.sbin/cxgbetool/Makefile.depend new file mode 100644 index 000000000000..54c1f6f1442e --- /dev/null +++ b/usr.sbin/cxgbetool/Makefile.depend @@ -0,0 +1,19 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/tools/tools/cxgbetool/cxgbetool.8 b/usr.sbin/cxgbetool/cxgbetool.8 similarity index 100% rename from tools/tools/cxgbetool/cxgbetool.8 rename to usr.sbin/cxgbetool/cxgbetool.8 diff --git a/tools/tools/cxgbetool/cxgbetool.c b/usr.sbin/cxgbetool/cxgbetool.c similarity index 100% rename from tools/tools/cxgbetool/cxgbetool.c rename to usr.sbin/cxgbetool/cxgbetool.c diff --git a/tools/tools/cxgbetool/reg_defs_t4.c b/usr.sbin/cxgbetool/reg_defs_t4.c similarity index 100% rename from tools/tools/cxgbetool/reg_defs_t4.c rename to usr.sbin/cxgbetool/reg_defs_t4.c diff --git a/tools/tools/cxgbetool/reg_defs_t4vf.c b/usr.sbin/cxgbetool/reg_defs_t4vf.c similarity index 100% rename from tools/tools/cxgbetool/reg_defs_t4vf.c rename to usr.sbin/cxgbetool/reg_defs_t4vf.c diff --git a/tools/tools/cxgbetool/reg_defs_t5.c b/usr.sbin/cxgbetool/reg_defs_t5.c similarity index 100% rename from tools/tools/cxgbetool/reg_defs_t5.c rename to usr.sbin/cxgbetool/reg_defs_t5.c diff --git a/tools/tools/cxgbetool/reg_defs_t6.c b/usr.sbin/cxgbetool/reg_defs_t6.c similarity index 100% rename from tools/tools/cxgbetool/reg_defs_t6.c rename to usr.sbin/cxgbetool/reg_defs_t6.c -- 2.41.0