diff options
Diffstat (limited to 'otp_build')
-rwxr-xr-x | otp_build | 185 |
1 files changed, 13 insertions, 172 deletions
@@ -52,9 +52,6 @@ usage () echo " release [-a] <target_dir> - creates full release to <target_dir>" echo " smp [-a] - build an Erlang system, smp flavor only" echo " tests <dir> - Build testsuites to <dir>" - echo " patch_app <target_dir> <app1>... - build given apps to <target_dir>" - echo " If core apps are patched, new start scripts will be created" - echo " and 'Install' must be run again." echo "" echo "These are for cleaning up an open source distribution" echo "with prebuilt files, so that it resembles the clean developers" @@ -263,62 +260,32 @@ create_lib_configure_in() } } -find_sum() +distribute_config_helpers () { - candidates="sum cksum md5sum sha1sum" - SUM_CMD="wc" - for x in $candidates; do - if (echo foo | $x > /dev/null 2>&1); then - SUM_CMD=$x - break - fi - done -} - -chk_eq() -{ - master=$1 - shift - slaves="$@" - master_sum=`$SUM_CMD $master | awk '{print $1}'` - for x in $slaves; do - s=`$SUM_CMD $x | awk '{print $1}'` - if test "$s" != "$master_sum"; then - echo "Error: $master and $x are not equal, make sure they are!" >&2 - echo "Maybe you would want to:" >&2 - echo "for x in $slaves; do cp $master \$x; done" >&2 - echo "? Or something else is wrong." 2>&1 - exit 2 - fi - done -} - -check_config_helpers () -{ - - aclocals="./aclocal.m4 ./lib/erl_interface/aclocal.m4 ./lib/odbc/aclocal.m4 ./lib/wx/aclocal.m4 ./lib/megaco/aclocal.m4" - install_shs="./lib/common_test/priv/auxdir/install-sh ./lib/erl_interface/src/auxdir/install-sh ./lib/test_server/src/install-sh" - config_guesses="./lib/common_test/priv/auxdir/config.guess ./lib/erl_interface/src/auxdir/config.guess ./lib/test_server/src/config.guess" - config_subs="./lib/common_test/priv/auxdir/config.sub ./lib/erl_interface/src/auxdir/config.sub ./lib/test_server/src/config.sub" + aclocal_dirs=". ./lib/erl_interface ./lib/odbc ./lib/wx ./lib/megaco" + autoconf_aux_dirs="./lib/common_test/priv/auxdir ./lib/erl_interface/src/auxdir ./lib/test_server/src ./lib/wx/autoconf" aclocal_master="./erts/aclocal.m4" install_sh_master="./erts/autoconf/install-sh" config_guess_master="./erts/autoconf/config.guess" config_sub_master="./erts/autoconf/config.sub" - find_sum - - chk_eq $aclocal_master $aclocals - chk_eq $install_sh_master $install_shs - chk_eq $config_guess_master $config_guesses - chk_eq $config_sub_master $config_subs + for dir in $aclocal_dirs; do + $install_sh_master -m 644 -t "$dir" "$aclocal_master" + done + for dir in $autoconf_aux_dirs; do + $install_sh_master -d "$dir" + $install_sh_master -t "$dir" "$install_sh_master" + $install_sh_master -t "$dir" "$config_guess_master" + $install_sh_master -t "$dir" "$config_sub_master" + done } do_autoconf () { create_lib_configure_in - check_config_helpers + distribute_config_helpers if target_contains win32; then # Select the correct autoconf on cygwin @@ -1192,129 +1159,6 @@ do_release () release || exit 1 } -do_patch_app () -{ - # If target dir exists and has an installation of same major release, then - # build given apps. - # If patch includes erts, kernel, stdlib, sasl, then find latest - # erts, kernel, stdlib, sasl and create .rel files. - # Create .script/.boot - - if [ $# -lt 2 ]; then - usage - exit 1 - fi - - setup_make - if [ X`$MAKE is_cross_configured` = Xyes ]; then - TARGET=`$MAKE target_configured` - fi - target_dir=$1 - if [ ! -d $target_dir/releases/$otp_major_vsn ]; then - echo "No OTP $otp_major_vsn installation in $target_dir" 1>&2 - exit 1 - fi - - shift - - otp_version=`cat "$target_dir/OTP_VERSION"` || { echo "Not able to read $target_dir/OTP_VERSION" 1>&2; exit 1; } - { echo "$otp_version" | sed "s|^\([^\*]*\)\**|\1\*\*|g" > $target_dir/OTP_VERSION; } 2>/dev/null || { echo "Not able to update $target_dir/OTP_VERSION" 1>&2; exit 1; } - - # Build all applications to target - for app in "$@"; do - if [ "$app" = "erts" ] && [ -d $ERL_TOP/$app ]; then - (cd $ERL_TOP/$app && $MAKE MAKE="$MAKE" TARGET=$TARGET \ - TESTROOT=$target_dir release) || exit 1 - elif [ "$app" != "erts" ] && [ -d $ERL_TOP/lib/$app ]; then - (cd $ERL_TOP/lib/$app && $MAKE MAKE="$MAKE" TARGET=$TARGET \ - TESTROOT=$target_dir release) || exit 1 - else - echo "Invalid application $app" 1>&2 - exit 1 - fi - done - - # If erts, kernel, stdlib or sasl is included, find versions - for app in "$@"; do - if [ "$app" = "erts" ]; then - erts_vsn=`grep '^VSN' erts/vsn.mk | sed "s|^VSN.*=[^0-9]*\([0-9].*\)$|\1|g"` - update_rel=true - elif [ "$app" = "kernel" ]; then - kernel_vsn=`sed "s|^KERNEL_VSN[^=]*=[^0-9]*\([0-9].*\)$|\1|g" lib/kernel/vsn.mk` - update_rel=true - elif [ "$app" = "stdlib" ]; then - stdlib_vsn=`sed "s|^STDLIB_VSN[^=]*=[^0-9]*\([0-9].*\)$|\1|g" lib/stdlib/vsn.mk` - update_rel=true - elif [ "$app" = "sasl" ]; then - sasl_vsn=`sed "s|^SASL_VSN[^=]*=[^0-9]*\([0-9].*\)$|\1|g" lib/sasl/vsn.mk` - update_rel=true - fi - done - - # and find the old versions for those not included - if [ "X$update_rel" != "X" ]; then - if [ "X$erts_vsn" = "X" ]; then - erts_vsns=`ls -d $target_dir/erts-* | sed "s|$target_dir/erts-\([0-9\.].*\)|\1|g"` - erts_vsn=`echo "$erts_vsns" | sort -t '.' -g | tail -n 1` - fi - if [ "X$kernel_vsn" = "X" ]; then - kernel_vsns=`ls -d $target_dir/lib/kernel-* | sed "s|$target_dir/lib/kernel-\([0-9\.].*\)|\1|g"` - kernel_vsn=`echo "$kernel_vsns" | sort -t '.' -g | tail -n 1` - fi - if [ "X$stdlib_vsn" = "X" ]; then - stdlib_vsns=`ls -d $target_dir/lib/stdlib-* | sed "s|$target_dir/lib/stdlib-\([0-9\.].*\)|\1|g"` - stdlib_vsn=`echo "$stdlib_vsns" | sort -t '.' -g | tail -n 1` - fi - if [ "X$sasl_vsn" = "X" ]; then - sasl_vsns=`ls -d $target_dir/lib/sasl-* | sed "s|$target_dir/lib/sasl-\([0-9\.].*\)|\1|g"` - sasl_vsn=`echo "$sasl_vsns" | sort -t '.' -g | tail -n 1` - fi - - # Generate .rel, .script and .boot - to tmp dir - start_clean="{release, {\"OTP APN 181 01\",\"$otp_major_vsn\"}, {erts, \"$erts_vsn\"},\n [{kernel,\"$kernel_vsn\"},\n {stdlib,\"$stdlib_vsn\"}]}.\n" - start_sasl="{release, {\"OTP APN 181 01\",\"$otp_major_vsn\"}, {erts, \"$erts_vsn\"},\n [{kernel,\"$kernel_vsn\"},\n {stdlib,\"$stdlib_vsn\"},\n {sasl,\"$sasl_vsn\"}]}.\n" - - tmp_dir=$target_dir/tmp; - if [ ! -d $tmp_dir ]; then - mkdir $tmp_dir - fi - echo $start_sasl > $tmp_dir/start_sasl.rel - echo $start_clean > $tmp_dir/start_clean.rel - echo $start_clean > $tmp_dir/no_dot_erlang.rel - - erlc=$ERL_TOP/bootstrap/bin/erlc - if [ ! -x $erlc ]; then - echo "erlc not found, can not create .script and .boot files" 1>&2 - exit 1 - fi - - $erlc -I$target_dir/lib/*/ebin -o$tmp_dir $tmp_dir/start_sasl.rel || exit 1 - $erlc -I$target_dir/lib/*/ebin -o$tmp_dir +no_warn_sasl $tmp_dir/start_clean.rel || exit 1 - $erlc -I$target_dir/lib/*/ebin -o$tmp_dir +no_warn_sasl +no_dot_erlang $tmp_dir/no_dot_erlang.rel || exit 1 - - # Generate RELEASES file - erl=$ERL_TOP/bootstrap/bin/erl - if [ ! -x $erl ]; then - echo "erl not found, can not create RELEASES file" 1>&2 - exit 1 - fi - $erl -noinput +B -eval "release_handler:create_RELEASES(\"%ERL_ROOT%\", \"$tmp_dir\", \"$tmp_dir/start_sasl.rel\", []), halt()" || exit 1 - - # If all good so far, move generated files into target area - mv $tmp_dir/RELEASES $target_dir/releases/RELEASES.src - mv $tmp_dir/* $target_dir/releases/$otp_major_vsn - rmdir $tmp_dir - - # Remove old start scripts (forces a new run of Install) - rm -f $target_dir/releases/RELEASES - rm -f $target_dir/bin/*.script - rm -f $target_dir/bin/*.boot - rm -f $target_dir/bin/erl - fi - -} - - do_tests () { setup_make @@ -1575,9 +1419,6 @@ case "$1" in shift fi; do_release "$2";; - patch_app) - shift; - do_patch_app "$@";; tests) if [ $minus_a_flag = true ]; then shift |