Permalink
Browse files

OTP-8323 Cross compilation improvements and other build system

          improvements.

          Most notable:

          Lots of cross compilation improvements. The old cross compilation
          support was more or less non-existing as well as broken. Please,
          note that the cross compilation support should still be
          considered as experimental. Also note that old cross compilation
          configurations cannot be used without modifications. For more
          information on cross compiling Erlang/OTP see the
          $ERL_TOP/xcomp/README file.

          Support for staged install using <url
          href="http://www.gnu.org/prep/standards/html_node/DESTDIR.html">D
          ESTDIR</url>. The old broken INSTALL_PREFIX has also been fixed.
          For more information see the $ERL_TOP/README file.

          Documentation of the release target of the top Makefile. For more
          information see the $ERL_TOP/README file.

          make install now by default creates relative symbolic links
          instead of absolute ones. For more information see the
          $ERL_TOP/README file.

          $ERL_TOP/configure --help=recursive now works and prints help for
          all applications with configure scripts.

          Doing make install, or make release directly after make all no
          longer triggers miscellaneous rebuilds.

          Existing bootstrap system is now used when doing make install, or
          make release without a preceding make all.

          The crypto and ssl applications use the same runtime library path
          when dynamically linking against libssl.so and libcrypto.so. The
          runtime library search path has also been extended.

          The configure scripts of erl_interface and odbc now search for
          thread libraries and thread library quirks the same way as erts
          do.

          The configure script of the odbc application now also looks for
          odbc libraries in lib64 and lib/64 directories when building on a
          64-bit system.

          The config.h.in file in the erl_interface application is now
          automatically generated in instead of statically updated which
          reduces the risk of configure tests without any effect.
  • Loading branch information...
1 parent 639e0b2 commit 1b78e85c9b6097f0d1940793e5fed4e08c0794f9 @rickard-green rickard-green committed with Erlang/OTP Feb 3, 2010
Showing with 4,979 additions and 2,310 deletions.
  1. +245 −46 Makefile.in
  2. +82 −4 README
  3. +3 −0 TAR.include
  4. +1 −0 aclocal.m4
  5. +73 −6 configure.in
  6. +28 −0 erl-build-tool-vars.sh
  7. +319 −179 erts/aclocal.m4
  8. +3 −1 erts/autoconf/win32.config.cache
  9. +394 −151 erts/configure.in
  10. +6 −9 erts/etc/common/Makefile.in
  11. +17 −40 erts/etc/unix/Install.src
  12. +7 −7 erts/start_scripts/Makefile
  13. +14 −7 erts/test/Makefile
  14. +727 −0 erts/test/install_SUITE.erl
  15. +2 −0 erts/test/install_SUITE_data/dirname
  16. +8 −8 lib/Makefile
  17. +118 −6 lib/asn1/c_src/Makefile
  18. +0 −139 lib/asn1/c_src/Makefile.in
  19. +0 −37 lib/configure.in
  20. +61 −0 lib/configure.in.src
  21. +10 −18 lib/crypto/c_src/Makefile.in
  22. +44 −120 lib/erl_interface/configure.in
  23. +6 −6 lib/erl_interface/src/Makefile.in
  24. +0 −277 lib/erl_interface/src/auxdir/config.h.in
  25. +9 −6 lib/hipe/rtl/Makefile
  26. +64 −49 lib/megaco/configure.in
  27. +52 −28 lib/megaco/src/flex/Makefile.in
  28. +5 −8 lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src
  29. +1 −0 lib/odbc/aclocal.m4
  30. +11 −11 lib/odbc/c_src/Makefile.in
  31. +71 −89 lib/odbc/configure.in
  32. +13 −18 lib/runtime_tools/c_src/Makefile.in
  33. +15 −7 lib/ssl/c_src/Makefile.in
  34. +10 −13 lib/wx/c_src/Makefile.in
  35. +14 −7 lib/wx/configure.in
  36. +147 −0 make/cross_check_erl
  37. +702 −0 make/install_bin
  38. +35 −9 make/otp_ded.mk.in
  39. +29 −0 make/unexpected_use
  40. +323 −284 otp_build
  41. +1 −0 prebuild.skip
  42. +376 −163 xcomp/README
  43. +216 −180 xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
  44. +29 −0 xcomp/erl-xcomp-vars.sh
  45. +217 −180 xcomp/erl-xcomp-vxworks_ppc32.conf
  46. +236 −0 xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf
  47. +235 −197 xcomp/erl-xcomp.conf.template
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
86 README
@@ -13,7 +13,7 @@ The source code for Erlang/OTP can also be found in a Git repository:
%CopyrightBegin%
-Copyright Ericsson AB 1998-2009. All Rights Reserved.
+Copyright Ericsson AB 1998-2010. 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
@@ -221,9 +221,87 @@ Step 5 builds the Erlang/OTP system. On a fast computer, this will take about
Erlang/OTP system which you can try by typing "bin/erl". This should start
up Erlang/OTP and give you a prompt.
-Step 6 is optional. It installs Erlang/OTP (if you change your
-mind about where you wish to install you can rerun step 4, without
-having to do step 5 again).
+Step 6 is optional. It installs Erlang/OTP at a standardized location (if you
+change your mind about where you wish to install you can rerun step 4,
+without having to do step 5 again).
+
+Alternative installation procedures:
+* Staged install using DESTDIR. You can perform the install phase in a
+ temporary directory and later move the installation into its correct location
+ by use of the DESTDIR variable: 'make DESTDIR=<tmp install dir> install'
+ The installation will be created in a location prefixed by $DESTDIR. It
+ can, however, not be run from there. It needs to be moved into the correct
+ location before it can be run. If DESTDIR have not been set but INSTALL_PREFIX
+ has been set, DESTDIR will be set to INSTALL_PREFIX. Note that INSTALL_PREFIX
+ in pre R13B04 was buggy and behaved as EXTRA_PREFIX (see below). There are
+ lots of areas of use for an installation procedure using DESTDIR, e.g. when
+ creating a package, cross compiling, etc. Here is an example where the
+ installation should be located under /opt/local:
+ $ ./configure --prefix=/opt/local
+ $ make
+ $ mkdir /tmp/erlang-build
+ $ make DESTDIR=/tmp/erlang-build install
+ $ cd /tmp/erlang-build/opt/local
+ $ # gnu-tar is used in this example
+ $ tar -zcf /home/me/my-erlang-build.tgz *
+ $ su -
+ Password: *****
+ $ cd /opt/local
+ $ tar -zxf /home/me/my-erlang-build.tgz
+* Test install using EXTRA_PREFIX. Note that EXTRA_PREFIX is similar to
+ DESTDIR, but it does not have the same effect as DESTDIR. The EXTRA_PREFIX
+ variable will prefix all installation paths, and the installation can and
+ have to be run from there. That is, it can be useful if you want to try the
+ system out, running test suites, etc, before doing the real install without
+ EXTRA_PREFIX.
+* Install using the `release' target. Instead of doing `make install' you can
+ creat the installation in whatever directory you like using the `release'
+ target and run the `Install' script yourself. RELEASE_ROOT is used for
+ specifying the directory where the installation should be created. This is
+ what by default ends up under `/usr/local/lib/erlang' if you do the install
+ using `make install'. All installation paths provided in the `configure'
+ phase are ignored, as well as DESTDIR, and INSTALL_PREFIX. If you want links
+ from a specific `bin' directory to the installation you have to set those up
+ yourself. An example where Erlang/OTP should be located at /home/me/OTP:
+ $ ./configure
+ $ make
+ $ make RELEASE_ROOT=/home/me/OTP release
+ $ cd /home/me/OTP
+ $ ./Install -minimal /home/me/OTP
+ $ mkdir -p /home/me/bin
+ $ cd /home/me/bin
+ $ ln -s /home/me/OTP/bin/erl erl
+ $ ln -s /home/me/OTP/bin/erlc erlc
+ $ ln -s /home/me/OTP/bin/escript escript
+ ...
+ The `Install' script should currently be invoked as follows in the
+ directory where it resides:
+ `./Install [-cross] [-minimal|-sasl] <ERL_ROOT>'
+ where:
+ -minimal - Creates an installation that starts up a minimal amount
+ of applications, i.e., only kernel and stdlib are started.
+ The minimal system is normally enough.
+ -sasl - Creates an installation that also starts up the sasl
+ application.
+ -cross - For cross compilation. Informs the install script that it
+ is run on the build machine.
+ <ERL_ROOT> - The absolute path to the Erlang installation to use at run
+ time. This is often the same as the current working
+ directory, but does not have to be. It can follow any other
+ path through the file system to the same directory.
+
+ If neither -minimal, nor -sasl is passed as argument you will be prompted.
+
+When doing `make install' and the default installation prefix is used, relative
+symbolic links will be created from /usr/local/bin to all public executables in
+the Erlang installation. The installation phase will try to create relative
+symbolic links as long as `--bindir' and the Erlang bin directory, located under
+`--libdir', both have `--exec-prefix' as prefix. Where `--exec-prefix'
+defaults to `--prefix'. `--prefix', `--exec-prefix', `--bindir', and `--libdir'
+are all arguments that can be passed to `configure'. One can however force
+relative, or absolute links by passing BINDIR_SYMLINKS=relative|absolute
+as arguments to make during the install phase. Note that such a request might
+cause a failure if the request cannot be satisfied.
The source tree is delivered with a lot of platform independent
build results already pre-built. If you want to remove these pre-built
View
@@ -4,12 +4,15 @@ Makefile.in
README
README.win32
configure.in
+aclocal.m4
otp_build
lib/Makefile
lib/configure
lib/configure.in
+lib/configure.in.src
prebuild.skip
prebuild.delete
+erl-build-tool-vars.sh
bootstrap/lib/*/ebin
bootstrap/lib/*/include
bootstrap/bin/start*.script
View
View
@@ -1,8 +1,28 @@
dnl Process this file with autoconf to produce a configure script.
+
+dnl %CopyrightBegin%
+dnl
+dnl Copyright Ericsson AB 1998-2010. All Rights Reserved.
+dnl
+dnl The contents of this file are subject to the Erlang Public License,
+dnl Version 1.1, (the "License"); you may not use this file except in
+dnl compliance with the License. You should have received a copy of the
+dnl Erlang Public License along with this software. If not, it can be
+dnl retrieved online at http://www.erlang.org/.
+dnl
+dnl Software distributed under the License is distributed on an "AS IS"
+dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+dnl the License for the specific language governing rights and limitations
+dnl under the License.
+dnl
+dnl %CopyrightEnd%
+
AC_PREREQ(2.8)dnl
AC_INIT()
+LM_PRECIOUS_VARS
+
default_cache_file=./config.cache
if test "x$no_recursion" != "xyes" -a "x$OVERRIDE_CONFIG_CACHE" = "x"; then
@@ -19,6 +39,18 @@ if test "x$no_recursion" != "xyes" -a "x$OVERRIDE_CONFIG_CACHE" = "x"; then
cache_file=/dev/null
fi
+case "X$ERL_TOP" in
+ X)
+ ;;
+ X/*)
+ test -f $ERL_TOP/erts/emulator/beam/beam_emu.c || {
+ AC_MSG_ERROR([Invalid \$ERL_TOP])
+ }
+ srcdir="$ERL_TOP";;
+ *)
+ AC_MSG_ERROR([\$ERL_TOP needs to be absolute]);;
+esac
+
dnl How to set srcdir absolute is taken from the GNU Emacs distribution
#### Make srcdir absolute, if it isn't already. It's important to
#### avoid running the path through pwd unnecessary, since pwd can
@@ -43,7 +75,7 @@ esac
#
# Now srcdir is absolute and also the top of Erlang distribution, ERL_TOP.
#
-ERL_TOP=${srcdir}
+test "X$ERL_TOP" != "X" || ERL_TOP="$srcdir"
AC_SUBST(ERL_TOP)
dnl
@@ -65,11 +97,35 @@ fi
TARGET=$host
AC_SUBST(TARGET)
+if test X$cross_compiling = Xyes; then
+ CROSS_COMPILING=yes
+else
+ CROSS_COMPILING=no
+fi
+AC_SUBST(CROSS_COMPILING)
+
+
+AC_ARG_ENABLE(bootstrap-only,
+[ --enable-bootstrap-only enable bootstrap only configuration],
+[ if test "X$enableval" = "Xyes"; then
+ BOOTSTRAP_ONLY=yes
+ else
+ BOOTSTRAP_ONLY=no
+ fi
+],
+BOOTSTRAP_ONLY=no)
+
+AC_SUBST(BOOTSTRAP_ONLY)
+
+if test $CROSS_COMPILING = yes -a $BOOTSTRAP_ONLY = yes; then
+ AC_MSG_ERROR([Cannot both cross compile and build a bootstrap system])
+fi
dnl Checks for programs.
AC_PROG_CC
-
+AC_PROG_CXX
+AC_CHECK_TOOL(LD, [ld])
#
# We need GNU make, complain if we can't find it
@@ -123,11 +179,17 @@ AC_PROG_LN_S
AC_PROG_RANLIB
#
-# Get erts version from erts/vsn.mk
+# Get erts version and otp release from erts/vsn.mk
#
-[ERTS=erts-`sed -n 's/^VSN[ ]*=[ ]*\([0-9.]\)/\1/p' < erts/vsn.mk`]
+AC_MSG_CHECKING([ERTS version])
+[ERTS=erts-`sed -n "s/^VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
+AC_MSG_RESULT([$ERTS])
AC_SUBST(ERTS)
+AC_MSG_CHECKING([OTP release])
+[OTP=OTP-`sed -n "s/^SYSTEM_VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
+AC_MSG_RESULT([$OTP])
+AC_SUBST(OTP)
AC_ARG_ENABLE(threads,
[ --enable-threads enable async thread support
@@ -147,6 +209,11 @@ AC_ARG_ENABLE(kernel-poll,
AC_ARG_ENABLE(hipe,
[ --enable-hipe enable hipe support
--disable-hipe disable hipe support])
+
+AC_ARG_WITH(javac,
+[ --with-javac=JAVAC specify Java compiler to use
+ --with-javac use a Java compiler if found (default)
+ --without-javac don't use any Java compiler])
AC_ARG_ENABLE(megaco_flex_scanner_lineno,
[ --enable-megaco-flex-scanner-lineno enable megaco flex scanner lineno
@@ -176,8 +243,8 @@ AC_ARG_ENABLE(erlang-mandir,
[ --disable-erlang-mandir do not install Erlang man pages in a private directory],
[ case "$enableval" in
no) erl_mandir=$mandir ;;
- *) erl_mandir='$(ERLANG_ILIBDIR)/man' ;;
- esac ], erl_mandir='$(ERLANG_ILIBDIR)/man')
+ *) erl_mandir='$(erlang_libdir)/man' ;;
+ esac ], erl_mandir='$(erlang_libdir)/man')
AC_SUBST(erl_mandir)
AC_ARG_ENABLE(darwin-universal,
View
@@ -0,0 +1,28 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2010. 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%
+#
+
+#
+# erl_build_tool_vars - Build tool configuration variables currently
+# reqognized by `configure' scripts in OTP.
+#
+# NOTE:
+# When updating, also update $ERL_TOP/xcomp/{README,erl-xcomp.conf.template},
+# and precious variables in $ERL_TOP/erts/aclocal.m4.
+#
+erl_build_tool_vars="CC CFLAGS STATIC_CFLAGS CFLAG_RUNTIME_LIBRARY_PATH CPP CPPFLAGS CXX CXXFLAGS LD LDFLAGS DED_LD DED_LDFLAGS DED_LD_FLAG_RUNTIME_LIBRARY_PATH RANLIB AR"
Oops, something went wrong.

0 comments on commit 1b78e85

Please sign in to comment.