To: Brook Milligan <>
From: Julio M. Merino Vidal <>
List: tech-pkg
Date: 08/05/2006 18:36:38
On 8/5/06, Brook Milligan <> wrote:
> I am trying to make some packages that need to rely on the make
> variable BUILDLINK_PREFIX.<pkg>.  For example, one depends on
> x11/qt3-libs and needs the value of $QTDIR (which is set in
> x11/qt3-libs/  The file mk/buildlink3/
> includes the following:
> # Note that if a file is included, then the package Makefile
> # has the expectation that it can use the value of BUILDLINK_PREFIX.<pkg>.
> # If the tries to handle dependencies satisfied directly by
> # the base system, then it should provide an appropriate value for
> # BUILDLINK_PREFIX.<pkg> for that case.  The case where a dependency is
> # satisfied by a pkgsrc-installed package is handled automatically by this
> # file.
> This implies to me that the following commands should produce
> something useful (in a package that includes
> x11/qt3-libs/
>         make show-var VARNAME=BUILDLINK_PREFIX.qt3

That should be BUILDLINK_PREFIX.qt3-libs.  But anyway, see below.

>         make show-var VARNAME=QTDIR
> However, with the 2006Q2 version of pkgsrc, both commands produce
> blank lines.  So does the command
>         cd devel/bison && make show-var VARNAME=BUILDLINK_PREFIX.gettext-lib
> which suggests that this does not depend on something specific to my
> package.
> I must be missing something or misunderstanding the use of
> $BUILDLINK_PREFIX.<pkg> or 'make show-var'.  Any help is greatly
> appreciated.

Up to 2006Q2, pkgsrc separated the different build stages of a package
to optimize makefile parse times; these stages are called phases.  (If
I'm not wrong, this is gone from pkgsrc-current in favour of

The buildlink stuff is only used in some phases of the package; for
example, it's useless during the fetch, so it can be omitted at parse
time to speed up make runs.  Therefore, in order to get the
appropriate values for those variables, you need to specify the phase
in which they are meaningful.  For example:

    make show-var VARNAME=BUILDLINK_PREFIX.qt3-libs PKG_PHASE=configure

Hope this helps,

Julio M. Merino Vidal <>
The Julipedia -