1 #!/bin/bash
   2 #
   3 # Copyright (c) 2012, 2016, 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 
  32 export LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@
  33 
  34 export OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@"
  35 export OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@"
  36 export OPENJDK_TARGET_CPU_LIBDIR="@OPENJDK_TARGET_CPU_LIBDIR@"
  37 export DEBUG_LEVEL="@DEBUG_LEVEL@"
  38 
  39 export AWK="@AWK@"
  40 export BASH="@BASH@"
  41 export CAT="@CAT@"
  42 export CMP="@CMP@"
  43 export CP="@CP@"
  44 export CUT="@CUT@"
  45 export DIFF="@DIFF@"
  46 export DUMPBIN="@FIXPATH@ @DUMPBIN@"
  47 export EXPR="@EXPR@"
  48 export FILE="@FILE@"
  49 export FIND="@FIND@"
  50 export GREP="@GREP@"
  51 export GUNZIP="@GUNZIP@"
  52 export LDD="@LDD@"
  53 export LN="@LN@"
  54 export MKDIR="@MKDIR@"
  55 export MV="@MV@"
  56 export NAWK="@NAWK@"
  57 export NM="@GNM@"
  58 export OBJDUMP="@OBJDUMP@"
  59 export OTOOL="@OTOOL@"
  60 export PRINTF="@PRINTF@"
  61 export READELF="@READELF@"
  62 export RM="@RM@"
  63 export SED="@SED@"
  64 export SORT="@SORT@"
  65 export STAT="@STAT@"
  66 export STRIP="@STRIP@ @STRIPFLAGS@"
  67 export TAR="@TAR@"
  68 export TEE="@TEE@"
  69 export UNIQ="@UNIQ@"
  70 export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
  71 export UNARCHIVE="@UNZIP@ -q -o"
  72 
  73 export SRC_ROOT="@TOPDIR@"
  74 export OUTPUT_ROOT="@OUTPUT_ROOT@"
  75 
  76 if [ "@COMPILE_TYPE@" != "cross" ]; then
  77     export JAVAP="@FIXPATH@ $OUTPUT_ROOT/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
  78     export JIMAGE="@FIXPATH@ $OUTPUT_ROOT/jdk/bin/jimage"
  79 elif [ "@CREATE_BUILDJDK@" = "true" ]; then
  80     export JAVAP="@FIXPATH@ $OUTPUT_ROOT/buildjdk/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
  81     export JIMAGE="@FIXPATH@ $OUTPUT_ROOT/buildjdk/jdk/bin/jimage"
  82 else
  83     export JAVAP="@FIXPATH@ @BUILD_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
  84     export JIMAGE="@FIXPATH@ @BUILD_JDK@/bin/jimage"
  85 fi
  86 
  87 if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
  88   export PATH="@VS_PATH@"
  89 fi
  90 
  91 # Now locate the main script and run it.
  92 REAL_COMPARE_SCRIPT="$SRC_ROOT/common/bin/compare.sh"
  93 if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then
  94   echo "Error: Cannot locate compare script, it should have been in $REAL_COMPARE_SCRIPT"
  95   exit 1
  96 fi
  97 
  98 # Rotate logs
  99 $RM $OUTPUT_ROOT/compare.log.old 2> /dev/null
 100 $MV $OUTPUT_ROOT/compare.log $OUTPUT_ROOT/compare.log.old 2> /dev/null
 101 
 102 export SCRIPT_DIR="$( cd "$( dirname "$0" )" > /dev/null && pwd )"
 103 
 104 $BASH $SRC_ROOT/common/bin/logger.sh $OUTPUT_ROOT/compare.log $BASH "$REAL_COMPARE_SCRIPT" "$@"