Index: head/sys/conf/kern.opts.mk =================================================================== --- head/sys/conf/kern.opts.mk +++ head/sys/conf/kern.opts.mk @@ -11,19 +11,42 @@ # that haven't been converted over. # +# Note: bsd.own.mk must be included before the rest of kern.opts.mk to make +# building on 10.x and earlier work. This should be removed when that's no +# longer supported since it confounds the defaults (since it uses the host's +# notion of defaults rather than what's default in current when building +# within sys/modules). +.include + # These options are used by the kernel build process (kern.mk and kmod.mk) # They have to be listed here so we can build modules outside of the # src tree. __DEFAULT_YES_OPTIONS = \ ARM_EABI \ + BLUETOOTH \ + CDDL \ + CRYPT \ FORMAT_EXTENSIONS \ INET \ INET6 \ - KERNEL_SYMBOLS + IPFILTER \ + KERNEL_SYMBOLS \ + NETGRAPH \ + PF \ + SOURCELESS_HOST \ + SOURCELESS_UCODE \ + USB_GADGET_EXAMPLES \ + ZFS + +__DEFAULT_NO_OPTIONS = \ + EISA \ + NAND \ + OFED -# expanded inline from bsd.mkopt.mk: +# expanded inline from bsd.mkopt.mk to avoid share/mk dependency +# Those that default to yes .for var in ${__DEFAULT_YES_OPTIONS} .if !defined(MK_${var}) .if defined(WITHOUT_${var}) # WITHOUT always wins @@ -35,6 +58,18 @@ .endfor .undef __DEFAULT_YES_OPTIONS +# Those that default to no +.for var in ${__DEFAULT_NO_OPTIONS} +.if !defined(MK_${var}) +.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins +MK_${var}:= yes +.else +MK_${var}:= no +.endif +.endif +.endfor +.undef __DEFAULT_NO_OPTIONS + # # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". Index: head/sys/modules/Makefile =================================================================== --- head/sys/modules/Makefile +++ head/sys/modules/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR_PARALLEL= Index: head/sys/modules/aic7xxx/ahc/Makefile =================================================================== --- head/sys/modules/aic7xxx/ahc/Makefile +++ head/sys/modules/aic7xxx/ahc/Makefile @@ -1,9 +1,10 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../../dev/aic7xxx +.PATH: ${SYSDIR}/dev/aic7xxx KMOD= ahc .if ${MK_EISA} != "no" SUBDIR+= ahc_eisa @@ -20,20 +21,20 @@ .endif BEFORE_DEPEND = ${GENSRCS} -../aicasm/aicasm: ${.CURDIR}/../../../dev/aic7xxx/aicasm/*.[chyl] +../aicasm/aicasm: ${SYSDIR}/dev/aic7xxx/aicasm/*.[chyl] ( cd ${.CURDIR}/../aicasm; ${MAKE} aicasm; ) .if make(ahcfirmware) ahcfirmware: ${GENSRCS} ${GENSRCS}: \ - ${.CURDIR}/../../../dev/aic7xxx/aic7xxx.{reg,seq} \ - ${.CURDIR}/../../../cam/scsi/scsi_message.h - ../aicasm/aicasm ${INCLUDES} -I${.CURDIR}/../../../cam/scsi \ - -I${.CURDIR}/../../../dev/aic7xxx \ + ${SYSDIR}/dev/aic7xxx/aic7xxx.{reg,seq} \ + ${SYSDIR}/cam/scsi/scsi_message.h + ../aicasm/aicasm ${INCLUDES} -I${SYSDIR}/cam/scsi \ + -I${SYSDIR}/dev/aic7xxx \ -o aic7xxx_seq.h -r aic7xxx_reg.h \ ${REG_PRINT_OPT} \ - -i ${.CURDIR}/../../../dev/aic7xxx/aic7xxx_osm.h \ - ${.CURDIR}/../../../dev/aic7xxx/aic7xxx.seq + -i ${SYSDIR}/dev/aic7xxx/aic7xxx_osm.h \ + ${SYSDIR}/dev/aic7xxx/aic7xxx.seq .else ${GENSRCS}: @echo "Error: ${.TARGET} is missing. Run 'make ahcfirmware'" Index: head/sys/modules/cxgb/Makefile =================================================================== --- head/sys/modules/cxgb/Makefile +++ head/sys/modules/cxgb/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= cxgb SUBDIR+= cxgb_t3fw Index: head/sys/modules/cxgbe/Makefile =================================================================== --- head/sys/modules/cxgbe/Makefile +++ head/sys/modules/cxgbe/Makefile @@ -2,7 +2,8 @@ # $FreeBSD$ # -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= if_cxgbe SUBDIR+= t4_firmware Index: head/sys/modules/dpt/Makefile =================================================================== --- head/sys/modules/dpt/Makefile +++ head/sys/modules/dpt/Makefile @@ -1,8 +1,9 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../dev/dpt +.PATH: ${SYSDIR}/dev/dpt KMOD= dpt SRCS= dpt_scsi.c dpt.h \ dpt_pci.c pci_if.h \ Index: head/sys/modules/drm/Makefile =================================================================== --- head/sys/modules/drm/Makefile +++ head/sys/modules/drm/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). Index: head/sys/modules/drm2/Makefile =================================================================== --- head/sys/modules/drm2/Makefile +++ head/sys/modules/drm2/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ -.include -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" .if ${MACHINE_CPUARCH} == "amd64" _radeonkms= radeonkms Index: head/sys/modules/ep/Makefile =================================================================== --- head/sys/modules/ep/Makefile +++ head/sys/modules/ep/Makefile @@ -1,8 +1,9 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../dev/ep +.PATH: ${SYSDIR}/dev/ep KMOD= if_ep SRCS= if_ep.c Index: head/sys/modules/if_gif/Makefile =================================================================== --- head/sys/modules/if_gif/Makefile +++ head/sys/modules/if_gif/Makefile @@ -1,8 +1,9 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6 +.PATH: ${SYSDIR}/net ${SYSDIR}/netinet ${SYSDIR}/netinet6 KMOD= if_gif SRCS= if_gif.c in_gif.c opt_inet.h opt_inet6.h opt_mrouting.h Index: head/sys/modules/netgraph/Makefile =================================================================== --- head/sys/modules/netgraph/Makefile +++ head/sys/modules/netgraph/Makefile @@ -1,7 +1,8 @@ # $Whistle: Makefile,v 1.5 1999/01/24 06:48:37 archie Exp $ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= async \ atm \ @@ -57,7 +58,7 @@ _bluetooth= bluetooth .endif -.if ${MK_CRYPT} != "no" && exists(${.CURDIR}/../../crypto/rc4/rc4.c) +.if ${MK_CRYPT} != "no" && exists(${SYSDIR}/crypto/rc4/rc4.c) _mppc= mppc .endif Index: head/sys/modules/sound/driver/Makefile =================================================================== --- head/sys/modules/sound/driver/Makefile +++ head/sys/modules/sound/driver/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../../.. +.include "${SYSDIR}/conf/kern.opts.mk" # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). Index: head/sys/modules/usb/Makefile =================================================================== --- head/sys/modules/usb/Makefile +++ head/sys/modules/usb/Makefile @@ -25,7 +25,8 @@ # SUCH DAMAGE. # -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" # # Check for common USB debug flags to pass when building the USB Index: head/sys/modules/vx/Makefile =================================================================== --- head/sys/modules/vx/Makefile +++ head/sys/modules/vx/Makefile @@ -1,8 +1,9 @@ # $FreeBSD$ -.include +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../dev/vx +.PATH: ${SYSDIR}/dev/vx KMOD= if_vx SRCS= if_vx.c if_vx_pci.c