Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jan 2007 22:29:46 +0800
From:      "Rong-en Fan" <grafan@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: how to determine if we are building lib32 in Makefile?
Message-ID:  <6eb82e0701280629jcbcfb82if73da80d8b3c421d@mail.gmail.com>
In-Reply-To: <6eb82e0701271136n5538792eu31f464414e7dbaae@mail.gmail.com>
References:  <6eb82e0701271136n5538792eu31f464414e7dbaae@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/28/07, Rong-en Fan <grafan@gmail.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6eb82e0701280629jcbcfb82if73da80d8b3c421d>