Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 May 2014 21:11:27 +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: r265785 - in head: share/mk sys/conf
Message-ID:  <201405092111.s49LBRMm079402@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri May  9 21:11:27 2014
New Revision: 265785
URL: http://svnweb.freebsd.org/changeset/base/265785

Log:
  Introduce kern.opts.mk to hold all the options for kernel module
  builds. Include this in the right places. Make src.opts.mk optional so
  that modules can be built outside of the tree in the ports system.
  
  PR: 189520

Added:
  head/sys/conf/kern.opts.mk   (contents, props changed)
Modified:
  head/share/mk/src.opts.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/src.opts.mk
==============================================================================
--- head/share/mk/src.opts.mk	Fri May  9 19:14:34 2014	(r265784)
+++ head/share/mk/src.opts.mk	Fri May  9 21:11:27 2014	(r265785)
@@ -24,7 +24,7 @@
 #
 # Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
 # exception is made for _WITHOUT_SRCONF which turns off this mechanism
-# completely).
+# completely inside bsd.*.mk files).
 #
 
 .if !target(__<src.opts.mk>__)
@@ -84,7 +84,6 @@ __DEFAULT_YES_OPTIONS = \
     FDT \
     FLOPPY \
     FMTREE \
-    FORMAT_EXTENSIONS \
     FORTH \
     FP_LIBC \
     FREEBSD_UPDATE \
@@ -105,7 +104,6 @@ __DEFAULT_YES_OPTIONS = \
     IPFW \
     JAIL \
     KDUMP \
-    KERNEL_SYMBOLS \
     KVM \
     LDNS \
     LDNS_UTILS \

Added: head/sys/conf/kern.opts.mk
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/conf/kern.opts.mk	Fri May  9 21:11:27 2014	(r265785)
@@ -0,0 +1,24 @@
+# $FreeBSD$
+
+# Options set in the build system that affect the kernel somehow.
+
+#
+# Define MK_* variables (which are either "yes" or "no") for users
+# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
+# make(1) environment.
+# These should be tested with `== "no"' or `!= "no"' in makefiles.
+# The NO_* variables should only be set by makefiles for variables
+# that haven't been converted over.
+#
+
+# 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 = \
+    FORMAT_EXTENTIONS \
+    KERNEL_SYMBOLS
+
+__DEFAULT_NO_OPTIONS = \
+
+.include "../../share/mk/bsd.mkopt.mk"

Modified: head/sys/conf/kern.pre.mk
==============================================================================
--- head/sys/conf/kern.pre.mk	Fri May  9 19:14:34 2014	(r265784)
+++ head/sys/conf/kern.pre.mk	Fri May  9 21:11:27 2014	(r265785)
@@ -5,6 +5,7 @@
 
 .include <src.opts.mk>
 .include <bsd.compiler.mk>
+.include "kern.opts.mk"
 
 # backwards compat option for older systems.
 MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Fri May  9 19:14:34 2014	(r265784)
+++ head/sys/conf/kmod.mk	Fri May  9 21:11:27 2014	(r265785)
@@ -72,9 +72,15 @@ OBJCOPY?=	objcopy
 .error "Do not use KMODDEPS on 5.0+; use MODULE_VERSION/MODULE_DEPEND"
 .endif
 
-.include <src.opts.mk>
+# 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>
 .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?201405092111.s49LBRMm079402>