Skip to content

Commit 1b78e85

Browse files
rickard-greenErlang/OTP
authored and
Erlang/OTP
committed
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.
1 parent 639e0b2 commit 1b78e85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4979
-2310
lines changed

Makefile.in

+245-46
Large diffs are not rendered by default.

README

+82-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The source code for Erlang/OTP can also be found in a Git repository:
1313

1414
%CopyrightBegin%
1515

16-
Copyright Ericsson AB 1998-2009. All Rights Reserved.
16+
Copyright Ericsson AB 1998-2010. All Rights Reserved.
1717

1818
The contents of this file are subject to the Erlang Public License,
1919
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
221221
Erlang/OTP system which you can try by typing "bin/erl". This should start
222222
up Erlang/OTP and give you a prompt.
223223

224-
Step 6 is optional. It installs Erlang/OTP (if you change your
225-
mind about where you wish to install you can rerun step 4, without
226-
having to do step 5 again).
224+
Step 6 is optional. It installs Erlang/OTP at a standardized location (if you
225+
change your mind about where you wish to install you can rerun step 4,
226+
without having to do step 5 again).
227+
228+
Alternative installation procedures:
229+
* Staged install using DESTDIR. You can perform the install phase in a
230+
temporary directory and later move the installation into its correct location
231+
by use of the DESTDIR variable: 'make DESTDIR=<tmp install dir> install'
232+
The installation will be created in a location prefixed by $DESTDIR. It
233+
can, however, not be run from there. It needs to be moved into the correct
234+
location before it can be run. If DESTDIR have not been set but INSTALL_PREFIX
235+
has been set, DESTDIR will be set to INSTALL_PREFIX. Note that INSTALL_PREFIX
236+
in pre R13B04 was buggy and behaved as EXTRA_PREFIX (see below). There are
237+
lots of areas of use for an installation procedure using DESTDIR, e.g. when
238+
creating a package, cross compiling, etc. Here is an example where the
239+
installation should be located under /opt/local:
240+
$ ./configure --prefix=/opt/local
241+
$ make
242+
$ mkdir /tmp/erlang-build
243+
$ make DESTDIR=/tmp/erlang-build install
244+
$ cd /tmp/erlang-build/opt/local
245+
$ # gnu-tar is used in this example
246+
$ tar -zcf /home/me/my-erlang-build.tgz *
247+
$ su -
248+
Password: *****
249+
$ cd /opt/local
250+
$ tar -zxf /home/me/my-erlang-build.tgz
251+
* Test install using EXTRA_PREFIX. Note that EXTRA_PREFIX is similar to
252+
DESTDIR, but it does not have the same effect as DESTDIR. The EXTRA_PREFIX
253+
variable will prefix all installation paths, and the installation can and
254+
have to be run from there. That is, it can be useful if you want to try the
255+
system out, running test suites, etc, before doing the real install without
256+
EXTRA_PREFIX.
257+
* Install using the `release' target. Instead of doing `make install' you can
258+
creat the installation in whatever directory you like using the `release'
259+
target and run the `Install' script yourself. RELEASE_ROOT is used for
260+
specifying the directory where the installation should be created. This is
261+
what by default ends up under `/usr/local/lib/erlang' if you do the install
262+
using `make install'. All installation paths provided in the `configure'
263+
phase are ignored, as well as DESTDIR, and INSTALL_PREFIX. If you want links
264+
from a specific `bin' directory to the installation you have to set those up
265+
yourself. An example where Erlang/OTP should be located at /home/me/OTP:
266+
$ ./configure
267+
$ make
268+
$ make RELEASE_ROOT=/home/me/OTP release
269+
$ cd /home/me/OTP
270+
$ ./Install -minimal /home/me/OTP
271+
$ mkdir -p /home/me/bin
272+
$ cd /home/me/bin
273+
$ ln -s /home/me/OTP/bin/erl erl
274+
$ ln -s /home/me/OTP/bin/erlc erlc
275+
$ ln -s /home/me/OTP/bin/escript escript
276+
...
277+
The `Install' script should currently be invoked as follows in the
278+
directory where it resides:
279+
`./Install [-cross] [-minimal|-sasl] <ERL_ROOT>'
280+
where:
281+
-minimal - Creates an installation that starts up a minimal amount
282+
of applications, i.e., only kernel and stdlib are started.
283+
The minimal system is normally enough.
284+
-sasl - Creates an installation that also starts up the sasl
285+
application.
286+
-cross - For cross compilation. Informs the install script that it
287+
is run on the build machine.
288+
<ERL_ROOT> - The absolute path to the Erlang installation to use at run
289+
time. This is often the same as the current working
290+
directory, but does not have to be. It can follow any other
291+
path through the file system to the same directory.
292+
293+
If neither -minimal, nor -sasl is passed as argument you will be prompted.
294+
295+
When doing `make install' and the default installation prefix is used, relative
296+
symbolic links will be created from /usr/local/bin to all public executables in
297+
the Erlang installation. The installation phase will try to create relative
298+
symbolic links as long as `--bindir' and the Erlang bin directory, located under
299+
`--libdir', both have `--exec-prefix' as prefix. Where `--exec-prefix'
300+
defaults to `--prefix'. `--prefix', `--exec-prefix', `--bindir', and `--libdir'
301+
are all arguments that can be passed to `configure'. One can however force
302+
relative, or absolute links by passing BINDIR_SYMLINKS=relative|absolute
303+
as arguments to make during the install phase. Note that such a request might
304+
cause a failure if the request cannot be satisfied.
227305

228306
The source tree is delivered with a lot of platform independent
229307
build results already pre-built. If you want to remove these pre-built

TAR.include

+3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ Makefile.in
44
README
55
README.win32
66
configure.in
7+
aclocal.m4
78
otp_build
89
lib/Makefile
910
lib/configure
1011
lib/configure.in
12+
lib/configure.in.src
1113
prebuild.skip
1214
prebuild.delete
15+
erl-build-tool-vars.sh
1316
bootstrap/lib/*/ebin
1417
bootstrap/lib/*/include
1518
bootstrap/bin/start*.script

aclocal.m4

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
erts/aclocal.m4

configure.in

+73-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
dnl Process this file with autoconf to produce a configure script.
2+
3+
dnl %CopyrightBegin%
4+
dnl
5+
dnl Copyright Ericsson AB 1998-2010. All Rights Reserved.
6+
dnl
7+
dnl The contents of this file are subject to the Erlang Public License,
8+
dnl Version 1.1, (the "License"); you may not use this file except in
9+
dnl compliance with the License. You should have received a copy of the
10+
dnl Erlang Public License along with this software. If not, it can be
11+
dnl retrieved online at http://www.erlang.org/.
12+
dnl
13+
dnl Software distributed under the License is distributed on an "AS IS"
14+
dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15+
dnl the License for the specific language governing rights and limitations
16+
dnl under the License.
17+
dnl
18+
dnl %CopyrightEnd%
19+
220
AC_PREREQ(2.8)dnl
321

422
AC_INIT()
523

24+
LM_PRECIOUS_VARS
25+
626
default_cache_file=./config.cache
727

828
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
1939
cache_file=/dev/null
2040
fi
2141

42+
case "X$ERL_TOP" in
43+
X)
44+
;;
45+
X/*)
46+
test -f $ERL_TOP/erts/emulator/beam/beam_emu.c || {
47+
AC_MSG_ERROR([Invalid \$ERL_TOP])
48+
}
49+
srcdir="$ERL_TOP";;
50+
*)
51+
AC_MSG_ERROR([\$ERL_TOP needs to be absolute]);;
52+
esac
53+
2254
dnl How to set srcdir absolute is taken from the GNU Emacs distribution
2355
#### Make srcdir absolute, if it isn't already. It's important to
2456
#### avoid running the path through pwd unnecessary, since pwd can
@@ -43,7 +75,7 @@ esac
4375
#
4476
# Now srcdir is absolute and also the top of Erlang distribution, ERL_TOP.
4577
#
46-
ERL_TOP=${srcdir}
78+
test "X$ERL_TOP" != "X" || ERL_TOP="$srcdir"
4779
AC_SUBST(ERL_TOP)
4880

4981
dnl
@@ -65,11 +97,35 @@ fi
6597
TARGET=$host
6698
AC_SUBST(TARGET)
6799

100+
if test X$cross_compiling = Xyes; then
101+
CROSS_COMPILING=yes
102+
else
103+
CROSS_COMPILING=no
104+
fi
105+
AC_SUBST(CROSS_COMPILING)
106+
107+
108+
AC_ARG_ENABLE(bootstrap-only,
109+
[ --enable-bootstrap-only enable bootstrap only configuration],
110+
[ if test "X$enableval" = "Xyes"; then
111+
BOOTSTRAP_ONLY=yes
112+
else
113+
BOOTSTRAP_ONLY=no
114+
fi
115+
],
116+
BOOTSTRAP_ONLY=no)
117+
118+
AC_SUBST(BOOTSTRAP_ONLY)
119+
120+
if test $CROSS_COMPILING = yes -a $BOOTSTRAP_ONLY = yes; then
121+
AC_MSG_ERROR([Cannot both cross compile and build a bootstrap system])
122+
fi
68123

69124
dnl Checks for programs.
70125

71126
AC_PROG_CC
72-
127+
AC_PROG_CXX
128+
AC_CHECK_TOOL(LD, [ld])
73129

74130
#
75131
# We need GNU make, complain if we can't find it
@@ -123,11 +179,17 @@ AC_PROG_LN_S
123179
AC_PROG_RANLIB
124180

125181
#
126-
# Get erts version from erts/vsn.mk
182+
# Get erts version and otp release from erts/vsn.mk
127183
#
128-
[ERTS=erts-`sed -n 's/^VSN[ ]*=[ ]*\([0-9.]\)/\1/p' < erts/vsn.mk`]
184+
AC_MSG_CHECKING([ERTS version])
185+
[ERTS=erts-`sed -n "s/^VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
186+
AC_MSG_RESULT([$ERTS])
129187
AC_SUBST(ERTS)
130188

189+
AC_MSG_CHECKING([OTP release])
190+
[OTP=OTP-`sed -n "s/^SYSTEM_VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
191+
AC_MSG_RESULT([$OTP])
192+
AC_SUBST(OTP)
131193

132194
AC_ARG_ENABLE(threads,
133195
[ --enable-threads enable async thread support
@@ -147,6 +209,11 @@ AC_ARG_ENABLE(kernel-poll,
147209
AC_ARG_ENABLE(hipe,
148210
[ --enable-hipe enable hipe support
149211
--disable-hipe disable hipe support])
212+
213+
AC_ARG_WITH(javac,
214+
[ --with-javac=JAVAC specify Java compiler to use
215+
--with-javac use a Java compiler if found (default)
216+
--without-javac don't use any Java compiler])
150217

151218
AC_ARG_ENABLE(megaco_flex_scanner_lineno,
152219
[ --enable-megaco-flex-scanner-lineno enable megaco flex scanner lineno
@@ -176,8 +243,8 @@ AC_ARG_ENABLE(erlang-mandir,
176243
[ --disable-erlang-mandir do not install Erlang man pages in a private directory],
177244
[ case "$enableval" in
178245
no) erl_mandir=$mandir ;;
179-
*) erl_mandir='$(ERLANG_ILIBDIR)/man' ;;
180-
esac ], erl_mandir='$(ERLANG_ILIBDIR)/man')
246+
*) erl_mandir='$(erlang_libdir)/man' ;;
247+
esac ], erl_mandir='$(erlang_libdir)/man')
181248
AC_SUBST(erl_mandir)
182249

183250
AC_ARG_ENABLE(darwin-universal,

erl-build-tool-vars.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# %CopyrightBegin%
3+
#
4+
# Copyright Ericsson AB 2010. All Rights Reserved.
5+
#
6+
# The contents of this file are subject to the Erlang Public License,
7+
# Version 1.1, (the "License"); you may not use this file except in
8+
# compliance with the License. You should have received a copy of the
9+
# Erlang Public License along with this software. If not, it can be
10+
# retrieved online at http://www.erlang.org/.
11+
#
12+
# Software distributed under the License is distributed on an "AS IS"
13+
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14+
# the License for the specific language governing rights and limitations
15+
# under the License.
16+
#
17+
# %CopyrightEnd%
18+
#
19+
20+
#
21+
# erl_build_tool_vars - Build tool configuration variables currently
22+
# reqognized by `configure' scripts in OTP.
23+
#
24+
# NOTE:
25+
# When updating, also update $ERL_TOP/xcomp/{README,erl-xcomp.conf.template},
26+
# and precious variables in $ERL_TOP/erts/aclocal.m4.
27+
#
28+
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"

0 commit comments

Comments
 (0)