tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: buildlink3.mk create



On Tue, Sep 23, 2008 at 06:11:21AM -0700, kamel derouiche wrote:
> Hi,,
> 
> What are the condition for which we create 
> buildlink3.mk file. is it for the API content?, or
> because of the package number that depend for this
> file "buildlink3.mk" is increase 

The buildlink framework was created to isolate packages from the host
system environment while they were built.  One essential requirement for
a packaging system such as pkgsrc is to make reproductible builds, which
means we have to be in control of the environment during the build (and
notably, during the configuration step, as tools such as autoconf will
try to infer the build options from the environment in a lot of cases).

During compilation you need include files, libraries and so on.  The
buildlink framework will make symlinks of the files a package actually
depends on (hence the name) and then change the compiler options and
paths so that we are sure what environment the package sees.

The way of triggering the buildlink framework for a given dependency of
a package is to include the dependency's buildlink3.mk file.  In the old
days (or for purely run-time dependencies), you would just add a line in
the package Makefile (DEPENDS+= ...).  That doesn't work anymore
nowadays because the files from the dependency that are necessary during
the build don't get "buildlinked".

Most of the time you will want to create a buildlink3.mk file to allow
other packages to depend on it.  Exceptions are pure run-time
dependencies or things that are not part of the buildlink framework yet.
For instance, there is no infrastructure in buildlink3 to deal with PERL
modules, so that you have to construct your dependency list with
DEPENDS+= lines, but you have to be careful because the Makefile.PL of a
module might pick up dependencies that are not registered in the pkgsrc
pacakges.  (That would be a neat project, btw.)

-- 
Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost
"See the look on my face from staying too long in one place
[...] every time the morning breaks I know I'm closer to falling"
KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

Attachment: pgpdGGi_Yu3Oo.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index