Subject: toolchain/17655: DESTDIR in the environment/command line overwritten by mk.conf
To: None <gnats-bugs@gnats.netbsd.org>
From: None <xavier@xavhome.fr.eu.org>
List: netbsd-bugs
Date: 07/20/2002 00:55:43
>Number: 17655
>Category: toolchain
>Synopsis: When DESTDIR is set in /etc/mk.conf, it overwrites what's in -D switch of build.sh
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: toolchain-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Jul 19 15:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Xavier HUMBERT
>Release: NetBSD 1.6D
>Organization:
>Environment:
System: NetBSD arnor.xavhome.fr.eu.org 1.6D NetBSD 1.6D (XAVIER) #19: Sun Jul 7 17:21:24 CEST 2002 root@arnor.xavhome.fr.eu.org:/usr/src/sys/arch/i386/compile/XAVIER i386
Architecture: i386
Machine: i386
>Description:
Problem wery well described by Jaromir Dolecek <jdolecek@netbsd.org> in post
<200207191943.g6JJhUH02747@s102-n054.tele2.cz> on tech-toolchain
1. build.sh sets environment variable DESTDIR to what was specified by -D
2. DESTDIR is passed with other environ to spawned make(1), which
sets it's own make DESTDIR accordingly
3. when a program directory is entered, it's <bsd.foo.mk> is read;
this includes pulling in <bsd.own.mk> and thus your /etc/mk.conf
4. your /etc/mk.conf had
DESTDIR=/usr/build
i.e. it inconditionally overrode any previous setting
5. for rest of processing (compiling, installing, whatever), make(1)'s
DESTDIR was set to /usr/build
>How-To-Repeat:
cd /usr/src && ./build.sh -D /
Installs binaries, Include files, etc. in /usr/build
>Fix:
Comment out DESTDIR in /etc/mk.conf, or replace it by DESTDIR ?= /usr/build
Better, make build.sh pass the value of -D flage to make on its command line,
instead putting in the environment.
***** ANYWAY, document it :-) *****
Thanks
Regards,
--
Xavier
http://www.freetibet.org
http://www.tibet.fr/
.
>Release-Note:
>Audit-Trail:
>Unformatted: