Skip to content

Autobuild3 Architectural Manipulation

Mingye Wang edited this page Apr 21, 2016 · 9 revisions

Architectural Manipulation

Autobuild3 is able to deal with multiple architectures. Meaning that one can write configurations for multiple architectures in one autobuild/ directory.

This section discusses multiple ways one may use Autobuild3 to write build configurations for different architectures.

Using architecture sub-directories

Autobuild3 defines all supported architectures in "$AB"/arch/, scripts like mipsel.sh is definitions for the mipsel architecture. An autobuild/ directory with special configurations for mipsel may be presented like below.

$ find `autobuild/`

autobuild/
autobuild/defines
autobuild/mipsel
autobuild/mipsel/defines

Where autobuild/defines is presented like below.

PKGNAME=foo
PKGVER=1.2.2
PKGSEC=libs
PKGDEP="gcc-runtime"
BUILDDEP="graphviz"
PKGDES="Example victim"

In the example above, foo will require graphviz to build, which has a huge dependency set. A packager may not want graphviz to be one of the build dependencies on mipsel, and he/she may write in autobuild/mipsel/defines that:

BUILDDEP=""

Or if the packager would want doxygen as an extra build dependency on mipsel, he/she may write in autobuild/mipsel/defines that:

BUILDDEP+=" doxygen"

The defines file in architecture sub-directories are sourced after the common defines. Other files in architecture sub-directories will replace the common files if found; The overrides and patches directories in the architecture sub-directories will merge with the common directories.

Using Shell declarations

For packagers that prefer not to use the sub-directories, simple Shell syntaxes may be used as well. Architectures are declared by Autobuild3 according to the packager's configurations in /etc/autobuild/defaults, in the $ARCH variable (we endorse, in fact, we require for all AOSC official trees to use ${CROSS:-$ARCH} for cross compiling support).

So a example autobuild/defines file may be presented like below, using the example from the "Using architecture sub-directories" section above.

PKGNAME=foo
PKGVER=1.2.2
PKGSEC=libs
PKGDEP="gcc-runtime"
BUILDDEP="graphviz"
# TODO: replace with single $ABHOST var.
[ "${CROSS:-$ARCH}" = "mipsel" ] && BUILDDEP=""
[[ "${CROSS:-$ARCH}" = *64* ]] && BUILDDEP+=" doxygen"
PKGDES="Example victim"

Note that when using glob matching, you would need to use double bracket, and there should not be quotes around the glob declaration (just general Bash syntax requirement, bring your own book).

Clone this wiki locally