Subject: toolchain/18247: bsd.sys.mk doesn't support C++ includes when DESTDIR set
To: None <gnats-bugs@gnats.netbsd.org>
From: None <Andrew.E.White@motorola.com>
List: netbsd-bugs
Date: 09/09/2002 19:24:51
>Number:         18247
>Category:       toolchain
>Synopsis:       bsd.sys.mk doesn't support C++ includes when DESTDIR set
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 09 19:25:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew White
>Release:        1.5.3
>Organization:
MARC
>Environment:
NetBSD thor 1.5.3 NetBSD 1.5.3 (GENERIC) #0: Tue Aug 27 17:42:36 EST 2002     awhite@thor:/usr/src/sys/usr/src/sys/arch/i386/compile/GENERIC i386
>Description:
From /usr/share/mk/bsd.sys.mk:

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

Notably missing from this is the C++ include directory, /usr/include/g++.  Thus, C++ programs will break on mkdep or compile once DESTDIR is set.
>How-To-Repeat:
Compile a C++ program using the toolchain when DESTDIR is set.
>Fix:
Add -idirafter $DESTDIR/usr/include/g++ to CPPFLAGS
Add -d ${DESTDIR}/usr/include/g++ to LINTFLAGS

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