1 Dec 2011 05:06
Ports cross-compilation
I've been tinkering with ports cross-compilation for a couple of days
and decided to summarize this experience. It might start some
discussion, or, with any luck, some action.
I had embedded platforms on my mind and for this use-case we do not
need all the ports to be cross-compilable. What we need is set of tools
to make cross-compilation possible and with these tols porters can start
adopting existing ports and explicitly marking them as cross-compilable.
With this objective I started to add hacks to ports/Mk and tried to
create several generic applications. Here is what I have discovered
so far:
- xdev-generated compilers can be used as toolchains for ports
cross-compilation. Some adaptation are required due to different
platform naming in GNU configure (e.g. mips64eb vs mips64)
- Ports lack "buildroot" notion. There is no distinction between TARGET
directory and PREFIX. Target directory is always assumed to be root
directory. DESTDIR knob tries to fix this but it's more of a shortcut
than proper solution - it just places installation process in chrooted
environment leaving it agnostic of real target directory
- Dependencies should be split in two groups: host dependencies (build
tools) and target dependencies (libraries)
- Package builder works only on installed port. It allows some ports to
make no distinction between two steps: (a) generate files tree for
packaging and (b) generate files during installation. e.g.
pre-compiling function files for shells/zsh: port tries to do it as
(Continue reading)
RSS Feed