Path: blob/aarch64-shenandoah-jdk8u272-b10/common/bin/boot_cycle.sh
32278 views
#!/bin/bash1#2# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4#5# This code is free software; you can redistribute it and/or modify it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.22#2324# The boot_cycle.sh script performs two complete image builds (no javadoc though....)25# where the second build uses the first build as the boot jdk.26#27# This is useful to verify that the build is self hoisting and assists28# in flushing out bugs. You can follow up with compare_objects.sh to check29# that the two boot_cycle_?/images/j2sdk are identical. They should be.30#31# Usage:32# Specify the configure arguments to boot_cycle.sh, for example:33#34# sh common/bin/boot_cycle.sh --enable-debug --with-jvm-variants=server35#36# The same arguments will be used for both builds, except of course --with-boot-jdk37# that will be adjusted to boot_cycle_1 for the second build.3839SCRIPT_DIR=`pwd`/`dirname $0`40ROOT_DIR=`(cd $SCRIPT_DIR/../.. ; pwd)`41BUILD_DIR=$ROOT_DIR/build42mkdir -p $BUILD_DIR43AUTOCONF_DIR=`(cd $SCRIPT_DIR/../autoconf ; pwd)`44BOOT_CYCLE_1_DIR=$BUILD_DIR/boot_cycle_145BOOT_CYCLE_2_DIR=$BUILD_DIR/boot_cycle_24647# Create the boot cycle dirs in the build directory.48mkdir -p $BOOT_CYCLE_1_DIR49mkdir -p $BOOT_CYCLE_2_DIR5051cd $BOOT_CYCLE_1_DIR52# Configure!53sh $AUTOCONF_DIR/configure "$@"54# Now build!55make images5657if ! test -x $BOOT_CYCLE_1_DIR/images/j2sdk-image/bin/java ; then58echo Failed to build the executable $BOOT_CYCLE_1_DIR/images/j2sdk-image/bin/java59exit 160fi6162cd $BOOT_CYCLE_2_DIR63# Pickup the configure arguments, but drop any --with-boot-jdk=....64# and add the correct --with-boot-jdk=...boot_cycle_1... at the end.65ARGUMENTS="`cat $BOOT_CYCLE_1_DIR/configure-arguments|sed 's/--with-boot-jdk=[^ ]*//'` --with-boot-jdk=$BOOT_CYCLE_1_DIR/images/j2sdk-image"66# Configure using these adjusted arguments.67sh $AUTOCONF_DIR/configure $ARGUMENTS68# Now build!69make images7071if ! test -x $BOOT_CYCLE_2_DIR/images/j2sdk-image/bin/java ; then72echo Failed to build the final executable $BOOT_CYCLE_2_DIR/images/j2sdk-image/bin/java73exit 174fi7576777879