From owner-freebsd-current@FreeBSD.ORG Sat Jun 9 23:52:04 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 6CCC0106566C; Sat, 9 Jun 2012 23:52:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id A404A16143C; Sat, 9 Jun 2012 23:51:42 +0000 (UTC) Message-ID: <4FD3E18E.2000708@FreeBSD.org> Date: Sat, 09 Jun 2012 16:51:42 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120609 Thunderbird/13.0 MIME-Version: 1.0 To: Garrett Cooper References: <4FD384B5.3050709@FreeBSD.org> <4FD38A71.8070601@infracaninophile.co.uk> <4FD39099.3000208@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------010106090709050304050503" Cc: Chris Rees , Matthew Seaman , freebsd-current Subject: Re: PORTS_MODULES fix X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 23:52:04 -0000 This is a multi-part message in MIME format. --------------010106090709050304050503 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Ok, never mind the last one ... this patch I've actually tested. :) Doug -- This .signature sanitized for your protection --------------010106090709050304050503 Content-Type: text/plain; charset=UTF-8; name="kern.post.mk.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kern.post.mk.diff" Index: kern.post.mk =================================================================== --- kern.post.mk (revision 236818) +++ kern.post.mk (working copy) @@ -36,9 +36,30 @@ .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}: --------------010106090709050304050503--