From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 28 14:29:47 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9039716A403 for ; Sun, 28 Jan 2007 14:29:47 +0000 (UTC) (envelope-from grafan@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.227]) by mx1.freebsd.org (Postfix) with ESMTP id 532C513C491 for ; Sun, 28 Jan 2007 14:29:47 +0000 (UTC) (envelope-from grafan@gmail.com) Received: by nz-out-0506.google.com with SMTP id i11so1076047nzh for ; Sun, 28 Jan 2007 06:29:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=t3UsHyAGbGxdYOpkBjx8D2ezn6IQ6RDiyTlRPY3GGytwoh7L8RzNrHAQVqDLVPhbyoCYHlsH29kd5fRRSVWQp+OpukfxlGWAgVnepN0RcB+zIs2Y6wH+VuhH4OBnzEG/tvixi3n+pS1bklUCin8BVqvchox8NkjS5EEK9hU++HY= Received: by 10.114.205.1 with SMTP id c1mr206175wag.1169994586228; Sun, 28 Jan 2007 06:29:46 -0800 (PST) Received: by 10.114.111.17 with HTTP; Sun, 28 Jan 2007 06:29:46 -0800 (PST) Message-ID: <6eb82e0701280629jcbcfb82if73da80d8b3c421d@mail.gmail.com> Date: Sun, 28 Jan 2007 22:29:46 +0800 From: "Rong-en Fan" To: freebsd-hackers@freebsd.org In-Reply-To: <6eb82e0701271136n5538792eu31f464414e7dbaae@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <6eb82e0701271136n5538792eu31f464414e7dbaae@mail.gmail.com> Subject: Re: how to determine if we are building lib32 in Makefile? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2007 14:29:47 -0000 On 1/28/07, Rong-en Fan wrote: > I'm working on wide character support in base's ncurses. For some > reason, I have to make lib/ncurses/ncursesw to include ncurses.h from > its object directory. However, current lib32 uses something like > > cc ... -I${LIB32TMP}/usr/includes ... -IFROM_NCURSES_MAKEFILE ... > > Right now, I have the following: > > .if ${.TARGET} == "installincludes" && !empty(${DESTDIR:M*/lib32/*}) > INCS= ${HEADERS} ${SRCHDRS} > INCSLINKS= curses.h ${INCLUDEDIR}/ncurses.h > .endif > > It works, but it's really ugly. Is there any other way to do this? Oops, it's wrong. Now I have "-DWORLD32" in LIB32MAKE and the following lines in lib/ncurses/Makefile .if !defined(WORLD32) INCS= ${HEADERS} ${SRCHDRS} INCSLINKS= curses.h ${INCLUDEDIR}/ncurses.h .endif While make universe is still running, but I have amd64, i386, pc98 work and on my -current i386 box. The resulting world works well (tested by mutt). I'm not sure if this is the best way to handle this. I noticed that Dragonfly has something like # include files are not installed when building bootstrap programs .if !defined(BOOTSTRAPPING) realinstall: installincludes .ORDER: beforeinstall installincludes .endif in bsd.incs.mk. For ncurses, since the include path for 32-bit includes are specified in LIB32POSTFLAGS, which is part of ${CC}. When building ncurses + ncursesw, I need different versions of ncurses.h (for runtime, it is not the case).The only way to get them build in lib32 is NOT to install ncurses.h in lib32/usr/include. Any comments or suggestions are welcome :) Regards, Rong-En Fan