diff --git a/lib/Makefile b/lib/Makefile index 83d9d636ee94..90e217ebc94e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -258,8 +258,10 @@ _librtld_db= librtld_db .endif .if ${MACHINE_CPUARCH} == "amd64" +.if ${MK_BHYVE} != "no" _libvmmapi= libvmmapi .endif +.endif .if ${MACHINE_CPUARCH} == "mips" _libproc= libproc diff --git a/share/examples/Makefile b/share/examples/Makefile index 0765a4376fbb..7e0576cf6aac 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -7,7 +7,6 @@ LDIRS= BSD_daemon \ FreeBSD_version \ IPv6 \ - bhyve \ bootforth \ csh \ diskless \ @@ -41,7 +40,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ FreeBSD_version/Makefile \ FreeBSD_version/README \ IPv6/USAGE \ - bhyve/vmrun.sh \ bootforth/README \ bootforth/boot.4th \ bootforth/frames.4th \ @@ -205,6 +203,13 @@ XFILES+= hast/ucarp.sh \ hast/vip-up.sh .endif +.if ${MACHINE_CPUARCH} == "amd64" +.if ${MK_BHYVE} != "no" +LDIRS+= bhyve +XFILES+= bhyve/vmrun.sh +.endif +.endif + # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''); (latter useful # in environments where it's not possible to keep /sys publicly readable) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 8bfd87572fec..afdd16e2accc 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -835,7 +835,6 @@ _xnb.4= xnb.4 .endif .if ${MACHINE_CPUARCH} == "amd64" -_bhyve.4= bhyve.4 _if_ntb.4= if_ntb.4 _ntb.4= ntb.4 _ntb_hw.4= ntb_hw.4 @@ -848,6 +847,10 @@ MLINKS+=qlxge.4 if_qlxge.4 MLINKS+=qlxgb.4 if_qlxgb.4 MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=sfxge.4 if_sfxge.4 + +.if ${MK_BHYVE} != "no" +_bhyve.4= bhyve.4 +.endif .endif .if ${MACHINE_CPUARCH} == "mips" diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 63dcb1bdb1f6..c8c42bef0ba0 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -52,6 +52,7 @@ __DEFAULT_YES_OPTIONS = \ ATM \ AUDIT \ AUTHPF \ + BHYVE \ BINUTILS \ BINUTILS_BOOTSTRAP \ BLUETOOTH \ diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 84e4e4f8b4e4..dd74a17c3a53 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -23,6 +23,7 @@ # src tree. __DEFAULT_YES_OPTIONS = \ + BHYVE \ BLUETOOTH \ CCD \ CDDL \ diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 5c7485684fda..2a3da246735f 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -620,8 +620,11 @@ _qlxge= qlxge _qlxgb= qlxgb _qlxgbe= qlxgbe _sfxge= sfxge + +.if ${MK_BHYVE} != "no" || defined(ALL_MODULES) _vmm= vmm .endif +.endif .if ${MACHINE_CPUARCH} == "i386" # XXX some of these can move to the general case when de-i386'ed diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 575c101492a2..f627f1f4376f 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -144,6 +144,16 @@ OLD_FILES+=usr/share/man/man8/authpf.8.gz OLD_FILES+=usr/share/man/man8/authpf-noip.8.gz .endif +.if ${MK_BHYVE} == no +OLD_FILES+=usr/sbin/bhyve +OLD_FILES+=usr/sbin/bhyvectl +OLD_FILES+=usr/sbin/bhyveload +OLD_FILES+=usr/share/examples/bhyve/vmrun.sh +OLD_FILES+=usr/share/man/man8/bhyve.8.gz +OLD_FILES+=usr/share/man/man8/bhyveload.8.gz +OLD_DIRS+=usr/share/examples/bhyve +.endif + .if ${MK_BLUETOOTH} == no OLD_FILES+=etc/bluetooth/hcsecd.conf OLD_FILES+=etc/bluetooth/hosts diff --git a/tools/build/options/WITHOUT_BHYVE b/tools/build/options/WITHOUT_BHYVE new file mode 100644 index 000000000000..b80a72697a26 --- /dev/null +++ b/tools/build/options/WITHOUT_BHYVE @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr bhyve 8 , +associated utilities, and examples. +.Pp +This option only affects amd64/amd64. diff --git a/usr.sbin/Makefile.amd64 b/usr.sbin/Makefile.amd64 index 2d1a3e8daadd..3f40974c7a0d 100644 --- a/usr.sbin/Makefile.amd64 +++ b/usr.sbin/Makefile.amd64 @@ -10,9 +10,11 @@ SUBDIR+= acpi SUBDIR+= apm .endif SUBDIR+= asf +.if ${MK_BHYVE} != "no" SUBDIR+= bhyve SUBDIR+= bhyvectl SUBDIR+= bhyveload +.endif SUBDIR+= boot0cfg .if ${MK_TOOLCHAIN} != "no" SUBDIR+= btxld