Gentoo Development Guide

MULTILIB-BUILD.ECLASS

Section: portage (5)
Updated: Apr 2014
Index Return to Main Contents
 

NAME

multilib-build.eclass - flags and utility functions for building multilib packages  

DESCRIPTION

The multilib-build.eclass exports USE flags and utility functions necessary to build packages for multilib in a clean and uniform manner.

Please note that dependency specifications for multilib-capable dependencies shall use the USE dependency string in ${MULTILIB_USEDEP} to properly request multilib enabled.  

FUNCTIONS

multilib_get_enabled_abis
Return the ordered list of enabled ABIs if multilib builds are enabled. The best (most preferred) ABI will come last.

If multilib is disabled, the default ABI will be returned in order to enforce consistent testing with multilib code.

multilib_foreach_abi <argv>...
If multilib support is enabled, sets the toolchain up for each supported ABI along with the ABI variable and correct BUILD_DIR, and runs the given commands with them.

If multilib support is disabled, it just runs the commands. No setup is done.

multilib_parallel_foreach_abi <argv>...
If multilib support is enabled, sets the toolchain up for each supported ABI along with the ABI variable and correct BUILD_DIR, and runs the given commands with them. The commands are run in parallel with number of jobs being determined from MAKEOPTS.

If multilib support is disabled, it just runs the commands. No setup is done.

Useful for running configure scripts.

multilib_for_best_abi <argv>...
Runs the given command with setup for the 'best' (usually native) ABI.
multilib_check_headers
Check whether the header files are consistent between ABIs.

This function needs to be called after each ABI's installation phase. It obtains the header file checksums and compares them with previous runs (if any). Dies if header files differ.

multilib_copy_sources
Create a single copy of the package sources for each enabled ABI.

The sources are always copied from initial BUILD_DIR (or S if unset) to ABI-specific build directory matching BUILD_DIR used by multilib_foreach_abi().

multilib_prepare_wrappers [<install-root>]
Perform the preparation of all kinds of wrappers for the current ABI. This function shall be called once per each ABI, after installing the files to be wrapped.

Takes an optional custom <install-root> from which files will be used. If no root is specified, uses ${ED}.

The files to be wrapped are specified using separate variables, e.g. MULTILIB_WRAPPED_HEADERS. Those variables shall not be changed between the successive calls to multilib_prepare_wrappers and multilib_install_wrappers.

After all wrappers are prepared, multilib_install_wrappers shall be called to commit them to the installation tree.

multilib_install_wrappers [<install-root>]
Install the previously-prepared wrappers. This function shall be called once, after all wrappers were prepared.

Takes an optional custom <install-root> to which the wrappers will be installed. If no root is specified, uses ${ED}. There is no need to use the same root as when preparing the wrappers.

The files to be wrapped are specified using separate variables, e.g. MULTILIB_WRAPPED_HEADERS. Those variables shall not be changed between the calls to multilib_prepare_wrappers and multilib_install_wrappers.

multilib_is_native_abi
Determine whether the currently built ABI is the profile native. Return true status (0) if that is true, otherwise false (1).

This function is not intended to be used directly. Please use multilib_build_binaries instead.

multilib_build_binaries
Determine whether to build binaries for the currently built ABI. Returns true status (0) if the currently built ABI is the profile native or COMPLETE_MULTILIB variable is set to 'yes', otherwise false (1).

This is often useful for configure calls when some of the options are supposed to be disabled for multilib ABIs (like those used for executables only).

 

ECLASS VARIABLES

MULTILIB_USEDEP
The USE-dependency to be used on dependencies (libraries) needing to support multilib as well.

Example use:

RDEPEND="dev-libs/libfoo[${MULTILIB_USEDEP}]
net-libs/libbar[ssl,${MULTILIB_USEDEP}]"
MULTILIB_WRAPPED_HEADERS
A list of headers to wrap for multilib support. The listed headers will be moved to a non-standard location and replaced with a file including them conditionally to current ABI.

This variable has to be a bash array. Paths shall be relative to installation root (${ED}), and name regular files. Recursive wrapping is not supported.

Please note that header wrapping is *discouraged*. It is preferred to install all headers in a subdirectory of libdir and use pkg-config to locate the headers. Some C preprocessors will not work with wrapped headers.

Example:

MULTILIB_WRAPPED_HEADERS=(
/usr/include/foobar/config.h
)
MULTILIB_CHOST_TOOLS
A list of tool executables to preserve for each multilib ABI. The listed executables will be renamed to ${CHOST}-${basename}, and the native variant will be symlinked to the generic name.

This variable has to be a bash array. Paths shall be relative to installation root (${ED}), and name regular files or symbolic links to regular files. Recursive wrapping is not supported.

If symbolic link is passed, both symlink path and symlink target will be changed. As a result, the symlink target is expected to be wrapped as well (either by listing in MULTILIB_CHOST_TOOLS or externally).

Please note that tool wrapping is *discouraged*. It is preferred to install pkg-config files for each ABI, and require reverse dependencies to use that.

Packages that search for tools properly (e.g. using AC_PATH_TOOL macro) will find the wrapper executables automatically. Other packages will need explicit override of tool paths.

Example:

MULTILIB_CHOST_TOOLS=(
/usr/bin/foo-config
)
 

AUTHORS

Author: Michał Górny <mgorny@gentoo.org>
 

MAINTAINERS

gx86-multilib team <multilib@gentoo.org>
 

REPORTING BUGS

Please report bugs via http://bugs.gentoo.org/  

FILES

/usr/portage/eclass/multilib-build.eclass  

SEE ALSO

ebuild(5)
http://sources.gentoo.org/eclass/multilib-build.eclass?view=log


 

Index

NAME
DESCRIPTION
FUNCTIONS
ECLASS VARIABLES
AUTHORS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:25:14 GMT, April 18, 2014