Cross-building pkgsrc

From NetBSD Wiki

Jump to: navigation, search
You are encouraged to extend this page. Please help us by adding your own ideas. :)

Contents

How could I try it?

You can enable cross compiling by putting something like this into your [mk.conf]:

USE_DESTDIR = full
DEPENDS_TARGET = package-install

CROSS_DESTDIR = /usr/current/obj/destdir.i386
TOOLDIR = /usr/current/tools                                                      
USE_CROSS_COMPILE= yes

In case of NetBSD, you can build the target arch's destdir and tools with build.sh.

Please share you ideas about cross pkgsrc, if you have any.

Replaced's ideas

Slow, but lovely

I'd like to cross compile packages for my AlphaStations. First, I'm trying to make compiles between different i386 versions of NetBSD, and after that the more interesting i386->alpha.

I don't have heavy iron for the bulk builds, but I will handle it somehow. :)

Other platforms

I'd like to experiment with other platforms as well, like Linux, FreeBSD, OSF1.

Recommendations

Build and report. Often.

Rillig's ideas

I want to build packages for SunOS-5.10-sparc (Host) on my NetBSD-4.99.30-i386 (Build) machine. I chose exactly this combination because I have access to both, they are different operating systems, different machine architectures with different endianness.

Considerations

  • It is not possible to run programs on the Host. This is especially important for GNU-style configure scripts.

Requirements

I need at least the following directories:

  • /cross/host/SunOS-5.10-sparc (ro): The filesystem for the SunOS machine.
  • /cross/host/SunOS-5.10-sparc/usr/pkg (rw): The binary packages will be installed here.
  • /cross/build/NetBSD-4.99.30-i386/usr/pkg (rw): The packages that are needed for building other packages will be installed here.
  • /cross/pkgsrc (ro): pkgsrc itself
Personal tools