Subject: bin/2134: CPPFLAGS broken if third-party Makefiles use DESTDIR
To: None <gnats-bugs@NetBSD.ORG>
From: Chris G. Demetriou <>
List: netbsd-bugs
Date: 02/26/1996 15:26:30
>Number:         2134
>Category:       bin
>Synopsis:       DESTDIR is bogusly used to set CPPFLAGS in
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 26 15:35:02 1996
>Originator:     Chris G. Demetriou
Kernel Hackers 'r' Us
>Release:        NetBSD-current, Feb. 26, 1996
System: NetBSD 1.1A NetBSD 1.1A (SUN_LAMP) #9: Fri Feb 23 14:38:42 EST 1996 i386

>Description: does:

	.if defined(DESTDIR)
	CPPFLAGS+=      -nostdinc -idirafter ${DESTDIR}/usr/include

	The problem is, some, if not many, third-party Makefiles use
	recursive makes and DESTDIR for their own purposes, and do NOT
	want those "special" changes to CPPFLAGS applied...

	Build a program which uses recursive invocations of 'make' and
	which sets DESTDIR on the command line (for whatever reason).
	(I ran into this problem while trying to build the AFS client

	As a quick example, try:

	(echo "#include <sys/types.h>"; echo "main() {}") > foo.c
	echo "foo: foo.c" > Makefile
	make DESTDIR=foobar
	Remove those three lines from  However, that would break
	functionality which some people like.

	Possibly do the CPPFLAGS set if defined(DESTDIR) in