tech-pkg archive

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

Re: TOOL_DEPENDS vs. BUILD_DEPENDS



Thomas Klausner <wiz%NetBSD.org@localhost> writes:

> Do I understand this correctly:

I think your assessment is correct.

[I have not tried cross in a while, and I should try again.  It looks
like Taylor has recently updated doc/HOWTO-use-crosscompile.  I remember
someone at bbn going on a cross rampage somewhere in the late 90s
building things for sun2 on i386.]

> TOOL_DEPENDS are programs that need to be run on the build system when
> building the package. So they must match the architecture of the
> system on which the package is built.

This is "--build" in autoconf speak, but the normal word might be host.

> BUILD_DEPENDS are dependencies that are only needed at build time, but
> must match the architecture of the target system (not the build system).

This is "--host" in autoconf speak, I think, but the normal word is target.

Agreed, although there is no theoretical reason why a given package
could not be needed both as TOOL and BUILD.

Also, I haven't had enough coffee to try to think about this fully in a
Canadian cross situation.  But, I think what the package *does* is not
relevant, so target being host (normal) or something else, doesn't enter
into TOOL/BUILD.

> I think pkgsrc mostly uses BUILD_DEPENDS since cross-building was only
> added later and before that, there was no difference between the too.

That seems plausible.

And, I would say USE_TOOLS is a combination of TOOL_DEPENDS and "turn on
glue and/or behavior change for this particular tool".  If that's not
true, then we should fix it, and if not I should become unconfused :-)

> In general, most BUILD_DEPENDS should probably be TOOL_DEPENDS
> instead. I can't think of a good example for a BUILD_DEPENDS, but
> there must be one, somewhere :)

If there is static linking, then needing something to link against and
not at runtime fits.

> Can someone think of tests that could be added to pkglint for this?

I don't immediately see how to test for this at the source level.  The
same code in Makefile could be right or wrong depending on what the
package's build system (plus manual targets in Makefile) eventually does.
I would think a cross pbulk would result in failures, and maybe a "wrong
arch" error code could be detected to make a report.

Your articulation of TOOL_DEPENDS leads me to see another problem: The
TOOL_DEPENDS needs to be a "--build" package, so with respect to the
--host (aka target) bootstrap, it does not belong.

So, we need a way for a cross pkg environment to refer to another
environment which has TOOL packages, and in which TOOL packages can be
built on demand.

I am curious what the experience is of people trying to cross-build now.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index