svn commit: r237206 - stable/8/sys/conf

Doug Barton dougb at
Sun Jun 17 21:07:01 UTC 2012

Author: dougb
Date: Sun Jun 17 21:07:00 2012
New Revision: 237206

  Improve the functionality of the PORTS_MODULES knob by adding
  LOCALBASE/bin and sbin to PATH, which allows dependencies to be found;
  adding SRC_BASE and OSVERSION to match the new kernel, and putting the
  related builds under MAKEOBJDIRPREFIX so that they only need to be built
  once per kernel.
  In addition to the PR this includes ideas/contributions from crees
  and matthew.
  PR:		ports/161452
  Submitted by:	Garrett Cooper <yanegomi at>

Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/conf/
--- stable/8/sys/conf/	Sun Jun 17 21:06:36 2012	(r237205)
+++ stable/8/sys/conf/	Sun Jun 17 21:07:00 2012	(r237206)
@@ -28,9 +28,30 @@ modules-${target}:
-# Handle out of tree ports 
+# Handle ports (as defined by the user) that build kernel modules
 .if !defined(NO_MODULES) && defined(PORTS_MODULES)
+# The ports tree needs some environment variables defined to match the new kernel
+# Ports search for some dependencies in PATH, so add the location of the installed files
+LOCALBASE?=	/usr/local
+# SRC_BASE is how the ports tree refers to the location of the base source files
+.if !defined(SRC_BASE)
+SRC_BASE!=	realpath "${SYSDIR:H}/"
+# OSVERSION is used by some ports to determine build options
+.if !defined(OSRELDATE)
+# Definition copied from src/Makefile.inc1
+OSRELDATE!=	awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
+		    ${MAKEOBJDIRPREFIX}${SRC_BASE}/include/osreldate.h
+# Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build
 .for __target in all install reinstall clean
 ${__target}: ports-${__target}

More information about the svn-src-stable-8 mailing list