1.4 Cross Compiling Erlang/OTP
18 | Ericsson AB. All Rights Reserved.: Erlang/OTP System Documentation
• Large File Support
• Other Tools
• Cross System Root Locations
• Optional Feature, and Bug Tests
• Copyright and License
• Modifying This Document
1.4.1 Introduction
This document describes how to cross compile Erlang/OTP-R14B03. Note that the support for cross compiling Erlang/
OTP should be considered as experimental. As far as we know, the R14B03 release should cross compile fine, but
since we currently have a very limited set of cross compilation environments to test with we cannot be sure. The cross
compilation support will remain in an experimental state until we get a lot more cross compilation environments to
test with.
You are advised to read the whole document before attempting to cross compile Erlang/OTP. However, before reading
this document, you should read the $ERL_TOP/INSTALL.md document which describes building and installing Erlang/
OTP in general. $ERL_TOP is the top directory in the source tree.
otp_build Versus configure/make
Building Erlang/OTP can be done either by using the $ERL_TOP/otp_build script, or by invoking $ERL_TOP/
configure and make directly. Building using otp_build is easier since it involves fewer steps, but the
otp_build build procedure is not as flexible as the configure/make build procedure. Note that otp_build
configure will produce a default configuration that differs from what configure will produce by default. For
example, currently --disable-dynamic-ssl-lib is added to the configure command line arguments unless
--enable-dynamic-ssl-lib has been explicitly passed. The binary releases that we deliver are built using
otp_build. The defaults used by otp_build configure may change at any time without prior notice.
Cross Configuration
The $ERL_TOP/xcomp/erl-xcomp.conf.template file contains all available cross configuration variables
and can be used as a template when creating a cross compilation configuration. All cross configuration
variables are also listed at the end of this document. For examples of working cross configurations see the
$ERL_TOP/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf file and the $ERL_TOP/xcomp/erl-
xcomp-x86_64-saf-linux-gnu.conf file. If the default behavior of a variable is satisfactory, the variable
does not need to be set. However, the configure script will issue a warning when a default value is used. When
a variable has been set, no warning will be issued.
A cross configuration file can be passed to otp_build configure using the --xcomp-conf command line
argument. Note that configure does not accept this command line argument. When using the configure script
directly, pass the configuration variables as arguments to configure using a <VARIABLE>=<VALUE> syntax.
Variables can also be passed as environment variables to configure. However, if you pass the configuration in the
environment, make sure to unset all of these environment variables before invoking make; otherwise, the environment
variables might set make variables in some applications, or parts of some applications, and you may end up with an
erroneously configured build.
What can be Cross Compiled?
All Erlang/OTP applications except the wx application can be cross compiled. The build of the wx driver will currently
be automatically disabled when cross compiling.
Compatibility
The build system, including cross compilation configuration variables used, may be subject to non backward
compatible changes without prior notice. Current cross build system has been tested when cross compiling some