Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
Magnus Ihse Bursie | 3e6227e | 2016-10-11 09:49:31 +0200 | [diff] [blame] | 3 | # Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 4 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 5 | # |
| 6 | # This code is free software; you can redistribute it and/or modify it |
| 7 | # under the terms of the GNU General Public License version 2 only, as |
| 8 | # published by the Free Software Foundation. |
| 9 | # |
| 10 | # This code is distributed in the hope that it will be useful, but WITHOUT |
| 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 13 | # version 2 for more details (a copy is included in the LICENSE file that |
| 14 | # accompanied this code). |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License version |
| 17 | # 2 along with this work; if not, write to the Free Software Foundation, |
| 18 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | # |
| 20 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 21 | # or visit www.oracle.com if you need additional information or have any |
| 22 | # questions. |
| 23 | # |
| 24 | |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 25 | # This script is processed by configure before it's usable. It is run from |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 26 | # the root of the build directory. |
| 27 | |
| 28 | |
| 29 | ########################################################################################## |
| 30 | # Substitutions from autoconf |
| 31 | |
Magnus Ihse Bursie | 041790c | 2015-09-23 10:17:38 +0200 | [diff] [blame] | 32 | export LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@ |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 33 | |
Erik Joelsson | a12239e | 2016-04-28 16:18:59 +0200 | [diff] [blame] | 34 | export OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@" |
Magnus Ihse Bursie | 041790c | 2015-09-23 10:17:38 +0200 | [diff] [blame] | 35 | export OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@" |
Erik Joelsson | d70a9d7 | 2016-04-06 11:16:37 +0200 | [diff] [blame] | 36 | export DEBUG_LEVEL="@DEBUG_LEVEL@" |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 37 | |
Magnus Ihse Bursie | 041790c | 2015-09-23 10:17:38 +0200 | [diff] [blame] | 38 | export AWK="@AWK@" |
| 39 | export BASH="@BASH@" |
| 40 | export CAT="@CAT@" |
| 41 | export CMP="@CMP@" |
| 42 | export CP="@CP@" |
| 43 | export CUT="@CUT@" |
| 44 | export DIFF="@DIFF@" |
| 45 | export DUMPBIN="@FIXPATH@ @DUMPBIN@" |
| 46 | export EXPR="@EXPR@" |
| 47 | export FILE="@FILE@" |
| 48 | export FIND="@FIND@" |
| 49 | export GREP="@GREP@" |
Erik Joelsson | 2517354 | 2016-05-04 15:29:01 +0200 | [diff] [blame] | 50 | export GUNZIP="@GUNZIP@" |
Magnus Ihse Bursie | 041790c | 2015-09-23 10:17:38 +0200 | [diff] [blame] | 51 | export LDD="@LDD@" |
| 52 | export LN="@LN@" |
| 53 | export MKDIR="@MKDIR@" |
| 54 | export MV="@MV@" |
| 55 | export NAWK="@NAWK@" |
| 56 | export NM="@GNM@" |
| 57 | export OBJDUMP="@OBJDUMP@" |
| 58 | export OTOOL="@OTOOL@" |
| 59 | export PRINTF="@PRINTF@" |
| 60 | export READELF="@READELF@" |
| 61 | export RM="@RM@" |
| 62 | export SED="@SED@" |
| 63 | export SORT="@SORT@" |
| 64 | export STAT="@STAT@" |
David Dehaven | 38d9815 | 2015-09-28 13:10:03 -0700 | [diff] [blame] | 65 | export STRIP="@STRIP@ @STRIPFLAGS@" |
Erik Joelsson | 2517354 | 2016-05-04 15:29:01 +0200 | [diff] [blame] | 66 | export TAR="@TAR@" |
Magnus Ihse Bursie | 041790c | 2015-09-23 10:17:38 +0200 | [diff] [blame] | 67 | export TEE="@TEE@" |
| 68 | export UNIQ="@UNIQ@" |
| 69 | export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200" |
Erik Joelsson | 2517354 | 2016-05-04 15:29:01 +0200 | [diff] [blame] | 70 | export UNARCHIVE="@UNZIP@ -q -o" |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 71 | |
Magnus Ihse Bursie | 041790c | 2015-09-23 10:17:38 +0200 | [diff] [blame] | 72 | export SRC_ROOT="@TOPDIR@" |
| 73 | export OUTPUT_ROOT="@OUTPUT_ROOT@" |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 74 | |
Erik Joelsson | d70a9d7 | 2016-04-06 11:16:37 +0200 | [diff] [blame] | 75 | if [ "@COMPILE_TYPE@" != "cross" ]; then |
| 76 | export JAVAP="@FIXPATH@ $OUTPUT_ROOT/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@" |
| 77 | export JIMAGE="@FIXPATH@ $OUTPUT_ROOT/jdk/bin/jimage" |
| 78 | elif [ "@CREATE_BUILDJDK@" = "true" ]; then |
| 79 | export JAVAP="@FIXPATH@ $OUTPUT_ROOT/buildjdk/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@" |
| 80 | export JIMAGE="@FIXPATH@ $OUTPUT_ROOT/buildjdk/jdk/bin/jimage" |
| 81 | else |
| 82 | export JAVAP="@FIXPATH@ @BUILD_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@" |
| 83 | export JIMAGE="@FIXPATH@ @BUILD_JDK@/bin/jimage" |
| 84 | fi |
| 85 | |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 86 | if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
Magnus Ihse Bursie | 041790c | 2015-09-23 10:17:38 +0200 | [diff] [blame] | 87 | export PATH="@VS_PATH@" |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 88 | fi |
| 89 | |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 90 | # Now locate the main script and run it. |
| 91 | REAL_COMPARE_SCRIPT="$SRC_ROOT/common/bin/compare.sh" |
| 92 | if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 93 | echo "Error: Cannot locate compare script, it should have been in $REAL_COMPARE_SCRIPT" |
| 94 | exit 1 |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 95 | fi |
| 96 | |
Magnus Ihse Bursie | 041790c | 2015-09-23 10:17:38 +0200 | [diff] [blame] | 97 | # Rotate logs |
| 98 | $RM $OUTPUT_ROOT/compare.log.old 2> /dev/null |
| 99 | $MV $OUTPUT_ROOT/compare.log $OUTPUT_ROOT/compare.log.old 2> /dev/null |
| 100 | |
Magnus Ihse Bursie | 0ac445c | 2015-11-05 10:58:53 +0100 | [diff] [blame] | 101 | export SCRIPT_DIR="$( cd "$( dirname "$0" )" > /dev/null && pwd )" |
| 102 | |
Magnus Ihse Bursie | 041790c | 2015-09-23 10:17:38 +0200 | [diff] [blame] | 103 | $BASH $SRC_ROOT/common/bin/logger.sh $OUTPUT_ROOT/compare.log $BASH "$REAL_COMPARE_SCRIPT" "$@" |