Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2012 21:07:28 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r237207 - stable/7/sys/conf
Message-ID:  <201206172107.q5HL7SQj032752@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dougb
Date: Sun Jun 17 21:07:27 2012
New Revision: 237207
URL: http://svn.freebsd.org/changeset/base/237207

Log:
  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@gmail.com>

Modified:
  stable/7/sys/conf/kern.post.mk
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/conf/kern.post.mk
==============================================================================
--- stable/7/sys/conf/kern.post.mk	Sun Jun 17 21:07:00 2012	(r237206)
+++ stable/7/sys/conf/kern.post.mk	Sun Jun 17 21:07:27 2012	(r237207)
@@ -28,9 +28,30 @@ modules-${target}:
 .endif
 .endfor
 
-# Handle out of tree ports 
+# Handle ports (as defined by the user) that build kernel modules
 .if !defined(NO_MODULES) && defined(PORTS_MODULES)
-PORTSMODULESENV=SYSDIR=${SYSDIR}
+#
+# 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}/"
+.endif
+# 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
+.endif
+# Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build
+WRKDIRPREFIX?=	${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF}
+PORTSMODULESENV=\
+	PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \
+	SRC_BASE=${SRC_BASE} \
+	OSVERSION=${OSRELDATE} \
+	WRKDIRPREFIX=${WRKDIRPREFIX}
 .for __target in all install reinstall clean
 ${__target}: ports-${__target}
 ports-${__target}:



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