Author: imp Date: Mon Aug 11 14:50:49 2014 New Revision: 269812 URL: http://svnweb.freebsd.org/changeset/base/269812
Log: Remove dependence on source tree options. Move all kernel module options into kern.opts.mk and change all the places where we use src.opts.mk to pull in the options. Conditionally define SYSDIR and use SYSDIR/conf/kern.opts.mk instead of a CURDIR path. Replace all instances of CURDIR/../../etc with STSDIR, but only in the affected files. As a special compatibility hack, include bsd.owm.mk at the top of kern.opts.mk to allow the bare build of sys/modules to work on older systems. If the defaults ever change between 9.x, 10.x and current for these options, however, you'll wind up with the host OS' defaults rather than the -current defaults. This hack will be removed when we no longer need to support this build scenario. Reviewed by: jhb Differential Revision: https://phabric.freebsd.org/D529 Modified: head/sys/conf/kern.opts.mk head/sys/modules/Makefile head/sys/modules/aic7xxx/ahc/Makefile head/sys/modules/cxgb/Makefile head/sys/modules/cxgbe/Makefile head/sys/modules/dpt/Makefile head/sys/modules/drm/Makefile head/sys/modules/drm2/Makefile head/sys/modules/ep/Makefile head/sys/modules/if_gif/Makefile head/sys/modules/netgraph/Makefile head/sys/modules/sound/driver/Makefile head/sys/modules/usb/Makefile head/sys/modules/vx/Makefile Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/conf/kern.opts.mk Mon Aug 11 14:50:49 2014 (r269812) @@ -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 <bsd.own.mk> + # 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 @@ MK_${var}:= yes .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". Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,6 +1,7 @@ # $FreeBSD$ -.include <src.opts.mk> +SYSDIR?=${.CURDIR}/.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR_PARALLEL= Modified: head/sys/modules/aic7xxx/ahc/Makefile ============================================================================== --- head/sys/modules/aic7xxx/ahc/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/aic7xxx/ahc/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,9 +1,10 @@ # $FreeBSD$ -.include <src.opts.mk> +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 @@ REG_PRINT_OPT= -p aic7xxx_reg_print.c .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'" Modified: head/sys/modules/cxgb/Makefile ============================================================================== --- head/sys/modules/cxgb/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/cxgb/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,6 +1,7 @@ # $FreeBSD$ -.include <src.opts.mk> +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= cxgb SUBDIR+= cxgb_t3fw Modified: head/sys/modules/cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/cxgbe/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -2,7 +2,8 @@ # $FreeBSD$ # -.include <src.opts.mk> +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= if_cxgbe SUBDIR+= t4_firmware Modified: head/sys/modules/dpt/Makefile ============================================================================== --- head/sys/modules/dpt/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/dpt/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,8 +1,9 @@ # $FreeBSD$ -.include <src.opts.mk> +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 \ Modified: head/sys/modules/drm/Makefile ============================================================================== --- head/sys/modules/drm/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/drm/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,6 +1,7 @@ # $FreeBSD$ -.include <src.opts.mk> +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). Modified: head/sys/modules/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/drm2/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,7 +1,7 @@ # $FreeBSD$ -.include <src.opts.mk> -.include <bsd.own.mk> +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" .if ${MACHINE_CPUARCH} == "amd64" _radeonkms= radeonkms Modified: head/sys/modules/ep/Makefile ============================================================================== --- head/sys/modules/ep/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/ep/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,8 +1,9 @@ # $FreeBSD$ -.include <src.opts.mk> +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" -.PATH: ${.CURDIR}/../../dev/ep +.PATH: ${SYSDIR}/dev/ep KMOD= if_ep SRCS= if_ep.c Modified: head/sys/modules/if_gif/Makefile ============================================================================== --- head/sys/modules/if_gif/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/if_gif/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,8 +1,9 @@ # $FreeBSD$ -.include <src.opts.mk> +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 Modified: head/sys/modules/netgraph/Makefile ============================================================================== --- head/sys/modules/netgraph/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/netgraph/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,7 +1,8 @@ # $Whistle: Makefile,v 1.5 1999/01/24 06:48:37 archie Exp $ # $FreeBSD$ -.include <src.opts.mk> +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= async \ atm \ @@ -57,7 +58,7 @@ SUBDIR= async \ _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 Modified: head/sys/modules/sound/driver/Makefile ============================================================================== --- head/sys/modules/sound/driver/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/sound/driver/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,6 +1,7 @@ # $FreeBSD$ -.include <src.opts.mk> +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). Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/usb/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -25,7 +25,8 @@ # SUCH DAMAGE. # -.include <src.opts.mk> +SYSDIR?=${.CURDIR}/../.. +.include "${SYSDIR}/conf/kern.opts.mk" # # Check for common USB debug flags to pass when building the USB Modified: head/sys/modules/vx/Makefile ============================================================================== --- head/sys/modules/vx/Makefile Mon Aug 11 14:46:09 2014 (r269811) +++ head/sys/modules/vx/Makefile Mon Aug 11 14:50:49 2014 (r269812) @@ -1,8 +1,9 @@ # $FreeBSD$ -.include <src.opts.mk> +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 _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"