Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 1503 lines (1359 sloc) 41.442 kb
84adefa The R13B03 release.
Erlang/OTP authored
1 #! /bin/sh
4c67dcc Rickard Green OTP-8323 Miscellaneous cross compilation improvements. For example, one
rickard-green authored
2 #
3 # %CopyrightBegin%
c64a6e7 Tuncer Ayaz Make newline in RHS of lib/configure sed substition more portable
tuncer authored
4 #
ad5a151 Björn-Egil Dahlberg Update copyright years
psyeugenic authored
5 # Copyright Ericsson AB 2002-2011. All Rights Reserved.
c64a6e7 Tuncer Ayaz Make newline in RHS of lib/configure sed substition more portable
tuncer authored
6 #
4c67dcc Rickard Green OTP-8323 Miscellaneous cross compilation improvements. For example, one
rickard-green authored
7 # The contents of this file are subject to the Erlang Public License,
8 # Version 1.1, (the "License"); you may not use this file except in
9 # compliance with the License. You should have received a copy of the
10 # Erlang Public License along with this software. If not, it can be
11 # retrieved online at http://www.erlang.org/.
c64a6e7 Tuncer Ayaz Make newline in RHS of lib/configure sed substition more portable
tuncer authored
12 #
4c67dcc Rickard Green OTP-8323 Miscellaneous cross compilation improvements. For example, one
rickard-green authored
13 # Software distributed under the License is distributed on an "AS IS"
14 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15 # the License for the specific language governing rights and limitations
16 # under the License.
c64a6e7 Tuncer Ayaz Make newline in RHS of lib/configure sed substition more portable
tuncer authored
17 #
4c67dcc Rickard Green OTP-8323 Miscellaneous cross compilation improvements. For example, one
rickard-green authored
18 # %CopyrightEnd%
19 #
84adefa The R13B03 release.
Erlang/OTP authored
20
21 # Expected autoconf version
22 EXPECTED_AUTOCONF_VERSION=2.59
23
24 # Global configuration variables
25 #
812812e Björn Gustavsson Fix spelling, remove obsolete command
bjorng authored
26 # NOTE: lazy_configure depends on '.' always being last directory
84adefa The R13B03 release.
Erlang/OTP authored
27 if [ -z "$ONLY_ERTS" ]; then
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
28 AUTOCONF_SUBDIRS="lib lib/* lib/test_server/src"
84adefa The R13B03 release.
Erlang/OTP authored
29 fi
30 AUTOCONF_SUBDIRS="$AUTOCONF_SUBDIRS erts ."
31
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
32 # `bootstrap_apps' should include application that are built, or
33 # partly built in one of the bootstrap phases. Applications that
34 # only get some static includes copied into the bootstrap directory
35 # should not be included.
36 bootstrap_apps="erts lib/asn1 lib/compiler lib/hipe lib/ic lib/kernel lib/parsetools lib/sasl lib/snmp lib/stdlib lib/syntax_tools"
37
38 # We will quote a bit more than needed, but the important thing is that
39 # all that needs quoting will be quoted...
70f9744 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
40 DONT_QUOTE="A-Za-z0-9~/=_+-"
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
41
84adefa The R13B03 release.
Erlang/OTP authored
42 # Utility functions
43 usage ()
44 {
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
45 echo "Available options (-a switch select all applications):"
84adefa The R13B03 release.
Erlang/OTP authored
46 echo " setup [-a] [<configure parameters>] - does autoconf, configure and boot."
47 echo " all [-a] <dir> - does autoconf, configure, boot, release"
48 echo " autoconf - (re)build the configure scripts"
49 echo " configure [<configure parameters>] - does the actual configuration"
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
50 echo " boot [-a] - bootstraps and builds the system (after configure)"
84adefa The R13B03 release.
Erlang/OTP authored
51 echo " release <target_dir> - creates a small release to <target_dir>"
52 echo " release [-a] <target_dir> - creates full release to <target_dir>"
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
53 echo " smp [-a] - build an Erlang system, smp flavor only"
54 echo " hybrid [-a] - build an Erlang system, hybrid flavor only"
84adefa The R13B03 release.
Erlang/OTP authored
55 echo " tests <dir> - Build testsuites to <dir>"
56 echo ""
57 echo "These are for cleaning up an open source distribution"
58 echo "with prebuilt files, so that it resembles the clean developers"
59 echo "codebase:"
60 echo " remove_prebuilt_files - create a minimal source tree"
61 echo " save_bootstrap - recreate primary bootstrap"
62 echo ""
63 echo "Special targets for Windows(tm) build:"
64 echo " debuginfo_win32 <dir> - adds debug emulator and pdb files to <dir>"
65 echo " installer_win32 <dir> - creates a windows installer from <dir>"
66 echo ""
67 echo "Before trying to build on windows, consider the following option"
e78a158 Patrik Nyblom Make Win64 build work both under MSYS and Cygwin
bufflig authored
68 echo " env_win32 [<arch>] - echo environment settings for win32 with visual C++, use with eval"
69 echo " The optional <arch> can be x64 for 64bit Windows 7"
70 echo " or x86 for 32bit Windows XP+"
71 echo " env_win64 - echo environment settings for win32 with visual C++, use with eval"
72 echo " Note that env_win32 x64 gives the same result, Windows 7 64bit"
84adefa The R13B03 release.
Erlang/OTP authored
73 echo " env_mingw32 - echo environment settings for win32 with MinGW, use with eval"
e78a158 Patrik Nyblom Make Win64 build work both under MSYS and Cygwin
bufflig authored
74 echo " - experimental!"
75 echo " env_msys64 - echo environment settings for win32 with visual C++ running "
76 echo " msys and mingw, use with eval"
77 echo " - experimental!"
84adefa The R13B03 release.
Erlang/OTP authored
78 echo ""
79 echo "Before trying to build for vxworks, consider the following option"
80 echo " env_vxworks <cpu> - echo environment settings for vxworks, use with eval"
81 echo ""
3e4db41 Björn Gustavsson Support updating the primary bootstrap in a git repository
bjorng authored
82 case $version_controller in
83 none)
84 ;;
85 git)
86 echo ""
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
87 echo "update_primary [--no-commit] - build and maybe commit a new primary bootstrap"
3e4db41 Björn Gustavsson Support updating the primary bootstrap in a git repository
bjorng authored
88 ;;
89 esac
90
9c1b2d0 Björn Gustavsson Support updating preloaded files in a git repository
bjorng authored
91 case $version_controller in
92 none)
93 ;;
94 git)
95 echo ""
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
96 echo "update_preloaded [--no-commit] - build and maybe commit the preloaded modules"
9c1b2d0 Björn Gustavsson Support updating preloaded files in a git repository
bjorng authored
97 ;;
98 esac
84adefa The R13B03 release.
Erlang/OTP authored
99 }
100
aa7696f Björn Gustavsson otp_build: Remove Clearcase support for primary bootstrap and preloaded ...
bjorng authored
101 git_required ()
102 {
103 echo "This operation must be run in a git repository."
104 exit 1
105 }
106
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
107 hide_vars ()
84adefa The R13B03 release.
Erlang/OTP authored
108 {
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
109 script=
110 for var in "$@"; do
111 if [ "X$var" != "X" ]; then
112 script="$script test \"X\$$var\" = \"X\" || hidden_$var=\$$var; unset $var;"
113 fi
114 done
115 if [ "X$script" != "X" ]; then
116 eval "$script"
84adefa The R13B03 release.
Erlang/OTP authored
117 fi
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
118 unset script
4c67dcc Rickard Green OTP-8323 Miscellaneous cross compilation improvements. For example, one
rickard-green authored
119 }
120
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
121 restore_vars ()
4c67dcc Rickard Green OTP-8323 Miscellaneous cross compilation improvements. For example, one
rickard-green authored
122 {
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
123 script=
124 for var in "$@"; do
125 if [ "X$var" != "X" ]; then
126 script="$script unset $var; test \"X\$hidden_$var\" = \"X\" || { $var=\$hidden_$var; export $var; } ; unset hidden_$var;"
127 fi
128 done
129 if [ "X$script" != "X" ]; then
130 eval "$script"
84adefa The R13B03 release.
Erlang/OTP authored
131 fi
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
132 unset script
84adefa The R13B03 release.
Erlang/OTP authored
133 }
134
135
136 check_erltop ()
137 {
138 ERLTOP_FORCED=false
139 if [ "X$ERL_TOP" = "X" ]; then
140 if [ -f ./otp_build -a -f ./erts/autoconf/config.guess ]; then
141 ERLTOP_FORCED=true
142 ERL_TOP=`/bin/pwd`
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
143 export ERL_TOP
84adefa The R13B03 release.
Erlang/OTP authored
144 else
145 echo "The environment variable ERL_TOP must be set." >&2
146 exit 1
147 fi
148 fi
149 }
150
151 target_contains ()
152 {
153 Y=`echo $TARGET | sed "s,$1,,g"`
154 [ X"$Y" != X"$TARGET" ]
155 return $?
156 }
157
faac812 Björn Gustavsson Determine which VCS is being used
bjorng authored
158 determine_version_controller ()
159 {
160 version_controller=none
84adefa The R13B03 release.
Erlang/OTP authored
161
aa7696f Björn Gustavsson otp_build: Remove Clearcase support for primary bootstrap and preloaded ...
bjorng authored
162 # The current directory is now $ERL_TOP. Find out whether
163 # this directory is a git repository.
84adefa The R13B03 release.
Erlang/OTP authored
164
c6bf34b Rickard Green Silenced erroneous "git: not found" printout on solaris.
rickard-green authored
165 if { git rev-parse --git-dir; } 2>/dev/null >/dev/null; then
faac812 Björn Gustavsson Determine which VCS is being used
bjorng authored
166 version_controller=git
167 fi
168 }
84adefa The R13B03 release.
Erlang/OTP authored
169 # Execution of the different options
170
171 # Special static config flags for certain platforms are set here
172 set_config_flags ()
173 {
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
174 # * Extra flags to pass to configure are placed in `CONFIG_FLAGS'.
175 # * The command line is no longer added to `CONFIG_FLAGS' by
176 # `set_config_flags'. It is instead passed directly to
177 # `run_configure', or added to `CONFIG_FLAGS' at some other
178 # place.
179 # * `CONFIG_FLAGS' may contain flags when `set_config_flags' is
180 # called. These flags should survive the call to `set_config_flags'
181 # (in the cross compilation case the whole command line as well as
182 # the cross configuration have been moved here).
183
84adefa The R13B03 release.
Erlang/OTP authored
184 if target_contains linux; then
327c072 Sverker Eriksson otp_build: Disable FPE by default on Linux
sverker authored
185 XX=`echo $* | grep -v able-fp-exceptions`
84adefa The R13B03 release.
Erlang/OTP authored
186 if [ "$*" = "$XX" ]; then
327c072 Sverker Eriksson otp_build: Disable FPE by default on Linux
sverker authored
187 CONFIG_FLAGS="$CONFIG_FLAGS --disable-fp-exceptions"
84adefa The R13B03 release.
Erlang/OTP authored
188 fi
189 fi
190 if target_contains "univel-sysv4"; then
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
191 CONFIG_FLAGS="$CONFIG_FLAGS --x-libraries=/usr/lib/X11"
84adefa The R13B03 release.
Erlang/OTP authored
192 fi
193
194 if target_contains free_source; then
195 CONFIG_FLAGS="$CONFIG_FLAGS --host=$TARGET"
196 fi
8c1b518 Björn-Egil Dahlberg Remove static ssl linking in crypto for otp_build
psyeugenic authored
197 # Link SSL static for win32 binary distributions if not overridden
84adefa The R13B03 release.
Erlang/OTP authored
198 if target_contains win32; then
8c1b518 Björn-Egil Dahlberg Remove static ssl linking in crypto for otp_build
psyeugenic authored
199 XX=`echo $* | grep -v dynamic-ssl-lib`
200 if [ "$*" = "$XX" ]; then
201 CONFIG_FLAGS="--disable-dynamic-ssl-lib $CONFIG_FLAGS"
202 fi
20c9d6e Patrik Nyblom Link OpenSSL libraries static on Windows
bufflig authored
203 CONFIG_FLAGS="--build=$BUILDSYS build_alias=win32 --host=win32 --target=win32 $CONFIG_FLAGS"
84adefa The R13B03 release.
Erlang/OTP authored
204 fi
8c1b518 Björn-Egil Dahlberg Remove static ssl linking in crypto for otp_build
psyeugenic authored
205
20c9d6e Patrik Nyblom Link OpenSSL libraries static on Windows
bufflig authored
206
84adefa The R13B03 release.
Erlang/OTP authored
207 if [ "x$OVERRIDE_CONFIG_CACHE" = "x" ]; then
208 CONFIG_FLAGS="$CONFIG_FLAGS --cache-file=/dev/null"
209 else
210 CONFIG_FLAGS="$CONFIG_FLAGS --cache-file=$OVERRIDE_CONFIG_CACHE"
211 fi
212
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
213 env_to_config_flags $erl_build_tool_vars
214
84adefa The R13B03 release.
Erlang/OTP authored
215 export CONFIG_FLAGS;
216 }
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
217
c64a6e7 Tuncer Ayaz Make newline in RHS of lib/configure sed substition more portable
tuncer authored
218 NL="\
219 "
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
220 create_lib_configure_in()
221 {
222 cd $ERL_TOP
223
224 # Multiple versions of autoconf generates code that
225 # don't work on all platforms (e.g. SunOS 5.8) if
226 # sub directories are soft links. Internally at Ericsson
227 # some OTP application directories are soft links.
228 # An added "/." solves this problem.
229
230 sdirs=
231 for lib_app in $bootstrap_apps; do
232 case $lib_app in
233 lib/*)
234 if [ -f "$lib_app/configure.in" ]; then
235 app=`echo "$lib_app" | sed "s|lib/\(.*\)|\1|"`
c64a6e7 Tuncer Ayaz Make newline in RHS of lib/configure sed substition more portable
tuncer authored
236 sdirs="${sdirs}test ! -f $app/configure || AC_CONFIG_SUBDIRS($app/.)${NL}"
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
237 fi;;
238 *)
239 ;;
240 esac
241 done
242
243 sed_bootstrap="s%@BOOTSTRAP_CONFIGURE_APPS@%$sdirs%g"
244
245 sdirs=
246 for lib_app in lib/*; do
247 is_bapp=false
248 for bapp in $bootstrap_apps; do
249 test $bapp != $lib_app || { is_bapp=true; break; }
250 done
251 if [ $is_bapp = false ] && [ -f "$lib_app/configure.in" ]; then
252 app=`echo "$lib_app" | sed "s|lib/\(.*\)|\1|"`
c64a6e7 Tuncer Ayaz Make newline in RHS of lib/configure sed substition more portable
tuncer authored
253 sdirs="${sdirs} test ! -f $app/configure || AC_CONFIG_SUBDIRS($app/.)${NL}"
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
254 fi
255 done
256
257 sed_non_bootstrap="s%@NON_BOOTSTRAP_CONFIGURE_APPS@%$sdirs%g"
258
259 rm -f lib/configure.in
260 sed "$sed_bootstrap;$sed_non_bootstrap" > lib/configure.in < lib/configure.in.src || {
261 echo "Failed to create lib/configure.in"
262 exit 1
263 }
264 }
265
42da126 Patrik Nyblom Make whole of OTP build and release on Win64
bufflig authored
266 find_sum()
267 {
268 candidates="sum cksum md5sum sha1sum"
269 SUM_CMD="wc"
270 for x in $candidates; do
271 if (echo foo | $x > /dev/null 2>&1); then
272 SUM_CMD=$x
273 break
274 fi
275 done
276 }
277
278 chk_eq()
279 {
280 master=$1
281 shift
282 slaves="$@"
283 master_sum=`$SUM_CMD $master | awk '{print $1}'`
284 for x in $slaves; do
285 s=`$SUM_CMD $x | awk '{print $1}'`
286 if test "$s" != "$master_sum"; then
287 echo "Error: $master and $x are not equal, make sure they are!" >&2
e78a158 Patrik Nyblom Make Win64 build work both under MSYS and Cygwin
bufflig authored
288 echo "Maybe you would want to:" >&2
289 echo "for x in $slaves; do cp $master \$x; done" >&2
290 echo "? Or something else is wrong." 2>&1
291 exit 2
42da126 Patrik Nyblom Make whole of OTP build and release on Win64
bufflig authored
292 fi
293 done
294 }
295
296 check_config_helpers ()
297 {
298
299 aclocals="./aclocal.m4 ./lib/erl_interface/aclocal.m4 ./lib/odbc/aclocal.m4 ./lib/wx/aclocal.m4"
300 install_shs="./lib/common_test/priv/auxdir/install-sh ./lib/erl_interface/src/auxdir/install-sh ./lib/test_server/src/install-sh"
301 config_guesses="./lib/common_test/priv/auxdir/config.guess ./lib/erl_interface/src/auxdir/config.guess ./lib/test_server/src/config.guess"
302 config_subs="./lib/common_test/priv/auxdir/config.sub ./lib/erl_interface/src/auxdir/config.sub ./lib/test_server/src/config.sub"
303
304 aclocal_master="./erts/aclocal.m4"
305 install_sh_master="./erts/autoconf/install-sh"
306 config_guess_master="./erts/autoconf/config.guess"
307 config_sub_master="./erts/autoconf/config.sub"
308
309 find_sum
310
311 chk_eq $aclocal_master $aclocals
312 chk_eq $install_sh_master $install_shs
313 chk_eq $config_guess_master $config_guesses
314 chk_eq $config_sub_master $config_subs
315
316 }
317
84adefa The R13B03 release.
Erlang/OTP authored
318 do_autoconf ()
319 {
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
320 create_lib_configure_in
42da126 Patrik Nyblom Make whole of OTP build and release on Win64
bufflig authored
321 check_config_helpers
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
322
84adefa The R13B03 release.
Erlang/OTP authored
323 if target_contains win32; then
324 # Select the correct autoconf on cygwin
325 save_want_autoconf_ver=$WANT_AUTOCONF_VER
326 WANT_AUTOCONF_VER=$EXPECTED_AUTOCONF_VERSION
327 export WANT_AUTOCONF_VER
328 fi
329 exp_ac_vsn=$EXPECTED_AUTOCONF_VERSION
330 ac_vsn_blob=`autoconf --version`
331 ac_vsn=`echo x$ac_vsn_blob | sed "s|[^0-9]*\([0-9][^ \t\n]*\).*|\1|"`
332 case "$ac_vsn" in
333 $exp_ac_vsn)
334 ;;
335 *)
336 echo "***************************************************" 1>&2
337 echo "***************************************************" 1>&2
338 echo "*** WARNING: System might fail to configure or" 1>&2
339 echo "*** might be erroneously configured" 1>&2
340 echo "*** since autoconf version $ac_vsn is used" 1>&2
341 echo "*** instead of version $exp_ac_vsn!" 1>&2
342 echo "***************************************************" 1>&2
343 echo "***************************************************" 1>&2
344 ;;
345 esac
346
347 if [ ! -z "$OVERRIDE_CONFIGURE" ]; then
348 echo "Autoconf disabled on target $TARGET, but is performed on host" >&2
349 # We still use erts configure for erl_interface and VxWorks
350 case "$TARGET" in
351 *vxworks*)
352 AUTOCONF_SUBDIRS=`echo $AUTOCONF_SUBDIRS | \
353 sed -e 's,lib/erl_interface,,' \
354 -e 's,lib/gs,,' \
355 -e 's,lib/megaco,,'`
356 ;;
357 esac
358 fi
359
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
360 hide_vars OVERRIDE_TARGET TARGET
361 TARGET=$BUILDSYS
362 export TARGET
363
84adefa The R13B03 release.
Erlang/OTP authored
364 for d in $AUTOCONF_SUBDIRS; do
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
365 file="$d/configure.in"
366 [ -f "$file" ] || continue
367 echo ""
368 [ ! -d "$d/autom4te.cache" ] || {
369 echo "=== cleaning $d/autom4te.cache"
370 rm -f "$d"/autom4te.cache/*
371 }
372 echo "=== running autoconf in $d"
373 ( cd "$d" && autoconf ) || exit 1
374 chdr=`cat "$file" | sed -n "s|.*\(AC_CONFIG_HEADER\).*|\1|p"`
375 [ "$chdr" = "AC_CONFIG_HEADER" ] || continue
376 echo "=== running autoheader in $d"
377 ( cd "$d" && autoheader ) || exit 1
84adefa The R13B03 release.
Erlang/OTP authored
378 done
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
379
380 restore_vars OVERRIDE_TARGET TARGET
381
84adefa The R13B03 release.
Erlang/OTP authored
382 if target_contains win32; then
383 WANT_AUTOCONF_VER=$save_want_autoconf_ver
384 export WANT_AUTOCONF_VER
385 fi
386 }
387
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
388 run_configure ()
389 {
390 cdir="$ERL_TOP"
391 [ -z "$ONLY_ERTS" ] || {
392 cdir="$ERL_TOP/erts"
393 CONFIG_FLAGS="$CONFIG_FLAGS --no-recursion"
394 }
395
396 echo "$cdir/configure $CONFIG_FLAGS" ${1+"$@"}
397 (cd "$cdir" && $config_eval ./configure $CONFIG_FLAGS ${1+"$@"}) || exit 1
398 }
399
400 env_to_config_flags ()
401 {
402 for env_var in "$@"; do
403 script="echo $env_var=\$$env_var; unset $env_var >/dev/null 2>&1"
404 env_arg=`eval $script`
405 case $env_arg in
406 "$env_var=")
407 ;;
408 *[!$DONT_QUOTE]*)
409 config_eval=eval
410 new_arg=`echo "X$env_arg" | sed "s|^X||;s|\([^$DONT_QUOTE]\)|\\\\\\\\\1|g"`
411 CONFIG_FLAGS="$CONFIG_FLAGS $new_arg";;
412 *)
413 CONFIG_FLAGS="$CONFIG_FLAGS $env_arg";;
414 esac
415 eval unset $env_var
416 done
417 }
418
419 try_cross_configure ()
420 {
421 cross_configure=no
422 host_value=
423 build_value=
424
425 # Get `erl_xcomp_vars'
426 . "$ERL_TOP/xcomp/erl-xcomp-vars.sh" || exit 1
427
428 for arg in ${1+"$@"}; do
429 case "$arg" in
430 --host=*)
431 host_value=`echo $x | sed "s|^--host=\(.*\)|\1|"`;;
432 --build=*)
433 build_value=`echo $x | sed "s|^--build=\(.*\)|\1|"`;;
434 --xcomp-conf=*)
435 cross_configure=yes;;
436 *)
437 ;;
438 esac
439 done
440
441 test $cross_configure = yes || {
442
443 test "X$host_value" = "X" || {
444
445 test "X$build_value" != "X" || build_value="$BUILDSYS"
446
447 build_sys=`$ERL_TOP/erts/autoconf/config.sub "$build_value"` || exit 1
448 host_sys=`$ERL_TOP/erts/autoconf/config.sub "$host_value"` || exit 1
449
450
451 test "$host_sys" = "$build_sys" || cross_configure=yes
452 }
453 }
454
455 test $cross_configure = yes || return 1
456
457 # cross configure...
458 CONFIG_FLAGS=
459
460 env_to_config_flags $erl_build_tool_vars $erl_xcomp_vars
461
462 for arg in ${1+"$@"}; do
463 case "$arg" in
464 --host=*)
465 host_value=`echo $x | sed "s|^--host=\(.*\)|\1|"`;;
466 --build=*)
467 build_value=`echo $x | sed "s|^--build=\(.*\)|\1|"`;;
468 --xcomp-conf=*)
70f9744 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
469 # tilde expansion is not handled by the `configure' script,
470 # but we do it for this argument. This argument is however not
471 # a `configure' argument.
472 xcomp_conf=`echo "X$arg" | sed "s|^X--xcomp-conf=\(.*\)\$|\1|g;s|\([^$DONT_QUOTE]\)|\\\\\\\\\1|g"`
473 eval "xcomp_conf=$xcomp_conf"
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
474 test "X$xcomp_conf" != "X" || {
475 echo "$0: Missing xcomp-conf file name"
476 exit 1
477 }
478 test -f "$xcomp_conf" || {
479 echo "$0: Missing xcomp-conf file: $xcomp_conf"
480 exit 1
481 }
482 . "$xcomp_conf"
483 test $? -eq 0 || {
70f9744 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
484 echo "$0: Failed to read xcomp-conf file: $xcomp_conf"
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
485 exit 1
486 }
487 test "X$erl_xcomp_build" = "X" || build_value="$erl_xcomp_build"
488 test "X$erl_xcomp_host" = "X" || host_value="$erl_xcomp_host"
489 unset erl_xcomp_build
490 unset erl_xcomp_host
491 CONFIG_FLAGS="$CONFIG_FLAGS $erl_xcomp_configure_flags"
492 unset erl_xcomp_configure_flags
493 env_to_config_flags $erl_build_tool_vars $erl_xcomp_vars;;
494 *[!$DONT_QUOTE]*)
495 config_eval=eval
496 new_arg=`echo "X$arg" | sed "s|^X||;s|\([^$DONT_QUOTE]\)|\\\\\\\\\1|g"`
497 CONFIG_FLAGS="$CONFIG_FLAGS $new_arg";;
498 *)
499 CONFIG_FLAGS="$CONFIG_FLAGS $arg";;
500 esac
501 done
502
503 CONFIG_FLAGS="--host=$host_value $CONFIG_FLAGS"
504 test "X$build_value" != "Xguess" || build_value="$BUILDSYS"
505 test "X$build_value" = "X" || CONFIG_FLAGS="--build=$build_value $CONFIG_FLAGS"
506
507 # Configure build system for boot strap
508 cat <<EOF
509
510 *
511 * Configuring the bootstrap build system...
512 *
513
514 EOF
515
516 # hide build tools environment which is for the cross configure
517 set_config_flags $CONFIG_FLAGS
518 hide_vars CONFIG_FLAGS
519
520 set_config_flags
521 run_configure --enable-bootstrap-only
522
523 # restore the hidden build tools environment for the cross configure
524 restore_vars CONFIG_FLAGS
525
526 COMPFIX=""
527 cat <<EOF
528
529 *
530 * Configuring the cross host system ($host_value)...
531 *
532
533 EOF
534 # We don't pass the command line here since we already have moved it
535 # into CONFIG_FLAGS
536 run_configure
537
538 return 0
539 }
540
a4262e2 Make win32.config.cache static and copied when doing otp_build configure
U-KRAKEN\pan authored
541 maybe_copy_static_cache ()
542 {
543 if [ '!' -z "$OVERRIDE_CONFIG_CACHE_STATIC" ]; then
544 if [ '!' -z "$OVERRIDE_CONFIG_CACHE" ]; then
42da126 Patrik Nyblom Make whole of OTP build and release on Win64
bufflig authored
545 echo "Copying static configure cache $OVERRIDE_CONFIG_CACHE_STATIC to $OVERRIDE_CONFIG_CACHE"
a4262e2 Make win32.config.cache static and copied when doing otp_build configure
U-KRAKEN\pan authored
546 cp -f "$OVERRIDE_CONFIG_CACHE_STATIC" "$OVERRIDE_CONFIG_CACHE"
547 fi
548 fi
549 }
550
84adefa The R13B03 release.
Erlang/OTP authored
551 do_configure ()
552 {
553 setup_make
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
554
555 # Get `erl_build_tool_vars'
556 . "$ERL_TOP/erl-build-tool-vars.sh" || exit 1
557
84adefa The R13B03 release.
Erlang/OTP authored
558 if [ ! -z "$OVERRIDE_CONFIGURE" ]; then
559 case $TARGET in
560 vxworks_*)
561 ( cd erts/autoconf && \
562 $ERL_TOP/erts/autoconf/configure.vxworks $TARGET )
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
563 echo "Configuring for build system too..." >&2
564 hide_vars OVERRIDE_TARGET TARGET
565 TARGET=$BUILDSYS
566 export TARGET
567 set_config_flags "$@"
568 run_configure "$@"
569 restore_vars OVERRIDE_TARGET TARGET;;
84adefa The R13B03 release.
Erlang/OTP authored
570 *)
571 echo "Unexpected target when ordinary configure is" \
572 "overridden" >&2
573 echo 'check if $OVERRIDE_CONFIGURE and $OVERRIDE_TAGET' \
574 'environments are correct.' >&2
575 exit 1;;
576 esac
577 else
a4262e2 Make win32.config.cache static and copied when doing otp_build configure
U-KRAKEN\pan authored
578 maybe_copy_static_cache
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
579 try_cross_configure "$@"
580 if [ $cross_configure = no ]; then
581 CONFIG_FLAGS=
582 set_config_flags "$@"
583 run_configure "$@"
84adefa The R13B03 release.
Erlang/OTP authored
584 fi
585 fi
586 }
587
588 do_lazy_configure ()
589 {
590 setup_make
591 if [ "x$OVERRIDE_TARGET" != "x" -a "x$OVERRIDE_TARGET" != "xwin32" ]; then
592 echo "Not supported for cross compilation" >&2
593 exit 1
594 fi
a4262e2 Make win32.config.cache static and copied when doing otp_build configure
U-KRAKEN\pan authored
595 maybe_copy_static_cache
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
596 CONFIG_FLAGS=
597 set_config_flags "$@"
598 CONFIGURE_FLAGS="$@"
599 [ "$CONFIG_FLAGS" = "" ] || CONFIGURE_FLAGS="$CONFIG_FLAGS $CONFIGURE_FLAGS"
84adefa The R13B03 release.
Erlang/OTP authored
600 for c_dir in $AUTOCONF_SUBDIRS; do
601 if test -f $ERL_TOP/$c_dir/configure.in; then
602 dir=$ERL_TOP/$c_dir
603 echo ""
604 echo "=== Begin configuring $dir"
605 xc_dep= ;
606 xcs_dep= ;
607 test -d $dir/$TARGET || mkdir $dir/$TARGET
608 test -f $dir/aclocal.m4 && xc_dep="$xcs_dep $dir/aclocal.m4"
609 test -f $dir/acsite.m4 && xc_dep="$xcs_dep $dir/acsite.m4"
610 test x$c_dir = x"erts" && xcs_dep="$xcs_dep $dir/config.h.in"
611 $MAKE -f $ERL_TOP/make/lazy_configure.mk \
612 MAKE="$MAKE" TARGET=$TARGET \
613 ERL_TOP=$ERL_TOP \
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
614 CONFIGURE_FLAGS="$CONFIGURE_FLAGS" \
84adefa The R13B03 release.
Erlang/OTP authored
615 CONFIGURE_DIR=$dir \
616 EXTRA_CONFIGURE_DEPENDENCIES=$xc_dep \
617 EXTRA_CONFIG_STATUS_DEPENDENCIES=$xcs_dep \
618 EXPECTED_AUTOCONF_VERSION=$EXPECTED_AUTOCONF_VERSION \
619 lazy_configure
620 echo "=== Done configuring $dir"
621 echo ""
622 fi
623 done
624 }
625
626 do_lazy_configure_clean ()
627 {
628 setup_make
629 if [ "x$OVERRIDE_TARGET" != "x" -a "x$OVERRIDE_TARGET" != "xwin32" ]; then
630 echo "Not supported for cross compilation" >&2
631 exit 1
632 fi
633 for c_dir in $AUTOCONF_SUBDIRS; do
634 if test -f $ERL_TOP/$c_dir/configure.in; then
635 dir=$ERL_TOP/$c_dir
636 echo ""
637 echo "=== Begin cleaning configure in $dir"
638 xc_dep= ;
639 xcs_dep= ;
640 test -d $dir/$TARGET || mkdir $dir/$TARGET
641 test -f $dir/aclocal.m4 && xc_dep="$xcs_dep $dir/aclocal.m4"
642 test -f $dir/acsite.m4 && xc_dep="$xcs_dep $dir/acsite.m4"
643 test x$c_dir = x"erts" && xcs_dep="$xcs_dep $dir/config.h.in"
644 $MAKE -f $ERL_TOP/make/lazy_configure.mk \
645 MAKE="$MAKE" TARGET=$TARGET \
646 ERL_TOP=$ERL_TOP \
647 CONFIGURE_DIR=$dir \
648 EXPECTED_AUTOCONF_VERSION=$EXPECTED_AUTOCONF_VERSION \
649 lazy_configure_clean
650 echo "=== Done cleaning configure in $dir"
651 echo ""
652 fi
653 done
654
655 }
656
657 do_lazy_configure_target_clean ()
658 {
659 setup_make
660 if [ "x$OVERRIDE_TARGET" != "x" -a "x$OVERRIDE_TARGET" != "xwin32" ]; then
661 echo "Not supported for cross compilation" >&2
662 exit 1
663 fi
664 for c_dir in $AUTOCONF_SUBDIRS; do
665 if test -f $ERL_TOP/$c_dir/configure.in; then
666 dir=$ERL_TOP/$c_dir
667 echo ""
668 echo "=== Begin target cleaning configure in $dir"
669 xc_dep= ;
670 xcs_dep= ;
671 test -d $dir/$TARGET || mkdir $dir/$TARGET
672 test -f $dir/aclocal.m4 && xc_dep="$xcs_dep $dir/aclocal.m4"
673 test -f $dir/acsite.m4 && xc_dep="$xcs_dep $dir/acsite.m4"
674 test x$c_dir = x"erts" && xcs_dep="$xcs_dep $dir/config.h.in"
675 $MAKE -f $ERL_TOP/make/lazy_configure.mk \
676 MAKE="$MAKE" TARGET=$TARGET \
677 ERL_TOP=$ERL_TOP \
678 CONFIGURE_DIR=$dir \
679 EXPECTED_AUTOCONF_VERSION=$EXPECTED_AUTOCONF_VERSION \
680 lazy_configure_target_clean
681 echo "=== Done target cleaning configure in $dir"
682 echo ""
683 fi
684 done
685
686 }
687
688
689
690 echo_setenv ()
691 {
692 case "$DAILY_BUILD_SCRIPT$SHELL" in
693 true*)
694 echo "$1=$2";;
695 *ash|*ksh|*/sh|*zsh|*ash)
696 echo "$1=\"$2\";export $1$3";;
697 *csh)
698 echo "setenv $1 \"$2\"$3";;
699 esac
700 }
701
702 echo_env_bootstrap ()
703 {
704 boot_bin=$BOOTSTRAP_ROOT/bootstrap/bin
705
706 echo_setenv PATH $boot_bin:$PATH
707 }
708
709 echo_env_erltop ()
710 {
711 if [ X"$ERL_TOP" = X"" -o "$ERLTOP_FORCED" = "true" ]; then
712 if [ -f ./otp_build ]; then
713 # Seems to be current directory...
714 echo_setenv ERL_TOP `/bin/pwd` ';'
715 else
716 echo "You need to either set ERL_TOP first or stand in the same" \
717 "directory as this script resides in." >&2
718 exit 1
719 fi
720 fi
721 }
722
723 echo_envinfo ()
724 {
725 case "$SHELL" in
726 *csh)
727 return 0
728 ;;
729 *)
730 ;;
731 esac
732 if [ X"$DAILY_BUILD_SCRIPT" = X"true" ]; then
733 echo '# Output generated for daily build script only '\
734 '($DAILY_BUILD_SCRIPT=true)'
735 else
736 echo '# Please note:'
737 echo '# The command you are running is supposed to be run'\
738 'using the shells'
739 echo '# "eval" builtin, like in:'
740 echo '# $ eval `./otp_build env_<something>`'
741 echo '# If you see this comment, you probably haven'"'"'t done that.'
742 fi
743 }
744
745 echo_env_vxworks ()
746 {
747 if [ -z "$1" ]; then
748 echo "env_vxworks requires CPU architecture as parameter (ppc603, ppc860 etc)." >&2
749 exit 1
750 fi
751 echo_env_erltop
752 echo_setenv OVERRIDE_CONFIGURE true ';'
753 echo_setenv OVERRIDE_TARGET vxworks_$1
754 echo_envinfo
755 }
756
757 echo_env_win32 ()
758 {
759 #echo_envinfo
760 if [ X"$SHELL" = X"" ]; then
761 echo "You need to export the shell variable first," \
762 "for bourne-like shells, type:" >&2
763 echo 'export SHELL' >&2
764 echo "and for csh-like shells, type:" >&2
765 echo 'setenv SHELL $SHELL' >&2
766 echo " - then try again." >&2
767 exit 1
768 fi
769 echo_env_erltop
770 # Try to cope with paths containing unexpected things like stray
771 # mixed paths (c:/something/bin) and quotes. Only C and D drive
772 # handled.
773 CCYGPATH=`cygpath c:\\`
774 DCYGPATH=`cygpath d:\\`
775 P2=`echo :$PATH | \
776 sed "s,\",,g;s,:[cC]:,:$CCYGPATH,g;s,:[dD]:,:$DCYGPATH,g;s,^:,,"`
777 P3=""
778 save_ifs=$IFS
779 IFS=:
780 for p in $P2; do
781 if [ -d "$p" ]; then
782 C1="`(cygpath -d $p 2>/dev/null || cygpath -w $p)`" 2> /dev/null
783 C2=`cygpath "$C1" 2> /dev/null` 2> /dev/null
784 else
785 C2=""
786 fi
787 if [ ! -z "$C2" ]; then
788 if [ -z "$P3" ];then
789 P3="$C2"
790 else
791 P3="$P3:$C2"
792 fi
793 fi
794 done
795 IFS=$save_ifs
f2fce18 Patrik Nyblom Get cerl and distribution working in Win64
bufflig authored
796 WIN32_WRAPPER_PATH="$ERL_TOP/erts/etc/win32/cygwin_tools/vc:$ERL_TOP/erts/etc/win32/cygwin_tools"
84adefa The R13B03 release.
Erlang/OTP authored
797
f2fce18 Patrik Nyblom Get cerl and distribution working in Win64
bufflig authored
798
84adefa The R13B03 release.
Erlang/OTP authored
799 echo_setenv OVERRIDE_TARGET win32 ';'
800 echo_setenv CC cc.sh ';'
801 echo_setenv CXX cc.sh ';'
802 echo_setenv AR ar.sh ';'
803 echo_setenv RANLIB true ';'
a4262e2 Make win32.config.cache static and copied when doing otp_build configure
U-KRAKEN\pan authored
804 if [ -f "$ERL_TOP/erts/autoconf/win32.config.cache.static" ]; then
805 echo_setenv OVERRIDE_CONFIG_CACHE_STATIC "$ERL_TOP/erts/autoconf/win32.config.cache.static" ';'
806 fi
807 echo_setenv OVERRIDE_CONFIG_CACHE "$ERL_TOP/erts/autoconf/win32.config.cache" ';'
f2fce18 Patrik Nyblom Get cerl and distribution working in Win64
bufflig authored
808 echo_setenv WIN32_WRAPPER_PATH "$WIN32_WRAPPER_PATH" ';'
809 echo_setenv PATH "$WIN32_WRAPPER_PATH:$P3" ';'
84adefa The R13B03 release.
Erlang/OTP authored
810 echo_envinfo
811 }
812
813 echo_env_mingw32 ()
814 {
815 #echo_envinfo
816 if [ X"$SHELL" = X"" ]; then
817 echo "You need to export the shell variable first," \
818 "for bourne-like shells, type:" >&2
819 echo 'export SHELL' >&2
820 echo "and for csh-like shells, type:" >&2
821 echo 'setenv SHELL $SHELL' >&2
822 echo " - then try again." >&2
823 exit 1
824 fi
825 echo_env_erltop
826 CCYGPATH=`cygpath c:\\`
827 DCYGPATH=`cygpath d:\\`
828 P2=`echo :$PATH | \
829 sed "s,\",,g;s,:[cC]:,:$CCYGPATH,g;s,:[dD]:,:$DCYGPATH,g;s,^:,,"`
830 P3=""
831 save_ifs=$IFS
832 IFS=:
833 for p in $P2; do
834 if [ -d "$p" ]; then
835 C1="`(cygpath -d $p 2>/dev/null || cygpath -w $p)`" 2> /dev/null
836 C2=`cygpath "$C1" 2> /dev/null` 2> /dev/null
837 else
838 C2=""
839 fi
840 if [ ! -z "$C2" ]; then
841 if [ -z "$P3" ];then
842 P3="$C2"
843 else
844 P3="$P3:$C2"
845 fi
846 fi
847 done
848 found=false
849 for p in $P3; do
850 if [ -f "$p/mingw32-gcc.exe" ]; then
851 found=$p
852 fi
853 done
854 found2=false
855 for p in $P3; do
856 if [ -f "$p/wmc.exe" ]; then
857 found2=$p
858 fi
859 done
860 IFS=$save_ifs
861 if [ X"$found" = X"false" ]; then
862 echo "Could not find mingw32-gcc in PATH, build with mingw not possible!" >&2
863 return
864 fi
865
866 if [ X"$found2" = X"false" ]; then
867 echo "Could not find wmc.exe in PATH, part of wine for windows, " >&2
868 echo "needed for message file compilation: http://wine.sourceforge.net!!" >&2
869 return
870 fi
f2fce18 Patrik Nyblom Get cerl and distribution working in Win64
bufflig authored
871 WIN32_WRAPPER_PATH="$ERL_TOP/erts/etc/win32/cygwin_tools/mingw:$ERL_TOP/erts/etc/win32/cygwin_tools"
84adefa The R13B03 release.
Erlang/OTP authored
872
873
874 echo_setenv OVERRIDE_TARGET win32 ';'
875 echo_setenv MINGW_EXE_PATH $found ';'
876 echo_setenv WINE_EXE_PATH $found2 ';'
877 echo_setenv CC cc.sh ';'
878 echo_setenv CXX cc.sh ';'
879 echo_setenv AR ar.sh ';'
880 echo_setenv RANLIB true ';'
f2fce18 Patrik Nyblom Get cerl and distribution working in Win64
bufflig authored
881 echo_setenv WIN32_WRAPPER_PATH "$WIN32_WRAPPER_PATH" ';'
882 echo_setenv PATH "$WIN32_WRAPPER_PATH:$P3" ';'
84adefa The R13B03 release.
Erlang/OTP authored
883 echo_envinfo
884 }
885
7b3596b Build Win64 Erlang emulator using MSYS
unknown authored
886 # N.B. In Erlang, and the build system, win32 means windows, so we keep
887 # everything as terget win32, but add the CONFIG_SUBTYPE win64, which can
888 # be handled by configure, setting WINDOWS_64BIT in headers and such
e78a158 Patrik Nyblom Make Win64 build work both under MSYS and Cygwin
bufflig authored
889 echo_env_win64 ()
890 {
891 #echo_envinfo
892 if [ X"$SHELL" = X"" ]; then
893 echo "You need to export the shell variable first," \
894 "for bourne-like shells, type:" >&2
895 echo 'export SHELL' >&2
896 echo "and for csh-like shells, type:" >&2
897 echo 'setenv SHELL $SHELL' >&2
898 echo " - then try again." >&2
899 exit 1
900 fi
901 echo_env_erltop
902 # Try to cope with paths containing unexpected things like stray
903 # mixed paths (c:/something/bin) and quotes. Only C and D drive
904 # handled.
905 CCYGPATH=`cygpath c:\\`
906 DCYGPATH=`cygpath d:\\`
907 P2=`echo :$PATH | \
908 sed "s,\",,g;s,:[cC]:,:$CCYGPATH,g;s,:[dD]:,:$DCYGPATH,g;s,^:,,"`
909 P3=""
910 save_ifs=$IFS
911 IFS=:
912 for p in $P2; do
913 if [ -d "$p" ]; then
914 C1="`(cygpath -d $p 2>/dev/null || cygpath -w $p)`" 2> /dev/null
915 C2=`cygpath "$C1" 2> /dev/null` 2> /dev/null
916 else
917 C2=""
918 fi
919 if [ ! -z "$C2" ]; then
920 if [ -z "$P3" ];then
921 P3="$C2"
922 else
923 P3="$P3:$C2"
924 fi
925 fi
926 done
927 IFS=$save_ifs
928 WIN32_WRAPPER_PATH="$ERL_TOP/erts/etc/win32/cygwin_tools/vc:$ERL_TOP/erts/etc/win32/cygwin_tools"
929
930
931 echo_setenv OVERRIDE_TARGET win32 ';'
932 echo_setenv CONFIG_SUBTYPE win64 ';'
933 echo_setenv CC cc.sh ';'
934 echo_setenv CXX cc.sh ';'
935 echo_setenv AR ar.sh ';'
936 echo_setenv RANLIB true ';'
937 if [ -f "$ERL_TOP/erts/autoconf/win64.config.cache.static" ]; then
938 echo_setenv OVERRIDE_CONFIG_CACHE_STATIC "$ERL_TOP/erts/autoconf/win64.config.cache.static" ';'
939 fi
940 echo_setenv OVERRIDE_CONFIG_CACHE "$ERL_TOP/erts/autoconf/win64.config.cache" ';'
941 echo_setenv WIN32_WRAPPER_PATH "$WIN32_WRAPPER_PATH" ';'
942 echo_setenv PATH "$WIN32_WRAPPER_PATH:$P3" ';'
943 echo_envinfo
944 }
945
946 echo_env_msys32 ()
947 {
948 #echo_envinfo
949 if [ X"$SHELL" = X"" ]; then
950 echo "You need to export the shell variable first," \
951 "for bourne-like shells, type:" >&2
952 echo 'export SHELL' >&2
953 echo "and for csh-like shells, type:" >&2
954 echo 'setenv SHELL $SHELL' >&2
955 echo " - then try again." >&2
956 exit 1
957 fi
958 echo_env_erltop
959 # Try to cope with paths containing unexpected things like stray
960 # mixed paths (c:/something/bin) and quotes. Only C and D drive
961 # handled.
962 P2=`echo :$PATH | \
963 sed "s,\",,g;s,:\([a-zA-Z]\):,:/\L\1,g;s,^:,,"`
964 P3=""
965 save_pwd=`pwd`
966 save_ifs=$IFS
967 IFS=:
968 for p in $P2; do
969 if [ -d "$p" ]; then
970 C1=`(cd "$p" && cmd //C "for %i in (".") do @echo %~fsi")`
971 C2=`echo "$C1" | sed 's,^\([a-zA-Z]\):\\\\,/\L\1/,;s,\\\\,/,g'`
972 else
973 C2=""
974 fi
975 if [ ! -z "$C2" ]; then
976 if [ -z "$P3" ];then
977 P3="$C2"
978 else
979 P3="$P3:$C2"
980 fi
981 fi
982 done
983 IFS=$save_ifs
984 WIN32_WRAPPER_PATH="$ERL_TOP/erts/etc/win32/msys_tools/vc:$ERL_TOP/erts/etc/win32/msys_tools"
985
986 echo_setenv OVERRIDE_TARGET win32 ';'
987 echo_setenv CC cc.sh ';'
988 echo_setenv CXX cc.sh ';'
989 echo_setenv AR ar.sh ';'
990 echo_setenv RANLIB true ';'
991 if [ -f "$ERL_TOP/erts/autoconf/win32.config.cache.static" ]; then
992 echo_setenv OVERRIDE_CONFIG_CACHE_STATIC "$ERL_TOP/erts/autoconf/win32.config.cache.static" ';'
993 fi
994
995 echo_setenv OVERRIDE_CONFIG_CACHE "$ERL_TOP/erts/autoconf/win32.config.cache" ';'
996 echo_setenv WIN32_WRAPPER_PATH "$WIN32_WRAPPER_PATH" ';'
997 echo_setenv PATH "$WIN32_WRAPPER_PATH:$P3" ';'
998 echo_envinfo
999 }
1000
1001
7b3596b Build Win64 Erlang emulator using MSYS
unknown authored
1002 echo_env_msys64 ()
1003 {
1004 #echo_envinfo
1005 if [ X"$SHELL" = X"" ]; then
1006 echo "You need to export the shell variable first," \
1007 "for bourne-like shells, type:" >&2
1008 echo 'export SHELL' >&2
1009 echo "and for csh-like shells, type:" >&2
1010 echo 'setenv SHELL $SHELL' >&2
1011 echo " - then try again." >&2
1012 exit 1
1013 fi
1014 echo_env_erltop
1015 # Try to cope with paths containing unexpected things like stray
1016 # mixed paths (c:/something/bin) and quotes. Only C and D drive
1017 # handled.
1018 P2=`echo :$PATH | \
1019 sed "s,\",,g;s,:\([a-zA-Z]\):,:/\L\1,g;s,^:,,"`
1020 P3=""
1021 save_pwd=`pwd`
1022 save_ifs=$IFS
1023 IFS=:
1024 for p in $P2; do
1025 if [ -d "$p" ]; then
1026 C1=`(cd "$p" && cmd //C "for %i in (".") do @echo %~fsi")`
1027 C2=`echo "$C1" | sed 's,^\([a-zA-Z]\):\\\\,/\L\1/,;s,\\\\,/,g'`
1028 else
1029 C2=""
1030 fi
1031 if [ ! -z "$C2" ]; then
1032 if [ -z "$P3" ];then
1033 P3="$C2"
1034 else
1035 P3="$P3:$C2"
1036 fi
1037 fi
1038 done
1039 IFS=$save_ifs
f2fce18 Patrik Nyblom Get cerl and distribution working in Win64
bufflig authored
1040 WIN32_WRAPPER_PATH="$ERL_TOP/erts/etc/win32/msys_tools/vc:$ERL_TOP/erts/etc/win32/msys_tools"
7b3596b Build Win64 Erlang emulator using MSYS
unknown authored
1041
1042 echo_setenv OVERRIDE_TARGET win32 ';'
1043 echo_setenv CONFIG_SUBTYPE win64 ';'
1044 echo_setenv CC cc.sh ';'
1045 echo_setenv CXX cc.sh ';'
1046 echo_setenv AR ar.sh ';'
1047 echo_setenv RANLIB true ';'
42da126 Patrik Nyblom Make whole of OTP build and release on Win64
bufflig authored
1048 if [ -f "$ERL_TOP/erts/autoconf/win64.config.cache.static" ]; then
1049 echo_setenv OVERRIDE_CONFIG_CACHE_STATIC "$ERL_TOP/erts/autoconf/win64.config.cache.static" ';'
1050 fi
1051
7b3596b Build Win64 Erlang emulator using MSYS
unknown authored
1052 echo_setenv OVERRIDE_CONFIG_CACHE "$ERL_TOP/erts/autoconf/win64.config.cache" ';'
f2fce18 Patrik Nyblom Get cerl and distribution working in Win64
bufflig authored
1053 echo_setenv WIN32_WRAPPER_PATH "$WIN32_WRAPPER_PATH" ';'
1054 echo_setenv PATH "$WIN32_WRAPPER_PATH:$P3" ';'
7b3596b Build Win64 Erlang emulator using MSYS
unknown authored
1055 echo_envinfo
1056 }
1057
1058
84adefa The R13B03 release.
Erlang/OTP authored
1059 lookup_prog_in_path ()
1060 {
1061 PROG=$1
1062 save_ifs=$IFS
1063 IFS=:
1064 for p in $PATH; do
1065 # In cygwin the programs are not always executable and have .exe suffix...
1066 if [ "X$TARGET" = "Xwin32" ]; then
1067 if [ -f $p/$PROG.exe ]; then
1068 echo $p/$PROG
1069 break;
1070 fi
1071 else
1072 if [ -x $p/$PROG ]; then
1073 echo $p/$PROG
1074 break;
1075 fi
1076 fi
1077 done
1078 IFS=$save_ifs
1079 }
1080
1081 setup_make ()
1082 {
1083 if [ -z "$MAKE" ]; then
1084 case $TARGET in
1085 win32)
1086 MAKE=make;;
1087 *)
e555530 Björn Gustavsson otp_build: Remove clearmake support
bjorng authored
1088 if [ -n "`lookup_prog_in_path gmake`" ]; then
1089 MAKE=gmake
1090 else
1091 MAKE=make
84adefa The R13B03 release.
Erlang/OTP authored
1092 fi;;
1093 esac
1094 fi
1095 export MAKE
1096 }
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
1097
1098 get_do_commit ()
1099 {
1100 if [ "x$1" = "x" ]; then
1101 do_commit=true
1102 elif [ "$1" = "--no-commit" ]; then
1103 do_commit=false
1104 else
1105 echo "Unknown option '$1'" 1>&2
1106 exit 1
1107 fi
1108 }
1109
3e4db41 Björn Gustavsson Support updating the primary bootstrap in a git repository
bjorng authored
1110 do_primary_git ()
1111 {
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
1112 get_do_commit $1
3e4db41 Björn Gustavsson Support updating the primary bootstrap in a git repository
bjorng authored
1113 setup_make
1114 if [ "x$OVERRIDE_TARGET" != "x" -a "x$OVERRIDE_TARGET" != "xwin32" ]; then
1115 do_primary_cross
1116 else
1117 $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET primary_bootstrap || exit 1;
1118 fi
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
1119 if [ $do_commit = true ]; then
1120 git add -A bootstrap/lib/kernel \
1121 bootstrap/lib/stdlib \
1122 bootstrap/lib/compiler \
1123 bootstrap/bin
1124 find bootstrap -name egen -o -name '*.script' -o \
1125 -name '*.app' -o -name '*.appup' |
1c3815a Björn Gustavsson otp_build update_primary: Don't commit generated source files
bjorng authored
1126 xargs git reset HEAD
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
1127 git commit --no-verify -m 'Update primary bootstrap'
1128 echo "Primary bootstrap updated and commited."
1129 else
1130 echo ""
1131 echo "Primary bootstrap rebuilt. Use \"git add bootstrap/...\" to stage changed files."
1132 echo ""
1133 fi
3e4db41 Björn Gustavsson Support updating the primary bootstrap in a git repository
bjorng authored
1134 }
1135
9c1b2d0 Björn Gustavsson Support updating preloaded files in a git repository
bjorng authored
1136 do_update_prel_git ()
1137 {
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
1138 get_do_commit $1
9c1b2d0 Björn Gustavsson Support updating preloaded files in a git repository
bjorng authored
1139 setup_make
1140 (cd $ERL_TOP/erts/preloaded/src && $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET clean)
1141 $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET preloaded || exit 1
1142 (cd $ERL_TOP/erts/preloaded/src && $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET copy)
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
1143 if [ $do_commit = true ]; then
1144 git add -A $ERL_TOP/erts/preloaded/ebin/*.beam
1145 git commit -m 'Update preloaded modules'
1146 echo "Preloaded updated and commited."
1147 else
1148 echo ""
1149 echo "Preloaded rebuilt. Use \"git add erts/preloaded/ebin/...\" to stage changed beam files."
1150 echo ""
1151 fi
9c1b2d0 Björn Gustavsson Support updating preloaded files in a git repository
bjorng authored
1152 }
1153
84adefa The R13B03 release.
Erlang/OTP authored
1154 do_boot ()
1155 {
1156 setup_make
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
1157
1158 # Bootstrap if we are cross compiling
1159 if [ X`$MAKE is_cross_configured` = Xyes ]; then
1160 TARGET=$BUILDSYS
1161 $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT CROSS_COMPILING=no TARGET=$TARGET bootstrap || exit 1
1162 TARGET=`$MAKE target_configured`
1163 elif [ "x$OVERRIDE_TARGET" != "x" -a "x$OVERRIDE_TARGET" != "xwin32" ]; then
1164 hide_vars OVERRIDE_TARGET TARGET
1165 TARGET=$BUILDSYS
1166 $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET bootstrap || exit 1
1167
1168 restore_vars OVERRIDE_TARGET TARGET
84adefa The R13B03 release.
Erlang/OTP authored
1169 fi
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
1170
1171 # Build it (including bootstrap if not cross compiling)
1172 $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET all || exit 1
84adefa The R13B03 release.
Erlang/OTP authored
1173 }
1174
1175 do_boot_emu ()
1176 {
1177 setup_make
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
1178 if [ X`$MAKE is_cross_configured` = Xyes ]; then
1179 TARGET=`$MAKE target_configured`
84adefa The R13B03 release.
Erlang/OTP authored
1180 fi
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
1181 $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET emulator || exit 1
84adefa The R13B03 release.
Erlang/OTP authored
1182 }
1183
1184 do_release ()
1185 {
1186 setup_make
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
1187 if [ X`$MAKE is_cross_configured` = Xyes ]; then
1188 TARGET=`$MAKE target_configured`
1189 fi
1190 $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET \
1191 RELEASE_ROOT=$1 OTP_STRICT_INSTALL=$OTP_STRICT_INSTALL \
1192 release || exit 1
84adefa The R13B03 release.
Erlang/OTP authored
1193 }
1194
1195 do_tests ()
1196 {
1197 setup_make
1b78e85 Rickard Green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
1198 if [ X`$MAKE is_cross_configured` = Xyes ]; then
1199 TARGET=`$MAKE target_configured`
1200 fi
84adefa The R13B03 release.
Erlang/OTP authored
1201 if [ X"$1" = X"" ]; then
1202 $MAKE MAKE="$MAKE" TARGET=$TARGET release_tests || exit 1
1203 else
1204 $MAKE MAKE="$MAKE" TARGET=$TARGET TESTSUITE_ROOT=$1 release_tests || exit 1
1205 fi
1206 }
1207
1208 do_debuginfo_win32 ()
1209 {
1210 setup_make
1211 (cd erts/emulator && $MAKE MAKE="$MAKE" TARGET=$TARGET FLAVOR=smp debug &&\
1212 $MAKE MAKE="$MAKE" TARGET=$TARGET FLAVOR=plain debug) || exit 1
1213 if [ -z "$1" ]; then
1214 RELDIR=$ERL_TOP/release/$TARGET
1215 else
1216 RELDIR="$1"
1217 fi
1218 BINDIR=$ERL_TOP/bin/$TARGET
1219 EVSN=`grep '^VSN' erts/vsn.mk | sed 's,^VSN.*=[^0-9]*\([0-9].*\)$,@\1,g;s,^[^@].*,,g;s,^@,,g'`
1220 for f in beam.debug.dll beam.debug.smp.dll beam.pdb beam.smp.pdb erl.pdb werl.pdb erlexec.pdb; do
1221 if [ -f $BINDIR/$f ]; then
1222 rm -f $RELDIR/erts-$EVSN/bin/$f
1223 cp $BINDIR/$f $RELDIR/erts-$EVSN/bin/$f
1224 fi
1225 done
1226 }
1227
1228 do_installer_win32 ()
1229 {
1230 setup_make
1231 installer_dir=$ERL_TOP/erts/etc/win32/nsis
1232 (cd $installer_dir; $MAKE MAKE="$MAKE" TARGET=$TARGET TESTROOT=$1 release) || exit 1
1233 }
1234
1235 do_copy_primary_bootstrap ()
1236 {
1237 if [ "x$1" = "x" ]; then
1238 echo "Missing bootstrap source top" 1>&2
1239 exit 1
1240 fi
1241 if [ ! -d $1 ]; then
1242 echo "Invalid bootstrap source top" 1>&2
1243 exit 1
1244 fi
1245 if [ "x$2" = "x" ]; then
1246 echo "Missing bootstrap root" 1>&2
1247 exit 1
1248 fi
1249 if [ ! -d $2 ]; then
1250 echo "Invalid bootstrap root" 1>&2
1251 exit 1
1252 fi
1253
1254 bootstrap=$2/bootstrap
1255 bootstrap_src_top=$1
1256 lib_src=$bootstrap_src_top/lib
1257
1258 # kernel
1259 test -d $bootstrap/lib/kernel/ebin || mkdir -p $bootstrap/lib/kernel/ebin
1260 test -d $bootstrap/lib/kernel/include || mkdir -p $bootstrap/lib/kernel/include
1261 cp -f $lib_src/kernel/ebin/*.beam $bootstrap/lib/kernel/ebin
1262 cp -f $lib_src/kernel/include/*.hrl $bootstrap/lib/kernel/include
1263
1264 # stdlib
1265 test -d $bootstrap/lib/stdlib/ebin || mkdir -p $bootstrap/lib/stdlib/ebin
1266 test -d $bootstrap/lib/stdlib/include || mkdir -p $bootstrap/lib/stdlib/include
1267 cp -f $lib_src/stdlib/ebin/*.beam $bootstrap/lib/stdlib/ebin
1268 cp -f $lib_src/stdlib/include/*.hrl $bootstrap/lib/stdlib/include
1269
1270 # compiler
1271 test -d $bootstrap/lib/compiler/ebin || mkdir -p $bootstrap/lib/compiler/ebin
1272 cp -f $lib_src/compiler/ebin/*.beam $bootstrap/lib/compiler/ebin
1273
1274 # bootstrap bin
1275 if [ $bootstrap_src_top != $ERL_TOP ]; then
1276 test -d $bootstrap/bin || mkdir -p $bootstrap/bin
1277 cp -f $bootstrap_src_top/bin/* $bootstrap/bin
1278 fi
1279
1280 }
1281
1282 do_save_bootstrap ()
1283 {
1284 if [ ! -f $ERL_TOP/prebuilt.files ]; then
1285 echo "This is not a pre-built source distribution" 1>&2
1286 exit 1
1287 fi
1288 if [ -d $ERL_TOP/bootstrap/lib ]; then
1289 echo "Bootstrap already exist" 1>&2
1290 exit 1
1291 fi
1292
1293 do_copy_primary_bootstrap $ERL_TOP $ERL_TOP
1294 }
1295
1296 do_remove_prebuilt_files ()
1297 {
1298 do_save_bootstrap
1299 for file in $ERL_TOP/`cat $ERL_TOP/prebuilt.files` ; do
1300 rm -f $file
1301 done
1302 }
1303
1304 # main
1305
1306 check_erltop
1307
1308 cd $ERL_TOP
1309
faac812 Björn Gustavsson Determine which VCS is being used
bjorng authored
1310 determine_version_controller
1311
84adefa The R13B03 release.
Erlang/OTP authored
1312 # Unset ERL_FLAGS and ERL_<Release>_FLAGS to prevent, for instance,
1313 # a value of "-hybrid" to run the hybrid emulator during bootstrap.
1314 sys_vsn=`awk '/SYSTEM_VSN = / {print $3}' < erts/vsn.mk`
1315 sys_erl_flags="ERL_${sys_vsn}_FLAGS"
1316 unset ERL_FLAGS
1317 unset ${sys_erl_flags}
1318
1319 # Target first guess, won't necessarily hold, may be changed for
1320 # certain parameters.
1321 if [ X"$TARGET" = X"" ]; then
1322 TARGET=`$ERL_TOP/erts/autoconf/config.guess`
1323 fi
1324 BUILDSYS=$TARGET
1325
1326 case $TARGET in
1327 *-cygwin)
1328 if [ X"$BUILD_FOR_CYGWIN" = X"" ]; then
e78a158 Patrik Nyblom Make Win64 build work both under MSYS and Cygwin
bufflig authored
1329 if [ X"$OVERRIDE_TARGET" = X"" -a X"$1" != X"env_win32" -a X"$1" != X"env_win64" -a X"$1" != X"env_mingw32" ];then
84adefa The R13B03 release.
Erlang/OTP authored
1330 echo "Building for windows, you should do the " \
1331 "following first:" >&2
1332 echo 'eval `./otp_build env_win32`' >&2
1333 echo 'please note that there are backticks (``) in' \
1334 'the command'
1335 exit 1
1336 fi
1337 fi;;
7b3596b Build Win64 Erlang emulator using MSYS
unknown authored
1338 *-mingw32)
e78a158 Patrik Nyblom Make Win64 build work both under MSYS and Cygwin
bufflig authored
1339 if [ X"$OVERRIDE_TARGET" = X"" -a X"$1" != X"env_win32" -a X"$1" != X"env_msys32" -a X"$1" != X"env_msys64" ];then
7b3596b Build Win64 Erlang emulator using MSYS
unknown authored
1340 echo "Building for windows, you should do the " \
1341 "following first:" >&2
1342 echo 'eval `./otp_build env_msys64`' >&2
1343 echo 'please note that there are backticks (``) in' \
1344 'the command'
1345 exit 1
1346 fi;;
84adefa The R13B03 release.
Erlang/OTP authored
1347 *)
7b3596b Build Win64 Erlang emulator using MSYS
unknown authored
1348 ;;
84adefa The R13B03 release.
Erlang/OTP authored
1349 esac
1350
1351 if [ ! -z "$OVERRIDE_TARGET" ]; then
1352 TARGET="$OVERRIDE_TARGET"
1353 fi
1354
1355 # Setting a bootstrap root is inherently very dangerous now that the bootstrap
1356 # is prebuilt, avoid it if not forced by setting FORCE_BOOTSTRAP_ROOT=true!
1357
1358 if [ X"$FORCE_BOOTSTRAP_ROOT" != X"true" ]; then
1359 BOOTSTRAP_ROOT="$ERL_TOP"
1360 else
1361 if [ -z "$BOOTSTRAP_ROOT" ]; then
1362 BOOTSTRAP_ROOT="$ERL_TOP"
1363 fi
1364 fi
1365
1366 if [ X"$1" = X"" ]; then
1367 usage
1368 exit 1
1369 fi
1370
1371 if [ X"$2" = X"-a" ]; then
1372 minus_a_flag=true
1373 OTP_SMALL_BUILD=
1374 else
1375 OTP_SMALL_BUILD=true
1376 minus_a_flag=false
1377 fi
1378 export OTP_SMALL_BUILD
1379
1380 TYPE=
1381 case "$1" in
1382 all)
1383 do_autoconf;
1384 do_configure;
1385 do_boot;
1386 if [ $minus_a_flag = true ]; then
1387 shift
1388 fi;
1389 do_release "$2";;
1390 setup)
1391 shift;
1392 if [ $minus_a_flag = true ]; then
1393 shift
1394 fi;
1395 do_autoconf;
1396 do_configure "$@";
1397 do_boot;;
1398 lazy_setup)
1399 shift;
1400 if [ $minus_a_flag = true ]; then
1401 shift
1402 fi;
1403 do_lazy_configure "$@";
1404 do_boot;;
1405 autoconf)
1406 do_autoconf;;
1407 configure)
1408 shift;
1409 do_configure "$@";;
1410 lazy_configure)
1411 shift;
1412 do_lazy_configure "$@";;
1413 lazy_configure_clean)
1414 shift;
1415 do_lazy_configure_clean;;
1416 lazy_configure_target_clean)
1417 shift;
1418 do_lazy_configure_target_clean;;
1419 opt)
1420 do_boot;;
812812e Björn Gustavsson Fix spelling, remove obsolete command
bjorng authored
1421 plain|smp|hybrid)
84adefa The R13B03 release.
Erlang/OTP authored
1422 if [ $minus_a_flag = false ]; then
1423 TYPE=opt
1424 fi;
1425 FLAVOR=$1
1426 if [ $FLAVOR = opt ]; then
1427 FLAVOR=plain
1428 fi
1429 do_boot;;
1430 update_primary)
3e4db41 Björn Gustavsson Support updating the primary bootstrap in a git repository
bjorng authored
1431 case $version_controller in
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
1432 git) do_primary_git "$2";;
aa7696f Björn Gustavsson otp_build: Remove Clearcase support for primary bootstrap and preloaded ...
bjorng authored
1433 none) git_required ;;
3e4db41 Björn Gustavsson Support updating the primary bootstrap in a git repository
bjorng authored
1434 esac ;;
84adefa The R13B03 release.
Erlang/OTP authored
1435 update_preloaded)
9c1b2d0 Björn Gustavsson Support updating preloaded files in a git repository
bjorng authored
1436 case $version_controller in
71c3df2 Sverker Eriksson Add --no-commit option to update_primary and update_preloaded
sverker authored
1437 git) do_update_prel_git "$2";;
aa7696f Björn Gustavsson otp_build: Remove Clearcase support for primary bootstrap and preloaded ...
bjorng authored
1438 none) git_required ;;
9c1b2d0 Björn Gustavsson Support updating preloaded files in a git repository
bjorng authored
1439 esac ;;
84adefa The R13B03 release.
Erlang/OTP authored
1440 primary)
1441 echo "Primary bootstrap is under version control since R13";
c9a40f4 Tuncer Ayaz Clean up bootstrap targets and documentation
tuncer authored
1442 echo "Use update_primary if you really are";
84adefa The R13B03 release.
Erlang/OTP authored
1443 echo "updating the primary bootstrap...";;
1444 boot)
1445 do_boot;;
1446 emulator)
1447 do_boot_emu;;
1448 release)
1449 if [ $minus_a_flag = true ]; then
1450 shift
1451 fi;
1452 do_release "$2";;
1453 tests)
1454 if [ $minus_a_flag = true ]; then
1455 shift
1456 fi;
1457 do_tests "$2";;
1458 remove_prebuilt_files)
1459 do_remove_prebuilt_files;;
1460 save_bootstrap)
1461 do_save_bootstrap;;
1462 copy_primary_bootstrap)
1463 do_copy_primary_bootstrap $2 $3;;
1464 installer_win32)
1465 if [ $minus_a_flag = true ]; then
1466 shift
1467 fi;
1468 do_installer_win32 "$2";;
1469 debuginfo_win32)
1470 if [ $minus_a_flag = true ]; then
1471 shift
1472 fi;
1473 do_debuginfo_win32 "$2";;
1474 env_win32)
e78a158 Patrik Nyblom Make Win64 build work both under MSYS and Cygwin
bufflig authored
1475 if [ x"$2" = x"x64" -o x"$2" = x"amd64" ]; then
1476 if [ -x /usr/bin/msysinfo ]; then
1477 echo_env_msys64
1478 else
1479 echo_env_win64
1480 fi
1481 else
1482 if [ -x /usr/bin/msysinfo ]; then
1483 echo_env_msys32
1484 else
1485 echo_env_win32
1486 fi
1487 fi;;
84adefa The R13B03 release.
Erlang/OTP authored
1488 env_mingw32)
1489 echo_env_mingw32;;
e78a158 Patrik Nyblom Make Win64 build work both under MSYS and Cygwin
bufflig authored
1490 env_win64)
1491 echo_env_win64;;
7b3596b Build Win64 Erlang emulator using MSYS
unknown authored
1492 env_msys64)
1493 echo_env_msys64;;
84adefa The R13B03 release.
Erlang/OTP authored
1494 env_vxworks)
1495 echo_env_vxworks "$2";;
1496 env_cross)
1497 echo_env_cross "$2";;
1498 env_bootstrap)
1499 echo_env_bootstrap;;
1500 *)
1501 usage;;
1502 esac
Something went wrong with that request. Please try again.