Subject: Re: misc/9986: make fails in src/games/phantasia with 1.4X userland and DESTDIR
To: None <konishi@hauN.org>
From: Julian Coleman <J.D.Coleman@newcastle.ac.uk>
List: tech-userlevel
Date: 04/29/2000 18:58:09
konishi@hauN.org wrote:
> 	make fails in src/games/phantasia with DESTDIR, 
> 	because DESTDIR does not work.
> 
> >How-To-Repeat:
> 	(1) /usr/include/wchar.h does not exist in Mar-16 userland 
> 	(2) cd /usr/src/games/phantasia
> 	(3) make DESTDIR=somewhere dependall
> 
> then get following result
> 
> # make DESTDIR=/export/NetBSD-current/root/20000426 dependall
> cc -O  -c -o host_phantglobs.o /usr/src/games/phantasia/phantglobs.c
> In file included from /usr/src/games/phantasia/include.h:8,
>                  from /usr/src/games/phantasia/phantglobs.c:7:
> /usr/include/curses.h:43: wchar.h: No such file or directory

I looked at this because I thought it was a curses bug.  However, the
problem is that compiling phantglobs.c (and setup.c) uses :

> host_phantglobs.o: ${.CURDIR}/phantglobs.c
> 	${HOST_COMPILE.c} -o host_phantglobs.o ${.CURDIR}/phantglobs.c

This results in :

> cc -O  -c -o host_phantglobs.o /usr/src/games/phantasia/phantglobs.c

while the other files are compiled as :

> cc -O2 -nostdinc -idirafter ${DESTDIR}/usr/include -c /usr/src/games/phantasia/gamesupport.c

etc.  I guess the fix is to add the DESTDIR additions to the HOST_COMPILE.c
in bsd.sys.mk :

--- /usr/share/mk/bsd.sys.mk-	Sat Feb  5 17:49:57 2000
+++ /usr/share/mk/bsd.sys.mk	Sat Apr 29 18:50:29 2000
@@ -18,6 +18,7 @@
 
 .if defined(DESTDIR)
 CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
+HOST_CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
 LINTFLAGS+= -d ${DESTDIR}/usr/include
 .endif

Should HOST_LDFLAGS also be changed (to have -nostdlib -L${DESTDIR}/usr/lib)?

J

-- 
                    My other computer also runs NetBSD
                          http://www.netbsd.org/