Cygport Reference Manual

### TABLE OF CONTENTS

- cross.cygclass

- CROSS_HOST
- CROSS_SYSROOT
- CROSS_PREFIX
- CROSS_BINDIR
- CROSS_INCLUDEDIR
- CROSS_LIBDIR
- CROSS_DATADIR
- doelflib
- cross_sysrootize
- cross_desysrootize

## cross.cygclass

[ Top ] [ Cygclasses ] [ Cygclasses ]

SYNOPSIS

      CROSS_HOST="..."
      inherit cross

DESCRIPTION

This cygclass assists in building libraries to be used by "cross-compilers", which generate code to be run on a different platform (the "host" system) then the one on which it was built (and, in most cases, NOT on the build system), but can be used on the build system to cross-compile other software which depends on it.

Supported build systems for cross-compiling are autotools, cmake, qmake, and custom Makefiles. When using cross.cygclass, cygconf, cygcmake, and cygqmake4 automatically use the necessary arguments for cross-compiling, and cyginstall and most of the do* and new* installation functions install into the sysroot instead of the native root. Note that those installation functions which accept an absolute path (dodir, exeinto, insinto, dosym) make no assumptions about the sysroot.

## CROSS_HOST

[ Top ] [ cross.cygclass ] [ Variables ]

DESCRIPTION

The CPU-VENDOR-OS[-TOOLCHAIN] triplet, or customary abbreviation thereof, describing the system for which you are cross-compiling; for example:

- i686-linux [i686-pc-linux-gnu]: i686 GNU/Linux
- x86_64-w64-mingw32: Win64
- arm-eabi [arm-unknown-eabi]: Embedded ARM ELF system (e.g. with Newlib)
- avr [avr-unknown-none]: Atmel AVR bare metal (e.g. Arduino)

Note that while 'unknown' vendor tags are often omitted, particularly in conjunction with a 'none' OS tag, as above, this does not apply to e.g. 'armv7hl-unknown-linux-gnueabi' and other systems.

NOTES

- CROSS_HOST must be defined before inherit()ing cross.cygclass.
- CROSS_HOST must match the prefix of the toolchain being used (in other words, the TOOLCHAIN_TARGET used for building said toolchain).

## CROSS_SYSROOT

[ Top ] [ cross.cygclass ] [ Definitions ]

DESCRIPTION

GCC cross-compilers provide the concept of a sysroot: a directory which acts as the virtual root of the target filesystem, resulting in CROSS_SYSROOT/$prefix/include and CROSS_SYSROOT/$prefix/lib being in the default search paths without requiring -I or -L flags.

This means that software natively compiled for the host system can be unpacked into the sysroot and used for cross-compiling. This is especially useful when bootstrapping a new toolchain; e.g. for Linux, one can just download glibc and kernel headers packages from a Linux distro, unpack them into the CROSS_SYSROOT, and use those to build a cross-GCC for the first time.

If you do use natively-compiled host packages under the sysroot, you must fix paths in all *-config scripts, .la libtool libraries, and .pc pkg-config files so they do not erroneously point to Cygwin-native headers and libraries.

## CROSS_PREFIX

[ Top ] [ cross.cygclass ] [ Definitions ]

DESCRIPTION

The $prefix directory under the sysroot. This definition is meant to be used in configure or cmake arguments to avoid dealing with different prefixes on various systems.

## CROSS_BINDIR

[ Top ] [ cross.cygclass ] [ Definitions ]

DESCRIPTION

The $prefix/bin directory under the sysroot. This definition is meant to be used in configure or cmake arguments to avoid dealing with different prefixes on various systems.

## CROSS_INCLUDEDIR

[ Top ] [ cross.cygclass ] [ Definitions ]

DESCRIPTION

The $prefix/include directory under the sysroot. This definition is meant to be used in configure or cmake arguments to avoid dealing with different prefixes on various systems.

## CROSS_LIBDIR

[ Top ] [ cross.cygclass ] [ Definitions ]

DESCRIPTION

The $prefix/lib directory under the sysroot. This definition is meant to be used in configure or cmake arguments to avoid dealing with different prefixes on various systems.

## CROSS_DATADIR

[ Top ] [ cross.cygclass ] [ Definitions ]

DESCRIPTION

The $prefix/share directory under the sysroot. This definition is meant to be used in configure or cmake arguments to avoid dealing with different prefixes on various systems.

## doelflib

[ Top ] [ cross.cygclass ] [ Install Functions ]

SYNOPSIS

      doelflib libfoo.so.X.Y.Z [...]

DESCRIPTION

Installs the given ELF libraries into the CROSS_SYSROOT libdir and creates the symlinks for the SONAME (usually .so.X) and the link library (.so).

NOTE

Only the real library file should be passed to doelflib, not the symlinks usually created in the build directory.

## cross_sysrootize

[ Top ] [ cross.cygclass ] [ Install Functions ]

SYNOPSIS

      cross_sysrootize FILE [FILE] ...

DESCRIPTION

Adds CROSS_SYSROOT to all paths in given text file(s). Paths should be specified as if on the system, without a leading $D.

## cross_desysrootize

[ Top ] [ cross.cygclass ] [ Install Functions ]

SYNOPSIS

      cross_desysrootize FILE [FILE] ...

DESCRIPTION

Removes CROSS_SYSROOT from all paths in given text file(s). Paths should be specified as if on the system, without a leading $D.