aboutsummaryrefslogtreecommitdiffstats
path: root/xcomp
diff options
context:
space:
mode:
Diffstat (limited to 'xcomp')
-rw-r--r--xcomp/README218
-rw-r--r--xcomp/README.xcomp25
-rw-r--r--xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf166
-rw-r--r--xcomp/erl-xcomp-vxworks_ppc32.conf172
-rw-r--r--xcomp/erl-xcomp.conf.template174
5 files changed, 474 insertions, 281 deletions
diff --git a/xcomp/README b/xcomp/README
new file mode 100644
index 0000000000..dfda81fc8e
--- /dev/null
+++ b/xcomp/README
@@ -0,0 +1,218 @@
+================================================================================
+ Cross compiling Erlang/OTP
+================================================================================
+
+%CopyrightBegin%
+
+Copyright Ericsson AB 2009. All Rights Reserved.
+
+The contents of this file are subject to the Erlang Public License,
+Version 1.1, (the "License"); you may not use this file except in
+compliance with the License. You should have received a copy of the
+Erlang Public License along with this software. If not, it can be
+retrieved online at http://www.erlang.org/.
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+the License for the specific language governing rights and limitations
+under the License.
+
+%CopyrightEnd%
+
+================================================================================
+
+This directory contains a configuration file template and configuration examples
+for cross compiling Erlang/OTP. The configuration files contain configuration
+variables and should be supplied to the $ERL_TOP/otp_build when setting up an
+appropriate environment for cross compiling. The currently used configuration
+variables are described later in this document.
+
+The erl-xcomp.conf.template contains all available configuration variables
+and can be used as a template when creating a configuration. See the
+erl-xcomp-TileraMDE2.0-tilepro.conf for an example of a working configuration
+file.
+
+Instead of using the configuration files one can export the configuration
+variables as ordinary environment variables before calling otp_build. If
+default behavior of a variable is satisfactory, the variable need not to
+be set and exported.
+
+Note that the support for cross compiling is in its early stage of development,
+and should be considered as experimental. The build system including cross
+compilation configuration variables used may be subject to non backward
+compatible changes without prior notice. It works for cross compiling some
+Linux/GNU systems, but has only been partly tested for more esoteric platforms.
+The VxWorks example file is highly dependent on our environment and is here
+more or less only for internal use.
+
+Please submit any patches for cross compiling in a way consistent with this
+system. If a new configuration variable is needed for your system, add it to the
+template file, use it in otp_build, aclocal.m4 and/or configure.in. All input is
+welcome as we cannot possibly have all cross compiling environments out there to
+test with.
+
+General information on how to submit patches can be found at:
+ http://wiki.github.com/erlang/otp/submitting-patches
+
+== Build and Install ===========================================================
+
+ [1] $ cd $ERL_TOP
+
+Either set up your cross compilation variables in the environment manually,
+or set up the environment using a configuration file by executing:
+ [2] $ eval `./otp_build env_cross <ABSOLUTE_PATH_TO_XCONF_FILE>`
+
+Configure and build Erlang/OTP:
+ [3] $ ./otp_build configure
+ [4] $ ./otp_build boot -a
+ [5] $ ./otp_build release -a <ABSOLUTE_PATH_TO_RELEASE_ROOT>
+
+The Install script used when installing Erlang/OTP requires common Unix
+tools such as 'sed' to be present in your PATH. If your target system
+does not have such tools, you need to run the Install script on your
+build machine before packing Erlang/OTP. If so, run the Install script
+like follows; otherwise skip [6] and [7]:
+ [6] $ cd <ABSOLUTE_PATH_TO_RELEASE_ROOT>
+ [7] $ ./Install -cross <ABSOLUTE_INSTALL_ROOT_ON_TARGET> # answer questions
+
+Pack Erlang/OTP as follows (gnu tar is assumed):
+ [8] $ cd <ABSOLUTE_PATH_TO_RELEASE_ROOT>
+ [9] $ tar -zcf <WHERE_TO_SAVE_THE_RELEASE>/<RELEASE_NAME>.tar.gz *
+
+Install Erlang/OTP on the target system like follows. If you ran the Install
+script before packing ([6] and [7]) you should skip [12]:
+ [10] $ cd <ABSOLUTE_INSTALL_ROOT_ON_TARGET>
+ [11] $ tar -zxf <WHERE_THE_PACKED_RELEASE_EXIST>/<RELEASE_NAME>.tar.gz
+ [12] $ ./Install <ABSOLUTE_INSTALL_ROOT_ON_TARGET> # answer questions
+
+<ABSOLUTE_INSTALL_ROOT_ON_TARGET> usually equals current working directory
+when you run the Install script on the target system, but does not have to.
+It can follow another path through the file system to the same directory.
+<ABSOLUTE_INSTALL_ROOT_ON_TARGET> is the path that will be used when running
+Erlang/OTP and is the path that have to be available at run time.
+
+== Currently used configuration variables ======================================
+
+-- Mandatory -------------------------------------------------------------------
+
+* erl_xcomp_host
+ Target system. The value will be passed as '--host' argument to the configure
+ script. It does not have to be a full CPU-VENDOR-OS triplet, but can be. The
+ full CPU-VENDOR-OS triplet will be created by:
+ $ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host
+
+-- Optional --------------------------------------------------------------------
+
+* erl_xcomp_configure_flags
+ To override the configure flags for a special target system, you
+ can set this variable which overrides configure parameters on the
+ command line and instead uses the specified options. The variable
+ leaves the build-host system untouched.
+
+-- Optional build environment flags --
+
+If the cross compilation tools aren't prefixed by '$erl_xcomp_host-',
+you will have to use these configuration variables in order to use the
+right cross compilation tools.
+
+* erl_xcomp_cc
+ C compiler.
+
+* erl_xcomp_ld
+ Linker.
+
+* erl_xcomp_cflags
+ C compiler flags.
+
+* erl_xcomp_cpp
+ C pre processor.
+
+* erl_xcomp_ldflags
+ Linker flags.
+
+* erl_xcomp_ranlib
+ Ranlib program.
+
+* erl_xcomp_ar
+ Ar program.
+
+* erl_xcomp_ded_ld
+ Dynamic Erlang Driver linker.
+
+* erl_xcomp_ded_ldflags
+ Dynamic Erlang Driver linker flags.
+
+* erl_xcomp_ded_ld_runtime_library_path
+ Dynamic Erlang Driver runtime linker path.
+
+-- Optional feature, or bug tests --
+
+These tests cannot (always) be done automatically when cross compiling. You
+usually does not need to set these variables. Only set these if you really
+know what you are doing.
+
+* erl_xcomp_bigendian - yes|no
+ If yes, the target system must be big endian. If no, little endian. This can
+ often be automatically detected, but not always. If not automatically
+ detected, configure will fail unless this variable is set. No default value
+ is used, i.e., configure will try to figure this out automatically.
+
+* erl_xcomp_linux_clock_gettime_correction - yes|no (defaults to yes)
+ If yes, clock_gettime(CLOCK_MONOTONIC, _) on the target system must work.
+ This variable is recommended to be set to no on Linux systems with kernel
+ versions less than 2.6.
+
+* erl_xcomp_linux_nptl - yes|no (defaults to yes on Linux; otherwise, no)
+ If yes, the target system must have NPTL (Native POSIX Thread Library).
+ Older Linux systems have LinuxThreads instead of NPTL (Linux kernel
+ versions typically less than 2.6).
+
+* erl_xcomp_linux_usable_sigusrx - yes|no (defaults to yes)
+ If yes, the SIGUSR1 and SIGUSR2 must be usable by the ERTS. Old
+ LinuxThreads thread libraries (Linux kernel versions less than 2.2) used
+ these signals and made them unusable by the ERTS.
+
+* erl_xcomp_linux_usable_sigaltstack - yes|no (defaults to yes)
+ If yes, sigaltstack() must be usable on the target system. sigaltstack()
+ on Linux kernel versions less than 2.4 are broken.
+
+* erl_xcomp_poll - yes|no (defaults to no on Darwin/MacOSX; otherwise, yes)
+ If yes, the target system must have a working poll() implementation that also
+ can handle devices. If no, select() will be used instead of poll().
+
+* erl_xcomp_kqueue - yes|no (defaults to no)
+ If yes, the target system must have a working kqueue() implementation that
+ returns a file descriptor which can be used by poll() and/or select().
+ If no and the target system has not got epoll() or /dev/poll, the kernel-poll
+ feature will be disabled.
+
+* erl_xcomp_putenv_copy - yes|no (defaults to no)
+ If yes, the target system must have a putenv() implementation that stores a
+ copy of the key/value pair.
+
+* erl_xcomp_reliable_fpe - yes|no (defaults to no)
+ If yes, the target system must have reliable floating point exceptions.
+
+* erl_xcomp_getaddrinfo - yes|no (defaults to no)
+ If yes, the target system must have a working getaddrinfo() implementation
+ that can handle both IPv4 and IPv6.
+
+* erl_xcomp_gethrvtime_procfs_ioctl - yes|no (defaults to no)
+ If yes, the target system must have a working gethrvtime() implementation
+ and is used with procfs ioctl().
+
+* erl_xcomp_clock_gettime - yes|no (defaults to no)
+ If yes, the target system must have a working clock_gettime() implementation
+ that can be used for retrieving process CPU time.
+
+* erl_xcomp_after_morecore_hook - yes|no (defaults to no)
+ If yes, the target system must have a working __after_morecore_hook that can
+ be used for tracking used malloc() implementations core memory usage.
+
+* erl_xcomp_dlsym_brk_wrappers - yes|no (defaults to no)
+ If yes, the target system must have a working dlsym(RTLD_NEXT, <S>)
+ implementation that can be used on 'brk' and 'sbrk' symbols used by the
+ malloc() implementation in use, and by this track the malloc() implementations
+ core memory usage.
+
+================================================================================
diff --git a/xcomp/README.xcomp b/xcomp/README.xcomp
deleted file mode 100644
index 4df9226a96..0000000000
--- a/xcomp/README.xcomp
+++ /dev/null
@@ -1,25 +0,0 @@
-This directory contains configuration file templates and examples for
-cross compiling Erlang/OTP. The configuration files should be supplied to
-$ERl_TOP/otp_build in the ./otp_build env_cross command to set up an
-appropriate environment for cross compiling.
-
-Copy the template file erl-xcomp.conf.template to an appropriate name
-and fill in at least the mandatory parts before attempting cross
-compilation. See the template file for details on configuration
-parameters and see the example erl-xcomp-TileraMDE2.0-tilepro.conf for
-an example of a working configuration file.
-
-The support for cross compiling is in it's early stage of development,
-it works for cross compiling some gnu/linux systems, but has only been partly
-tested for more esotheric platforms. The vxworks example file is highly
-dependent on our environment and is here more or less for internal use.
-
-Please submit any patches for cross compiling in a way consistent with
-this system. Variables should be added to the configuration file,
-which is sourced both by $ERL_TOP/otp_build and each configure
-script. If a new configuration variable is needed for your system, add
-it to the template file, use it in otp_build and/or configure and
-submit the patch to erlang-patches for further integration into the
-main branch. All input is welcome as we cannot possibly have all cross
-compiling environments out there to test with.
-
diff --git a/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
index e711f06a27..c8e7212e1f 100644
--- a/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
+++ b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
@@ -16,73 +16,43 @@
###
### %CopyrightEnd%
###
-### File: erl-xcomp.conf
+### File: erl-xcomp-TileraMDE2.0-tilepro.conf
### Author: Rickard Green
###
### ----------------------------------------------------------------------------
### When cross compiling Erlang/OTP, copy this file and set the variables
### needed below. Then pass the path to the copy of this file as an argument
-### to "eval `otp_build env_cross <path to erl-xcomp.conf file>`".
+### to "eval `otp_build env_cross <absolute path to erl-xcomp.conf file>`".
### ----------------------------------------------------------------------------
### ----------------------------------------------------------------------------
### Variables in the following section *have* to be set.
###
-##
-## Operating system and hardware architecture.
-##
-# Operating system: linux|solaris<ver>|darwin|freebsd|win32|<...>
-erl_xcomp_os=linux
-# Hardware architecture: x86|x86_64|ultrasparc|sparc64|ppc|arm|tile|<...>
-erl_xcomp_hw=tile
-# Manufacturer: (unknown is ok)
-erl_xcomp_man=tilera
-# Extra target info (unknown is ok)
-erl_xcomp_target_xtra=gnu
-
-# Target (change if default isn't satisfactory)
-erl_xcomp_target=${erl_xcomp_hw}-${erl_xcomp_man}-${erl_xcomp_os}-${erl_xcomp_target_xtra}
##
-## Sizes (in bytes) of some important types.
+## Target system. The value will be passed as '--host' argument to the configure
+## script. It does not have to be a full CPU-VENDOR-OS tripplet, but can be. The
+## full CPU-VENDOR-OS tripplet will be created by:
+## $ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host
##
-# void *
-erl_xcomp_void_p=4
-# short
-erl_xcomp_short=2
-# int
-erl_xcomp_int=4
-# long
-erl_xcomp_long=4
-# long long (use 0 if no 'long long' type exist)
-erl_xcomp_long_long=8
-# size_t
-erl_xcomp_sizeof_size_t=4
-# off_t
-erl_xcomp_sizeof_off_t=4
+erl_xcomp_host=tile
### ----------------------------------------------------------------------------
-### The variables in the following section have to be set for linux systems
-###
-# linux kernel version (as reported by "uname -r")
-erl_xcomp_linux_kernel=2.6.26.7
-
### ----------------------------------------------------------------------------
-### ---------------------------------------------------------------------------
### To override the configure flags for a special target system, You
### can set this variable which overrides configure parameters on the
### command line and instead uses the specified options. The variable
### leaves the build-host system untouched.
-### ---------------------------------------------------------------------------
+### ----------------------------------------------------------------------------
erl_xcomp_configure_flags="--without-termcap"
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
### You can specify a specific CC or LD for the build target (the cross
### compiler) here along with magic CFLAGS and/or LDFLAGS if needed
### ar and ranlib might also be specified if needed.
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
erl_xcomp_cc=
@@ -98,7 +68,7 @@ erl_xcomp_ranlib=
erl_xcomp_ar=
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
### The ded_ls and ded_ldflags variables control linking of dynamically loaded
### erlang drivers. On i.e. Linux these are set to
### $(CC) and "-shared" respectively, but other OS'es might need other
@@ -106,7 +76,7 @@ erl_xcomp_ar=
### erl_xcomp_ded_ld_runtime_library_path is the flag to set a
### specific runtime library path for the shared library at link time,
### usually this should be left empty.
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
erl_xcomp_ded_ld=
@@ -114,83 +84,117 @@ erl_xcomp_ded_ldflags=
erl_xcomp_ded_ld_runtime_library_path=
-### The variables in the following section does not need to be set. Only
-### set these if you really know what you are doing.
+###
+### Optional feature, or bug tests
+###
+### These tests cannot (always) be done automatically when cross compiling.
+### You usually does not need to set these variables. Only set these if you
+### really know what you are doing.
###
##
-## Big endian/little endian can usually be determined by configure correctly,
-## but if not, set this variable
-##
+## erl_xcomp_bigendian - yes|no
+## If yes, the target system must be big endian. If no, little endian. This
+## can often be automatically detected, but not always. If not automatically
+## detected, configure will fail unless this variable is set. No default value
+## is used, i.e., configure will try to figure this out automatically.
erl_xcomp_bigendian=
##
-## If you have a working poll that can be used: yes|no
+## erl_xcomp_linux_clock_gettime_correction - yes|no (defaults to yes)
+## If yes, clock_gettime(CLOCK_MONOTONIC, _) on the target system must work.
+## This variable is recommended to be set to no on Linux systems with kernel
+## versions less than 2.6.
+##
+erl_xcomp_linux_clock_gettime_correction=yes
+
+##
+## erl_xcomp_linux_nptl - yes|no (defaults to yes on Linux; otherwise, no)
+## If yes, the target system must have NPTL (Native POSIX Thread Library).
+## Older Linux systems have LinuxThreads instead of NPTL (Linux kernel
+## versions typically less than 2.6).
+##
+erl_xcomp_linux_nptl=yes
+
+##
+## erl_xcomp_linux_usable_sigusrx - yes|no (defaults to yes)
+## If yes, the SIGUSR1 and SIGUSR2 must be usable by the ERTS. Old
+## LinuxThreads thread libraries (Linux kernel versions less than 2.2) used
+## these signals and made them unusable by the ERTS.
+##
+erl_xcomp_linux_usable_sigusrx=yes
+
+##
+## erl_xcomp_linux_usable_sigaltstack - yes|no (defaults to yes)
+## If yes, sigaltstack() must be usable on the target system. sigaltstack()
+## on Linux kernel versions less than 2.4 are broken.
+##
+erl_xcomp_linux_usable_sigaltstack=yes
+
+##
+## erl_xcomp_poll - yes|no (defaults to no on Darwin/MacOSX; otherwise, yes)
+## If yes, the target system must have a working poll() implementation that
+## also can handle devices. If no, select() will be used instead of poll().
##
erl_xcomp_poll=yes
##
-## If you have a working kqueue() that can be used: yes|no
+## erl_xcomp_kqueue - yes|no (defaults to no)
+## If yes, the target system must have a working kqueue() implementation that
+## returns a file descriptor which can be used by poll() and/or select().
+## If no and the target system has not got epoll() or /dev/poll, the
+## kernel-poll feature will be disabled.
##
erl_xcomp_kqueue=
##
-## If you have a putenv() that stores a copy of the key-value pair: yes|no
+## erl_xcomp_putenv_copy - yes|no (defaults to no)
+## If yes, the target system must have a putenv() implementation that stores a
+## copy of the key/value pair.
##
erl_xcomp_putenv_copy=
##
-## If you have reliable floating point exeptions that can be
-## used: yes|no
+## erl_xcomp_reliable_fpe - yes|no (defaults to no)
+## If yes, the target system must have reliable floating point exceptions.
##
erl_xcomp_reliable_fpe=
##
-## If you have getaddrinfo() usable for ipv6: yes|no
+## erl_xcomp_getaddrinfo - yes|no (defaults to no)
+## If yes, the target system must have a working getaddrinfo() implementation
+## that can handle both IPv4 and IPv6.
##
erl_xcomp_getaddrinfo=yes
##
-## If you have a gethrvtime() that works and uses ioctl()
-## to /proc/self: yes|no
+## erl_xcomp_gethrvtime_procfs_ioctl - yes|no (defaults to no)
+## If yes, the target system must have a working gethrvtime() implementation
+## and is used with procfs ioctl().
##
erl_xcomp_gethrvtime_procfs_ioctl=
##
-## If you have a working clock_gettime(): yes|no
+## erl_xcomp_clock_gettime - yes|no (defaults to no)
+## If yes, the target system must have a working clock_gettime()
+## implementation that can be used for retrieving process CPU time.
##
erl_xcomp_clock_gettime=
##
-## If you have a __after_morecore_hook that can track malloc()s
-## core memory use: yes|no
+## erl_xcomp_after_morecore_hook - yes|no (defaults to no)
+## If yes, the target system must have a working __after_morecore_hook that
+## can be used for tracking used malloc() implementations core memory usage.
##
erl_xcomp_after_morecore_hook=
##
-## If you have brk, sbrk and end symbols: yes|no
-##
-# brk
-erl_xcomp_have_brk=
-# _brk
-erl_xcomp_have__brk=
-# __brk
-erl_xcomp_have___brk=
-# sbrk
-erl_xcomp_have_sbrk=
-# _sbrk
-erl_xcomp_have__sbrk=
-# __sbrk
-erl_xcomp_have___sbrk=
-# end
-erl_xcomp_end=
-# _end
-erl_xcomp__end=
-
-##
-## If sbrk/brk wrappers using dlsym(RTLD_NEXT, _) can track malloc()s
-## core memory use: yes|no
+## erl_xcomp_dlsym_brk_wrappers - yes|no (defaults to no)
+## If yes, the target system must have a working dlsym(RTLD_NEXT, <S>)
+## implementation that can be used on 'brk' and 'sbrk' symbols used by the
+## malloc() implementation in use, and by this track the malloc()
+## implementations core memory usage.
##
-erl_xcomp_brk_wrappers=
+erl_xcomp_dlsym_brk_wrappers=
### ----------------------------------------------------------------------------
diff --git a/xcomp/erl-xcomp-vxworks_ppc32.conf b/xcomp/erl-xcomp-vxworks_ppc32.conf
index 544212233a..19a9327239 100644
--- a/xcomp/erl-xcomp-vxworks_ppc32.conf
+++ b/xcomp/erl-xcomp-vxworks_ppc32.conf
@@ -23,7 +23,7 @@
### ----------------------------------------------------------------------------
### When cross compiling Erlang/OTP, copy this file and set the variables
### needed below. Then pass the path to the copy of this file as an argument
-### to "eval `otp_build env_cross <path to erl-xcomp.conf file>`".
+### to "eval `otp_build env_cross <absolute path to erl-xcomp.conf file>`".
### ----------------------------------------------------------------------------
### ----------------------------------------------------------------------------
@@ -31,60 +31,27 @@
###
##
-## Operating system and hardware architecture.
-##
-# Operating system: linux|solaris<ver>|darwin|freebsd|win32|<...>
-erl_xcomp_os=vxworks
-# Hardware architecture: x86|x86_64|ultrasparc|sparc64|ppc|arm|tile|<...>
-# Note that this will be the host parameter to configure, so it
-# should be both recognizable by config.sub and a valid prefix for
-# i.e. gcc etc.
-erl_xcomp_hw=ppc-wrs
-# Manufacturer: (unknown is ok)
-erl_xcomp_man=wrs
-# Extra target info (unknown is ok)
-erl_xcomp_target_xtra=unknown
-
-# Target (change if default isn't satisfactory)
-erl_xcomp_target=powerpc-wrs-vxworks
-
-##
-## Sizes (in bytes) of some important types.
-##
-# void *
-erl_xcomp_void_p=4
-# short
-erl_xcomp_short=2
-# int
-erl_xcomp_int=4
-# long
-erl_xcomp_long=4
-# long long (use 0 if no 'long long' type exist)
-erl_xcomp_long_long=8
-# size_t
-erl_xcomp_sizeof_size_t=4
-# off_t
-erl_xcomp_sizeof_off_t=4
+## Target system. The value will be passed as '--host' argument to the configure
+## script. It does not have to be a full CPU-VENDOR-OS tripplet, but can be. The
+## full CPU-VENDOR-OS tripplet will be created by:
+## $ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host
+##
+erl_xcomp_host=powerpc-wrs-vxworks
### ----------------------------------------------------------------------------
-### The variables in the following section have to be set for linux systems
-###
-# linux kernel version (as reported by "uname -r")
-erl_xcomp_linux_kernel=
-
### ----------------------------------------------------------------------------
-### ---------------------------------------------------------------------------
### To override the configure flags for a special target system, You
### can set this variable which overrides configure parameters on the
### command line and instead uses the specified options. The variable
### leaves the build-host system untouched.
-### ---------------------------------------------------------------------------
+### ----------------------------------------------------------------------------
erl_xcomp_configure_flags="--without-termcap"
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
### You can specify a specific CC or LD for the build target (the cross
### compiler) here along with magic CFLAGS and/or LDFLAGS if needed
-###----------------------------------------------------------------------------
+### ar and ranlib might also be specified if needed.
+###-----------------------------------------------------------------------------
erl_xcomp_cc="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/ccppc"
@@ -97,9 +64,10 @@ erl_xcomp_cpp="$erl_xcomp_cc $erl_xcomp_cflags -E"
erl_xcomp_ldflags="-mlongcall"
erl_xcomp_ranlib="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/ranlibppc"
+
erl_xcomp_ar="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/arppc"
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
### The ded_ls and ded_ldflags variables control linking of dynamically loaded
### erlang drivers. On i.e. Linux these are set to
### $(CC) and "-shared" respectively, but other OS'es might need other
@@ -107,7 +75,7 @@ erl_xcomp_ar="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/arppc"
### erl_xcomp_ded_ld_runtime_library_path is the flag to set a
### specific runtime library path for the shared library at link time,
### usually this should be left empty.
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
erl_xcomp_ded_ld=
@@ -115,83 +83,117 @@ erl_xcomp_ded_ldflags=
erl_xcomp_ded_ld_runtime_library_path=
-### The variables in the following section does not need to be set. Only
-### set these if you really know what you are doing.
+###
+### Optional feature, or bug tests
+###
+### These tests cannot (always) be done automatically when cross compiling.
+### You usually does not need to set these variables. Only set these if you
+### really know what you are doing.
###
##
-## Big endian/little endian can usually be determined by configure correctly,
-## but if not, set this variable
-##
+## erl_xcomp_bigendian - yes|no
+## If yes, the target system must be big endian. If no, little endian. This
+## can often be automatically detected, but not always. If not automatically
+## detected, configure will fail unless this variable is set. No default value
+## is used, i.e., configure will try to figure this out automatically.
erl_xcomp_bigendian=yes
##
-## If you have a working poll that can be used: yes|no
+## erl_xcomp_linux_clock_gettime_correction - yes|no (defaults to yes)
+## If yes, clock_gettime(CLOCK_MONOTONIC, _) on the target system must work.
+## This variable is recommended to be set to no on Linux systems with kernel
+## versions less than 2.6.
+##
+erl_xcomp_linux_clock_gettime_correction=
+
+##
+## erl_xcomp_linux_nptl - yes|no (defaults to yes on Linux; otherwise, no)
+## If yes, the target system must have NPTL (Native POSIX Thread Library).
+## Older Linux systems have LinuxThreads instead of NPTL (Linux kernel
+## versions typically less than 2.6).
+##
+erl_xcomp_linux_nptl=
+
+##
+## erl_xcomp_linux_usable_sigusrx - yes|no (defaults to yes)
+## If yes, the SIGUSR1 and SIGUSR2 must be usable by the ERTS. Old
+## LinuxThreads thread libraries (Linux kernel versions less than 2.2) used
+## these signals and made them unusable by the ERTS.
+##
+erl_xcomp_linux_usable_sigusrx=
+
+##
+## erl_xcomp_linux_usable_sigaltstack - yes|no (defaults to yes)
+## If yes, sigaltstack() must be usable on the target system. sigaltstack()
+## on Linux kernel versions less than 2.4 are broken.
+##
+erl_xcomp_linux_usable_sigaltstack=
+
+##
+## erl_xcomp_poll - yes|no (defaults to no on Darwin/MacOSX; otherwise, yes)
+## If yes, the target system must have a working poll() implementation that
+## also can handle devices. If no, select() will be used instead of poll().
##
erl_xcomp_poll=
##
-## If you have a working kqueue() that can be used: yes|no
+## erl_xcomp_kqueue - yes|no (defaults to no)
+## If yes, the target system must have a working kqueue() implementation that
+## returns a file descriptor which can be used by poll() and/or select().
+## If no and the target system has not got epoll() or /dev/poll, the
+## kernel-poll feature will be disabled.
##
erl_xcomp_kqueue=
##
-## If you have a putenv() that stores a copy of the key-value pair: yes|no
+## erl_xcomp_putenv_copy - yes|no (defaults to no)
+## If yes, the target system must have a putenv() implementation that stores a
+## copy of the key/value pair.
##
erl_xcomp_putenv_copy=
##
-## If you have reliable floating point exeptions that can be
-## used: yes|no
+## erl_xcomp_reliable_fpe - yes|no (defaults to no)
+## If yes, the target system must have reliable floating point exceptions.
##
erl_xcomp_reliable_fpe=
##
-## If you have getaddrinfo() usable for ipv6: yes|no
+## erl_xcomp_getaddrinfo - yes|no (defaults to no)
+## If yes, the target system must have a working getaddrinfo() implementation
+## that can handle both IPv4 and IPv6.
##
erl_xcomp_getaddrinfo=
##
-## If you have a gethrvtime() that works and uses ioctl()
-## to /proc/self: yes|no
+## erl_xcomp_gethrvtime_procfs_ioctl - yes|no (defaults to no)
+## If yes, the target system must have a working gethrvtime() implementation
+## and is used with procfs ioctl().
##
erl_xcomp_gethrvtime_procfs_ioctl=
##
-## If you have a working clock_gettime(): yes|no
+## erl_xcomp_clock_gettime - yes|no (defaults to no)
+## If yes, the target system must have a working clock_gettime()
+## implementation that can be used for retrieving process CPU time.
##
erl_xcomp_clock_gettime=
##
-## If you have a __after_morecore_hook that can track malloc()s
-## core memory use: yes|no
+## erl_xcomp_after_morecore_hook - yes|no (defaults to no)
+## If yes, the target system must have a working __after_morecore_hook that
+## can be used for tracking used malloc() implementations core memory usage.
##
erl_xcomp_after_morecore_hook=
##
-## If you have brk, sbrk and end symbols: yes|no
-##
-# brk
-erl_xcomp_have_brk=
-# _brk
-erl_xcomp_have__brk=
-# __brk
-erl_xcomp_have___brk=
-# sbrk
-erl_xcomp_have_sbrk=
-# _sbrk
-erl_xcomp_have__sbrk=
-# __sbrk
-erl_xcomp_have___sbrk=
-# end
-erl_xcomp_end=
-# _end
-erl_xcomp__end=
-
-##
-## If sbrk/brk wrappers using dlsym(RTLD_NEXT, _) can track malloc()s
-## core memory use: yes|no
+## erl_xcomp_dlsym_brk_wrappers - yes|no (defaults to no)
+## If yes, the target system must have a working dlsym(RTLD_NEXT, <S>)
+## implementation that can be used on 'brk' and 'sbrk' symbols used by the
+## malloc() implementation in use, and by this track the malloc()
+## implementations core memory usage.
##
-erl_xcomp_brk_wrappers=
+erl_xcomp_dlsym_brk_wrappers=
### ----------------------------------------------------------------------------
diff --git a/xcomp/erl-xcomp.conf.template b/xcomp/erl-xcomp.conf.template
index cc604a80e5..bed365e754 100644
--- a/xcomp/erl-xcomp.conf.template
+++ b/xcomp/erl-xcomp.conf.template
@@ -31,66 +31,26 @@
###
##
-## Operating system and hardware architecture.
-##
-# Operating system: linux|solaris<ver>|darwin|freebsd|win32|<...>
-erl_xcomp_os=
-# Hardware architecture: x86|x86_64|ultrasparc|sparc64|ppc|arm|tile|<...>
-# Note that this will be the host parameter to configure, so it
-# should be both recognizable by config.sub and a valid prefix for
-# i.e. gcc etc if compiler is not specified further down.
-erl_xcomp_hw=
-# Manufacturer: (unknown is ok)
-erl_xcomp_man=
-# Extra target info (unknown is ok)
-erl_xcomp_target_xtra=
-
-# Target (change if default isn't satisfactory)
-# Note that this has to correspond to what config.sub thinks the machine is.
-# Edit config.sub if not satisfactory, or set this explicitly
-# to what output you will get from running
-# $ERL_TOP/erts/autoconf/config.sub $erl_xcomp_hw
-
-erl_xcomp_target=${erl_xcomp_hw}-${erl_xcomp_man}-${erl_xcomp_os}-${erl_xcomp_target_xtra}
-
-##
-## Sizes (in bytes) of some important types.
-##
-# void *
-erl_xcomp_void_p=
-# short
-erl_xcomp_short=
-# int
-erl_xcomp_int=
-# long
-erl_xcomp_long=
-# long long (use 0 if no 'long long' type exist)
-erl_xcomp_long_long=
-# size_t
-erl_xcomp_sizeof_size_t=
-# off_t
-erl_xcomp_sizeof_off_t=
-
-### ----------------------------------------------------------------------------
-### The variables in the following section have to be set for linux systems
-###
-# linux kernel version (as reported by "uname -r")
-erl_xcomp_linux_kernel=
+## Target system. The value will be passed as '--host' argument to the configure
+## script. It does not have to be a full CPU-VENDOR-OS tripplet, but can be. The
+## full CPU-VENDOR-OS tripplet will be created by:
+## $ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host
+##
+erl_xcomp_host=
### ----------------------------------------------------------------------------
-### ---------------------------------------------------------------------------
### To override the configure flags for a special target system, You
### can set this variable which overrides configure parameters on the
### command line and instead uses the specified options. The variable
### leaves the build-host system untouched.
-### ---------------------------------------------------------------------------
+### ----------------------------------------------------------------------------
erl_xcomp_configure_flags=
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
### You can specify a specific CC or LD for the build target (the cross
### compiler) here along with magic CFLAGS and/or LDFLAGS if needed
### ar and ranlib might also be specified if needed.
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
erl_xcomp_cc=
@@ -106,7 +66,7 @@ erl_xcomp_ranlib=
erl_xcomp_ar=
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
### The ded_ls and ded_ldflags variables control linking of dynamically loaded
### erlang drivers. On i.e. Linux these are set to
### $(CC) and "-shared" respectively, but other OS'es might need other
@@ -114,7 +74,7 @@ erl_xcomp_ar=
### erl_xcomp_ded_ld_runtime_library_path is the flag to set a
### specific runtime library path for the shared library at link time,
### usually this should be left empty.
-###----------------------------------------------------------------------------
+###-----------------------------------------------------------------------------
erl_xcomp_ded_ld=
@@ -122,83 +82,117 @@ erl_xcomp_ded_ldflags=
erl_xcomp_ded_ld_runtime_library_path=
-### The variables in the following section does not need to be set. Only
-### set these if you really know what you are doing.
+###
+### Optional feature, or bug tests
+###
+### These tests cannot (always) be done automatically when cross compiling.
+### You usually does not need to set these variables. Only set these if you
+### really know what you are doing.
###
##
-## Big endian/little endian can usually be determined by configure correctly,
-## but if not, set this variable
-##
+## erl_xcomp_bigendian - yes|no
+## If yes, the target system must be big endian. If no, little endian. This
+## can often be automatically detected, but not always. If not automatically
+## detected, configure will fail unless this variable is set. No default value
+## is used, i.e., configure will try to figure this out automatically.
erl_xcomp_bigendian=
##
-## If you have a working poll that can be used: yes|no
+## erl_xcomp_linux_clock_gettime_correction - yes|no (defaults to yes)
+## If yes, clock_gettime(CLOCK_MONOTONIC, _) on the target system must work.
+## This variable is recommended to be set to no on Linux systems with kernel
+## versions less than 2.6.
+##
+erl_xcomp_linux_clock_gettime_correction=
+
+##
+## erl_xcomp_linux_nptl - yes|no (defaults to yes on Linux; otherwise, no)
+## If yes, the target system must have NPTL (Native POSIX Thread Library).
+## Older Linux systems have LinuxThreads instead of NPTL (Linux kernel
+## versions typically less than 2.6).
+##
+erl_xcomp_linux_nptl=
+
+##
+## erl_xcomp_linux_usable_sigusrx - yes|no (defaults to yes)
+## If yes, the SIGUSR1 and SIGUSR2 must be usable by the ERTS. Old
+## LinuxThreads thread libraries (Linux kernel versions less than 2.2) used
+## these signals and made them unusable by the ERTS.
+##
+erl_xcomp_linux_usable_sigusrx=
+
+##
+## erl_xcomp_linux_usable_sigaltstack - yes|no (defaults to yes)
+## If yes, sigaltstack() must be usable on the target system. sigaltstack()
+## on Linux kernel versions less than 2.4 are broken.
+##
+erl_xcomp_linux_usable_sigaltstack=
+
+##
+## erl_xcomp_poll - yes|no (defaults to no on Darwin/MacOSX; otherwise, yes)
+## If yes, the target system must have a working poll() implementation that
+## also can handle devices. If no, select() will be used instead of poll().
##
erl_xcomp_poll=
##
-## If you have a working kqueue() that can be used: yes|no
+## erl_xcomp_kqueue - yes|no (defaults to no)
+## If yes, the target system must have a working kqueue() implementation that
+## returns a file descriptor which can be used by poll() and/or select().
+## If no and the target system has not got epoll() or /dev/poll, the
+## kernel-poll feature will be disabled.
##
erl_xcomp_kqueue=
##
-## If you have a putenv() that stores a copy of the key-value pair: yes|no
+## erl_xcomp_putenv_copy - yes|no (defaults to no)
+## If yes, the target system must have a putenv() implementation that stores a
+## copy of the key/value pair.
##
erl_xcomp_putenv_copy=
##
-## If you have reliable floating point exeptions that can be
-## used: yes|no
+## erl_xcomp_reliable_fpe - yes|no (defaults to no)
+## If yes, the target system must have reliable floating point exceptions.
##
erl_xcomp_reliable_fpe=
##
-## If you have getaddrinfo() usable for ipv6: yes|no
+## erl_xcomp_getaddrinfo - yes|no (defaults to no)
+## If yes, the target system must have a working getaddrinfo() implementation
+## that can handle both IPv4 and IPv6.
##
erl_xcomp_getaddrinfo=
##
-## If you have a gethrvtime() that works and uses ioctl()
-## to /proc/self: yes|no
+## erl_xcomp_gethrvtime_procfs_ioctl - yes|no (defaults to no)
+## If yes, the target system must have a working gethrvtime() implementation
+## and is used with procfs ioctl().
##
erl_xcomp_gethrvtime_procfs_ioctl=
##
-## If you have a working clock_gettime(): yes|no
+## erl_xcomp_clock_gettime - yes|no (defaults to no)
+## If yes, the target system must have a working clock_gettime()
+## implementation that can be used for retrieving process CPU time.
##
erl_xcomp_clock_gettime=
##
-## If you have a __after_morecore_hook that can track malloc()s
-## core memory use: yes|no
+## erl_xcomp_after_morecore_hook - yes|no (defaults to no)
+## If yes, the target system must have a working __after_morecore_hook that
+## can be used for tracking used malloc() implementations core memory usage.
##
erl_xcomp_after_morecore_hook=
##
-## If you have brk, sbrk and end symbols: yes|no
-##
-# brk
-erl_xcomp_have_brk=
-# _brk
-erl_xcomp_have__brk=
-# __brk
-erl_xcomp_have___brk=
-# sbrk
-erl_xcomp_have_sbrk=
-# _sbrk
-erl_xcomp_have__sbrk=
-# __sbrk
-erl_xcomp_have___sbrk=
-# end
-erl_xcomp_end=
-# _end
-erl_xcomp__end=
-
-##
-## If sbrk/brk wrappers using dlsym(RTLD_NEXT, _) can track malloc()s
-## core memory use: yes|no
+## erl_xcomp_dlsym_brk_wrappers - yes|no (defaults to no)
+## If yes, the target system must have a working dlsym(RTLD_NEXT, <S>)
+## implementation that can be used on 'brk' and 'sbrk' symbols used by the
+## malloc() implementation in use, and by this track the malloc()
+## implementations core memory usage.
##
-erl_xcomp_brk_wrappers=
+erl_xcomp_dlsym_brk_wrappers=
### ----------------------------------------------------------------------------