compare.sh.in revision 2024:cc16e2a24f94
1#!/bin/bash
2#
3# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
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
25# This script is processed by configure before it's usable. It is run from
26# the root of the build directory.
27
28
29##########################################################################################
30# Substitutions from autoconf
31
32export LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@
33
34export OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@"
35export OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@"
36export OPENJDK_TARGET_CPU_LIBDIR="@OPENJDK_TARGET_CPU_LIBDIR@"
37export DEBUG_LEVEL="@DEBUG_LEVEL@"
38
39export AWK="@AWK@"
40export BASH="@BASH@"
41export CAT="@CAT@"
42export CMP="@CMP@"
43export CP="@CP@"
44export CUT="@CUT@"
45export DIFF="@DIFF@"
46export DUMPBIN="@FIXPATH@ @DUMPBIN@"
47export EXPR="@EXPR@"
48export FILE="@FILE@"
49export FIND="@FIND@"
50export GREP="@GREP@"
51export JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
52export JIMAGE="@FIXPATH@ @BUILD_OUTPUT@/jdk/bin/jimage"
53export LDD="@LDD@"
54export LN="@LN@"
55export MKDIR="@MKDIR@"
56export MV="@MV@"
57export NAWK="@NAWK@"
58export NM="@GNM@"
59export OBJDUMP="@OBJDUMP@"
60export OTOOL="@OTOOL@"
61export PRINTF="@PRINTF@"
62export READELF="@READELF@"
63export RM="@RM@"
64export SED="@SED@"
65export SORT="@SORT@"
66export STAT="@STAT@"
67export STRIP="@STRIP@ @STRIPFLAGS@"
68export TEE="@TEE@"
69export UNIQ="@UNIQ@"
70export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
71export UNARCHIVE="@UNZIP@ -q"
72
73export SRC_ROOT="@TOPDIR@"
74export OUTPUT_ROOT="@OUTPUT_ROOT@"
75
76if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
77  export PATH="@VS_PATH@"
78fi
79
80# Now locate the main script and run it.
81REAL_COMPARE_SCRIPT="$SRC_ROOT/common/bin/compare.sh"
82if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then
83  echo "Error: Cannot locate compare script, it should have been in $REAL_COMPARE_SCRIPT"
84  exit 1
85fi
86
87# Rotate logs
88$RM $OUTPUT_ROOT/compare.log.old 2> /dev/null
89$MV $OUTPUT_ROOT/compare.log $OUTPUT_ROOT/compare.log.old 2> /dev/null
90
91export SCRIPT_DIR="$( cd "$( dirname "$0" )" > /dev/null && pwd )"
92
93$BASH $SRC_ROOT/common/bin/logger.sh $OUTPUT_ROOT/compare.log $BASH "$REAL_COMPARE_SCRIPT" "$@"
94