man cross-compile (Formats) - Configuration for dpkg-cross and relatives

NAME

cross-compile - Configuration for dpkg-cross and relatives

DESCRIPTION

This file defines some settings for dpkg-cross, and the multi-architecture extensions of dpkg-buildpackage and dpkg-shlibdeps, also provided by the dpkg-cross package.

This file may be located either in user's home directory or system wide. User path is $HOME/.dpkg-cross/cross-compile, system path is /etc/dpkg-cross/cross-compile.

Comments start with a '#' and continue to the end of the line. They are allowed only on their own lines, not after variable definitions. Variable definitions have the general form

varname = value

Values on the right side can contain references to other variables or to environment variables (with lower precedence) in the form ``$(VARIABLE)''. The referred name must be all uppercase, whereas names in definitions are all lowercase. Recursive references are not allowed. ``$(ARCH)'' can always be used, and is set automatically to the architecture for which compiling is done.

In the first package-independent part of the file, the following variables can be defined:

default_arch (default: none)
If not other specified this architecture is used for dpkg-cross tools.
crossroot-arch (default: none)
If arch matches the current target architecture (selected by a -a option), then this definition of ``$(CROSSROOT)'' will take place. It tells dpkg-cross that there is a complete Debian installation for the target arch mounted somewhere, in the path which is the value of the definition. If a ``$(CROSSROOT)'' definition is active, some of the other variables change their meaning. For a complete description, best refer to /usr/share/doc/dpkg-cross/README.Debian.gz.
crossbase (default: /usr)
This is the path prefix for all other cross compiling paths below. It is used in their default definition, but a user definition need not necessarily use it.
crossdir (default: $(CROSSBASE)/$(DEB_HOST_GNU_TYPE))
This is the base directory for a specific architecture.
crossbin (default: $(CROSSDIR)/bin)
This directory contains binaries for cross compiling (gcc, as, ld, ...). It's mainly intended for refering to, but dpkg-shlibdeps also uses it as one alternative to locate a objdump that can parse objects of the architecture in question.
crosslib (default: $(CROSSDIR)/lib or $(CROSSROOT)/lib, resp.)
This directory contains libraries and other linker support files (e.g. crt1.o) for cross compiling. The setting is used by dpkg-cross as place where to install files from usual /lib, /usr/lib, and /usr/X11R6/lib. Also dpkg-shlibdeps expects target arch libraries in this directory. This is specially important if ``$(CROSSROOT)'' is defined.
crosslib64 (default: $(CROSSLIB)64)
On targets that have both 32bit and 64bit variants, this directory contains 64bit versions of libraries and other linker support files. This setting is used by dpkg-cross as place where to install files from /lib64, /usr/lib64, and /usr/X11R6/lib64. Note that this setting is NOT used for 64bit-only targets (such as ``ia64'').
crossinc (default: $(CROSSDIR)/include)
This directory contains headers for cross compiling. The setting is used by dpkg-cross as place where to install files from usual /usr/include and /usr/X11R6/include. Unused if ``$(CROSSROOT)'' is defined.
crossprefix (default: $(CPU)-$(OS)-)
This is the prefix for cross compiling binaries, like gcc. The default naming is GNU convention, e.g. you could have m68k-linux-gcc in your PATH. It is mainly intended for refering to, but dpkg-shlibdeps also uses it as one alternative to locate a objdump that can parse objects of the architecture in question (it tries ``$(CROSSPREFIX)objdump'').
removedeps
This variable defines comma-separated list of package names that should be removed from any dependency fields (Depends:, Conflicts:, etc) of the generated packages. This is useful when original native package depends on packages like xfree86-common or gpm, that are of no value for cross-compilation.
keepdeps
This variable defines comma-separated list of package names that should be kept as is, without adding -arch-cross suffix, in all dependency fields (Depends:, Conflicts:, etc) of the generated packages. This is useful for packages like bison, when host version of package can satisfy the dependency.
compilerpath (default: /bin:/usr/bin)
This variable defines colon-separated list of directories where gccross search for compilers.

The variables ``$(CPU)'' and ``$(OS)'' mentioned above sometimes are derived from the current target architecture ``$(ARCH)''. If that one doesn't contain a dash ('-'), it's assumed to be ``$(CPU)'' and ``$(OS)'' to be ``linux''. However, if the architecture string starts with ``hurd-'' or end in ``-gnu'', the ``$(OS)'' part will be ``gnu'', the ``$(CPU)'' the rest before or after the OS.

Second part of the file is started by a line that ends with a colon. In this part additional variables may be defined for dpkg-buildpackage wrapper. This feature is meant for your convenience: Packages can refer to unusual Makefile variables for the tools to use, and with a package-specific section you can tell dpkg-buildpackage about those variables, so that you don't need to set them manually each time.

Variables may be defined in two scopes - makeflags and environment. Variables defined in makeflags scope are put into ``MAKEFLAGS'' environment variable. Variables defined in environment scope become separate environment variables.

Default scope is makeflags. Scope is changed to environment after

mode environment: line, and restored to makeflags after

mode makeflags: line. Note colons at the end of those lines.

Variables may be defined both globally and on per-package basis. This is controled by

package NAME: lines. If NAME is ``all'', subsequent definitions will be global, otherwise - local for package NAME.

Note: Backward compatiblity

For compatability with older format of cross-compile file, ``package'' keyword may be ommited. Also note colon at the end of the line.

It is possible to define several sets of variables for different use cases. For example, one set may be used for emdebian-style package builds, another for normal package cross-compiling. This is implemented using mode concept.

Any definitions after a

mode NAME: line are valid only for mode NAME. To choose mode, use -M switch of dpkg-buildpackage wrapper. Only variables defined for the chosen mode will be set, others will be ignored. If no -M switch is given, mode default is assumed.

There is a special mode named ``all''. Variables defined for this mode are set always, in addition to mode-specific settings. This is the mode for the variables defined before the first mode NAME: line.

VARIABLE UNSETTING

Second part of configuration file may be used not only to set variables, but also to unset previously set variables. Syntax to unset variable is

unset varname

Current package, mode and scope affect variable unsetting in the same way as they affect variable setting.

Variables set by default, such as CC or LD, also may be unset. This may be useful if build scripts of some package get confused by environment created by dpkg-cross by default.

FILES

$HOME/.dpkg-cross/cross-compile, /etc/dpkg-cross/cross-compile

SEE ALSO

dpkg-cross(1), cross-compile(5), /usr/share/doc/dpkg-cross/README.Debian.gz

AUTHOR

Roman Hodek <roman@hodek.net>

VERSION

$Revision: 1.11 $

COPYRIGHT

Copyright © 1997 Roman Hodek This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.