make/autoconf/compare.sh.in
author dchuyko
Tue, 19 Jun 2018 18:18:46 +0300
changeset 50642 fff48b02d4a6
parent 47253 92fd0e04e0e1
child 53110 50677f43ac3d
permissions -rw-r--r--
8198719: MethodHandleHelper.linkToStatic should drop MH arg Reviewed-by: vlivanov, dlong
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     1
#!/bin/bash
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     2
#
41458
f285e333e8db 8167424: Various trivial fixes in build system
ihse
parents: 37972
diff changeset
     3
# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     5
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     8
# published by the Free Software Foundation.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
     9
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    14
# accompanied this code).
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    15
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    19
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    22
# questions.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    23
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    24
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 16661
diff changeset
    25
# This script is processed by configure before it's usable. It is run from
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    26
# the root of the build directory.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    27
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    28
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    29
##########################################################################################
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    30
# Substitutions from autoconf
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    31
32718
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    32
export LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    33
37651
993399568864 8155641: Correct merge typo in compare script
erikj
parents: 37405
diff changeset
    34
export OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@"
32718
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    35
export OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 35744
diff changeset
    36
export DEBUG_LEVEL="@DEBUG_LEVEL@"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    37
32718
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    38
export AWK="@AWK@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    39
export BASH="@BASH@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    40
export CAT="@CAT@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    41
export CMP="@CMP@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    42
export CP="@CP@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    43
export CUT="@CUT@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    44
export DIFF="@DIFF@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    45
export DUMPBIN="@FIXPATH@ @DUMPBIN@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    46
export EXPR="@EXPR@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    47
export FILE="@FILE@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    48
export FIND="@FIND@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    49
export GREP="@GREP@"
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents: 37651
diff changeset
    50
export GUNZIP="@GUNZIP@"
32718
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    51
export LDD="@LDD@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    52
export LN="@LN@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    53
export MKDIR="@MKDIR@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    54
export MV="@MV@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    55
export NAWK="@NAWK@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    56
export NM="@GNM@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    57
export OBJDUMP="@OBJDUMP@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    58
export OTOOL="@OTOOL@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    59
export PRINTF="@PRINTF@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    60
export READELF="@READELF@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    61
export RM="@RM@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    62
export SED="@SED@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    63
export SORT="@SORT@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    64
export STAT="@STAT@"
32812
ddehaven
parents: 32718 32811
diff changeset
    65
export STRIP="@STRIP@ @STRIPFLAGS@"
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents: 37651
diff changeset
    66
export TAR="@TAR@"
32718
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    67
export TEE="@TEE@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    68
export UNIQ="@UNIQ@"
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    69
export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
37972
e1fa5c2e62a0 8136777: Introduce bundle targets
erikj
parents: 37651
diff changeset
    70
export UNARCHIVE="@UNZIP@ -q -o"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    71
47252
fdac20095dff 8187543: Replace SRC_ROOT with TOPDIR
ihse
parents: 47217
diff changeset
    72
export TOPDIR="@TOPDIR@"
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47252
diff changeset
    73
export OUTPUTDIR="@OUTPUTDIR@"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    74
36789
46a9456815a3 8152691: Compare script broken after Module system
erikj
parents: 35744
diff changeset
    75
if [ "@COMPILE_TYPE@" != "cross" ]; then
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47252
diff changeset
    76
    export JAVAP="@FIXPATH@ $OUTPUTDIR/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47252
diff changeset
    77
    export JIMAGE="@FIXPATH@ $OUTPUTDIR/jdk/bin/jimage"
36789
46a9456815a3 8152691: Compare script broken after Module system
erikj
parents: 35744
diff changeset
    78
elif [ "@CREATE_BUILDJDK@" = "true" ]; then
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47252
diff changeset
    79
    export JAVAP="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47252
diff changeset
    80
    export JIMAGE="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/jimage"
36789
46a9456815a3 8152691: Compare script broken after Module system
erikj
parents: 35744
diff changeset
    81
else
46a9456815a3 8152691: Compare script broken after Module system
erikj
parents: 35744
diff changeset
    82
    export JAVAP="@FIXPATH@ @BUILD_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
46a9456815a3 8152691: Compare script broken after Module system
erikj
parents: 35744
diff changeset
    83
    export JIMAGE="@FIXPATH@ @BUILD_JDK@/bin/jimage"
46a9456815a3 8152691: Compare script broken after Module system
erikj
parents: 35744
diff changeset
    84
fi
46a9456815a3 8152691: Compare script broken after Module system
erikj
parents: 35744
diff changeset
    85
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    86
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
32718
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    87
  export PATH="@VS_PATH@"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    88
fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    89
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    90
# Now locate the main script and run it.
47252
fdac20095dff 8187543: Replace SRC_ROOT with TOPDIR
ihse
parents: 47217
diff changeset
    91
REAL_COMPARE_SCRIPT="$TOPDIR/make/scripts/compare.sh"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    92
if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 16661
diff changeset
    93
  echo "Error: Cannot locate compare script, it should have been in $REAL_COMPARE_SCRIPT"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 16661
diff changeset
    94
  exit 1
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    95
fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents:
diff changeset
    96
32718
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
    97
# Rotate logs
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47252
diff changeset
    98
$RM $OUTPUTDIR/compare.log.old 2> /dev/null
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47252
diff changeset
    99
$MV $OUTPUTDIR/compare.log $OUTPUTDIR/compare.log.old 2> /dev/null
32718
fadee4d0b5ec 8136813: Log compare.sh output automatically to file
ihse
parents: 27602
diff changeset
   100
33441
ce975712c050 8141439: Fix compare.sh -o <otherdir> (broken by JDK-8136813)
ihse
parents: 33031
diff changeset
   101
export SCRIPT_DIR="$( cd "$( dirname "$0" )" > /dev/null && pwd )"
ce975712c050 8141439: Fix compare.sh -o <otherdir> (broken by JDK-8136813)
ihse
parents: 33031
diff changeset
   102
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47252
diff changeset
   103
$BASH $TOPDIR/make/scripts/logger.sh $OUTPUTDIR/compare.log $BASH "$REAL_COMPARE_SCRIPT" "$@"