Subject: toolchain/17655: DESTDIR in the environment/command line overwritten by mk.conf
To: None <>
From: None <>
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
>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
>Originator:     Xavier HUMBERT
>Release:        NetBSD 1.6D
System: NetBSD 1.6D NetBSD 1.6D (XAVIER) #19: Sun Jul 7 17:21:24 CEST 2002 i386
Architecture: i386
Machine: i386
	Problem wery well described by Jaromir Dolecek <> in post
	<> on tech-toolchain
1. 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 <> is read;
this includes pulling in <> and thus your /etc/mk.conf
4. your /etc/mk.conf had
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

	cd /usr/src && ./ -D /
	Installs binaries, Include files, etc. in /usr/build
	Comment out DESTDIR in /etc/mk.conf, or replace it by DESTDIR ?= /usr/build
	Better, make pass the value of -D flage to make on its command line,
	instead putting in the environment.

	***** ANYWAY, document it :-) *****