Subject: pkg/18485: aperture does not build if src is not in /usr/src
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jmmv@hispabsd.org>
List: netbsd-bugs
Date: 10/01/2002 13:00:53
>Number:         18485
>Category:       pkg
>Synopsis:       aperture does not build if src is not in /usr/src
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 01 03:57:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6H
>Organization:
HispaBSD
>Environment:
	
	
System: NetBSD darkstar.local 1.6H NetBSD 1.6H (DARKSTAR) #0: Sat Sep 28 19:58:50 CEST 2002 jmmv@darkstar.local:/var/build/kernel/DARKSTAR i386
Architecture: i386
Machine: i386
>Description:
	My source tree is in /s/src, instead of /usr/src. I've
	    BSDSRCDIR=/s/src
	in my mk.conf to get things work properly, but sysutils/aperture
	does not build with this setup.

	If I link /s/src to /usr/src, the build does not break, and it
	effectively uses the /s/src directory. Although, there is some step
	during the build that tries to use /usr/src.

	I've been investigating and found the problem. The $S variable is
	defined in the top Makefile.inc. When this file is read, mk.conf
	has not been readed yet (see bsd.init.mk), so BSDSRCDIR takes the
	default value /usr/src.

>How-To-Repeat:
	Just move your src tree to somewhere else, set BSDSRCDIR in your
	mk.conf accordingly, remove /usr/src (if you have any link) and
	then try to build aperture. It will fail in `depend ===> module'.
>Fix:
	This fixes the problem for me (adding these two lines, we pass
	the real value of BSDSRCDIR to make's environment, and is used
	without needing to read any file):

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/aperture/Makefile,v
retrieving revision 1.22
diff -u -u -r1.22 Makefile
--- Makefile	2002/09/15 19:25:38	1.22
+++ Makefile	2002/10/01 10:50:54
@@ -37,6 +37,8 @@
 BSDSRCDIR?=	/nonexistent	# to override <bsd.own.mk>, MUST be
                                 # set this way BEFORE bsd.prefs.mk
 
+MAKE_ENV+=	BSDSRCDIR=${BSDSRCDIR}
+
 .include "../../mk/bsd.prefs.mk"
 
 pre-extract:



>Release-Note:
>Audit-Trail:
>Unformatted: