Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 May 2014 20:31:34 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r266349 - in head: share/mk sys/conf
Message-ID:  <201405172031.s4HKVY51073386@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sat May 17 20:31:34 2014
New Revision: 266349
URL: http://svnweb.freebsd.org/changeset/base/266349

Log:
  The time is not yet ripe to break the lack of dependencies between
  src/sys and the rest of the tree for builds.
  o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk
  o No need to include src.opts.mk at all anymore. The reasons for it
    are now coverted in sys.mk and src.sys.mk.

Modified:
  head/share/mk/src.sys.mk
  head/sys/conf/kern.opts.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/src.sys.mk
==============================================================================
--- head/share/mk/src.sys.mk	Sat May 17 20:22:22 2014	(r266348)
+++ head/share/mk/src.sys.mk	Sat May 17 20:31:34 2014	(r266349)
@@ -1,7 +1,13 @@
 # $FreeBSD$
 
+# Note: This file is also duplicated in the sys/conf/kern.pre.mk so
+# it will always grab SRCCONF, even if it isn't being built in-tree
+# to preserve historical (and useful) behavior. Changes here need to
+# be reflected there so SRCCONF isn't included multiple times.
+
 # Allow user to configure things that only effect src tree builds.
 SRCCONF?=	/etc/src.conf
-.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
+.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_)
 .include "${SRCCONF}"
+_srcconf_included_:
 .endif

Modified: head/sys/conf/kern.opts.mk
==============================================================================
--- head/sys/conf/kern.opts.mk	Sat May 17 20:22:22 2014	(r266348)
+++ head/sys/conf/kern.opts.mk	Sat May 17 20:31:34 2014	(r266349)
@@ -19,17 +19,15 @@ __DEFAULT_YES_OPTIONS = \
     FORMAT_EXTENSIONS \
     KERNEL_SYMBOLS
 
-__DEFAULT_NO_OPTIONS = \
+# expanded inline from bsd.mkopt.mk:
 
-# Kludge to allow a less painful transition. If MAKESYSPATH isn't defined,
-# assume we have a standard FreeBSD src tree layout and reach over and grab
-# bsd.mkopt.mk from there. If it is defined, trust it to point someplace sane
-# and include bsd.mkopt.mk from there. We need the !defined case to keep ports
-# kernel modules working (though arguably they should define MAKESYSPATH). We
-# need the latter case to keep the Jenkins testing harness working where they
-# specifically use a non-standard layout, but do define MAKESYSPATH correctly.
-.if !defined(MAKESYSPATH)
-.include "../../share/mk/bsd.mkopt.mk"
+.for var in ${__DEFAULT_YES_OPTIONS}
+.if !defined(MK_${var})
+.if defined(WITHOUT_${var})			# WITHOUT always wins
+MK_${var}:=	no
 .else
-.include <bsd.mkopt.mk>
+MK_${var}:=	yes
 .endif
+.endif
+.endfor
+.undef __DEFAULT_YES_OPTIONS

Modified: head/sys/conf/kern.pre.mk
==============================================================================
--- head/sys/conf/kern.pre.mk	Sat May 17 20:22:22 2014	(r266348)
+++ head/sys/conf/kern.pre.mk	Sat May 17 20:31:34 2014	(r266349)
@@ -3,7 +3,19 @@
 # Part of a unified Makefile for building kernels.  This part contains all
 # of the definitions that need to be before %BEFORE_DEPEND.
 
-.include <src.opts.mk>
+# Allow user to configure things that only effect src tree builds.
+# Note: This is duplicated from src.sys.mk to ensure that we include
+# /etc/src.conf when building the kernel. Kernels can be built without
+# the rest of /usr/src, but they still always process SRCCONF even though
+# the normal mechanisms to prevent that (compiling out of tree) won't
+# work. To ensure they do work, we have to duplicate thee few lines here.
+SRCCONF?=	/etc/src.conf
+.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_)
+.include "${SRCCONF}"
+_srcconf_included_:
+.endif
+
+.include <bsd.own.mk>
 .include <bsd.compiler.mk>
 .include "kern.opts.mk"
 

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Sat May 17 20:22:22 2014	(r266348)
+++ head/sys/conf/kmod.mk	Sat May 17 20:31:34 2014	(r266349)
@@ -65,15 +65,10 @@ KMODLOAD?=	/sbin/kldload
 KMODUNLOAD?=	/sbin/kldunload
 OBJCOPY?=	objcopy
 
-# Note: we're really bsd.kmod.mk, so we have to allow src.opts.mk to be
-# optional. Include it if we can so we can get /etc/src.conf changes,
-# if we're in the tree. If we can't include it that's OK. kern.opts.mk
-# has all the kernel options in it, and should be included after src.opts.mk
-# so it picks everything up.
-.sinclude <src.opts.mk>
+# Grab all the options for a kernel build.
+.include "kern.opts.mk"
 .include <bsd.init.mk>
 .include <bsd.compiler.mk>
-.include "kern.opts.mk"
 
 .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405172031.s4HKVY51073386>