Subject: Re: more builtin.mk questions
To: Dan Winship <danw@NetBSD.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 05/22/2004 12:16:28
On Sat, 22 May 2004, Dan Winship wrote:
> On May 22, 2004, at 1:58 PM, Jeremy C. Reed wrote:
> > I set PREFER.ncurses=pkgsrc but mk/buildlink3/bsd.builtin.mk has:
> >
> > .for _pkg_ in ${BUILDLINK_PACKAGES}
> > PREFER.${_pkg_}?= pkgsrc
> > . if !empty(PREFER_NATIVE:M[yY][eE][sS])
> > PREFER.${_pkg_}= native
> > . endif
> >
> > So it is immediately reset to native.
>
> Yeah, you're not supposed to set PREFER.foo yourself. You want to do:
> PREFER_PKGSRC+=ncurses
Why can we set PREFER.foo in our own mk.conf files? Usually we prefix
variables with "_" (underscore) to be private.
Please see my previous email about "how does devel/libgetopt/builtin.mk
work?". It said I had:
PREFER_NATIVE+= iconv
PREFER_NATIVE+= xpm
PREFER_NATIVE+= gettext
So now PREFER_NATIVE=yes is not set.
And then PREFER_NATIVE didn't include getopt so psmisc buildlinking
failed.
So if we can't define PREFER.foo then we have to remember to set
PREFER_NATIVE and PREFER_PKGSRC to every package needed. How can someone
easily know?
Jeremy C. Reed
technical support & remote administration
http://www.pugetsoundtechnology.com/