Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jul 2015 05:43:46 +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: r285124 - head/sys/conf
Message-ID:  <201507040543.t645hkAF010201@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sat Jul  4 05:43:45 2015
New Revision: 285124
URL: https://svnweb.freebsd.org/changeset/base/285124

Log:
  Cache _MPATH and pass it down into the modules build. Some NFS setups
  make the find it does extremely expensive, so compute it only
  once. Also make sure the 'traditional' module building method works at
  the expense of a bit of duplicated code.

Modified:
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kern.pre.mk
==============================================================================
--- head/sys/conf/kern.pre.mk	Sat Jul  4 03:15:42 2015	(r285123)
+++ head/sys/conf/kern.pre.mk	Sat Jul  4 05:43:45 2015	(r285124)
@@ -198,6 +198,12 @@ SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symb
 	${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}
 SYSTEM_DEP+= ${LDSCRIPT}
 
+# Calculate path for .m files early, if needed.
+.if !defined(_MPATH)
+__MPATH!=find ${S:tA}/ -name \*_if.m
+_MPATH=${__MPATH:H:O:u}
+.endif
+
 # MKMODULESENV is set here so that port makefiles can augment
 # them.
 
@@ -214,6 +220,7 @@ MKMODULESENV+=	MODULES_OVERRIDE="${MODUL
 .if defined(DEBUG)
 MKMODULESENV+=	DEBUG_FLAGS="${DEBUG}"
 .endif
+MKMODULESENV+=	_MPATH="${_MPATH}"
 
 # Detect kernel config options that force stack frames to be turned on.
 DDB_ENABLED!=	grep DDB opt_ddb.h || true ; echo

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Sat Jul  4 03:15:42 2015	(r285123)
+++ head/sys/conf/kmod.mk	Sat Jul  4 05:43:45 2015	(r285124)
@@ -355,8 +355,10 @@ vnode_if_typedef.h:
 .endif
 
 # Build _if.[ch] from _if.m, and clean them when we're done.
+.if !defined(_MPATH)
 __MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
 _MPATH=${__MPATH:H:O:u}
+.endif
 .PATH.m: ${_MPATH}
 .for _s in ${SRCS:M*_if.[ch]}
 .if eixsts(${_s:R}.m})



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