make/devkit/createSolarisDevkit12.6.sh
author jcm
Fri, 05 Jul 2019 00:24:54 -0700
changeset 55604 a30c86af2eb7
parent 51899 11fd6c8188d9
permissions -rw-r--r--
8226627: assert(t->singleton()) failed: must be a constant Summary: Implemented constant folding for MaxFD, MinFD. Reviewed-by: thartmann, bsrbnd, pli
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
     1
#!/bin/bash
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
     2
#
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
     3
# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
     5
#
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
     8
# published by the Free Software Foundation.  Oracle designates this
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
     9
# particular file as subject to the "Classpath" exception as provided
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    10
# by Oracle in the LICENSE file that accompanied this code.
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    11
#
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    12
# This code is distributed in the hope that it will be useful, but WITHOUT
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    13
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    14
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    15
# version 2 for more details (a copy is included in the LICENSE file that
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    16
# accompanied this code).
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    17
#
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    18
# You should have received a copy of the GNU General Public License version
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    19
# 2 along with this work; if not, write to the Free Software Foundation,
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    20
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    21
#
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    22
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    23
# or visit www.oracle.com if you need additional information or have any
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    24
# questions.
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    25
#
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    26
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    27
# This script creates a devkit for building OpenJDK on Solaris by copying
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    28
# part of a Solaris Studio installation and cretaing a sysroot by installing
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    29
# a limited set of system packages. It is assumed that a suitable pkg
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    30
# publisher is configured for the system where the script is executed.
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    31
#
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    32
# Note that you will need to be able to sudo to root to run the pkg install
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    33
# part of this script. It should not affect the running system, but only
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    34
# install in a separate temporary image.
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    35
#
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    36
# The Solaris Studio installation must contain at least these packages:
51899
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    37
#developer/developerstudio-126/backend                12.6-1.0.0.1
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    38
#developer/developerstudio-126/c++                    12.6-1.0.2.0
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    39
#developer/developerstudio-126/cc                     12.6-1.0.1.0
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    40
#developer/developerstudio-126/dbx                    12.6-1.0.0.1
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    41
#developer/developerstudio-126/library/c++-libs       12.6-1.0.2.0
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    42
#developer/developerstudio-126/library/c-libs         12.6-1.0.0.1
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    43
#developer/developerstudio-126/library/f90-libs       12.6-1.0.0.1
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    44
#developer/developerstudio-126/library/math-libs      12.6-1.0.0.1
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    45
#developer/developerstudio-126/library/studio-gccrt   12.6-1.0.0.1
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    46
#developer/developerstudio-126/studio-common          12.6-1.0.0.1
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    47
#developer/developerstudio-126/studio-ja              12.6-1.0.0.1
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    48
#developer/developerstudio-126/studio-legal           12.6-1.0.0.1
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    49
#developer/developerstudio-126/studio-zhCN            12.6-1.0.0.1
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    50
#
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    51
# erik.joelsson@oracle.com
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    52
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    53
USAGE="$0 <Solaris Studio installation>"
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    54
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    55
if [ "$1" = "" ]; then
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    56
  echo $USAGE
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    57
  exit 1
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    58
fi
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    59
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    60
SOLARIS_STUDIO_VERSION=12u6
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    61
SOLARIS_VERSION=11u3
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    62
SOLARIS_ENTIRE_VERSION=0.5.11-0.175.3.20.0.6.0
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    63
case `uname -p` in
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    64
  i*)
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    65
    ARCH=x86
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    66
    ;;
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    67
  sparc*)
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    68
    ARCH=sparc
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    69
    ;;
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    70
esac
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    71
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    72
SOLARIS_STUDIO_SRC=$1
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    73
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    74
SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    75
BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    76
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    77
DEVKIT_NAME=SS${SOLARIS_STUDIO_VERSION}-Solaris${SOLARIS_VERSION}
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    78
DEVKIT_ROOT=${BUILD_DIR}/${DEVKIT_NAME}
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    79
BUNDLE_NAME=${DEVKIT_NAME}.tar.gz
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    80
BUNDLE=${BUILD_DIR}/${BUNDLE_NAME}
48909
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
    81
INSTALL_ROOT=${BUILD_DIR}/install-root-$SOLARIS_VERSION
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    82
SYSROOT=${DEVKIT_ROOT}/sysroot
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    83
SOLARIS_STUDIO_SUBDIR=SS${SOLARIS_STUDIO_VERSION}
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    84
SOLARIS_STUDIO_DIR=${DEVKIT_ROOT}/${SOLARIS_STUDIO_SUBDIR}
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    85
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    86
# Extract the publisher from the system
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    87
if [ -z "${PUBLISHER_URI}" ]; then
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    88
  PUBLISHER_URI="$(pkg publisher solaris | grep URI | awk '{ print $3 }')"
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    89
fi
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    90
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    91
if [ ! -d $INSTALL_ROOT ]; then
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    92
  echo "Creating $INSTALL_ROOT and installing packages"
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    93
  pkg image-create $INSTALL_ROOT
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    94
  pkg -R $INSTALL_ROOT set-publisher -P -g ${PUBLISHER_URI} solaris
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    95
  sudo pkg -R $INSTALL_ROOT install --accept entire@$SOLARIS_ENTIRE_VERSION \
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
    96
      system/install developer/gnu-binutils system/library/mmheap system/picl \
51899
11fd6c8188d9 8211130: Change to Oracle Developer Studio 12.6 for building on Solaris at Oracle
erikj
parents: 48919
diff changeset
    97
      developer/assembler system/library/freetype-2
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    98
else
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
    99
  echo "Skipping installing packages"
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   100
fi
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   101
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   102
if [ ! -d $SYSROOT ]; then
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   103
  echo "Copying from $INSTALL_ROOT to $SYSROOT"
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   104
  mkdir -p $SYSROOT
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   105
  cp -rH $INSTALL_ROOT/lib $SYSROOT/
48909
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   106
  mkdir $SYSROOT/usr
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   107
  cp -rH $INSTALL_ROOT/usr/lib $SYSROOT/usr/
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   108
  cp -rH $INSTALL_ROOT/usr/include $SYSROOT/usr/
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   109
  pkg -R $INSTALL_ROOT list > $SYSROOT/pkg-list.txt
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   110
else
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   111
  echo "Skipping copying to $SYSROOT"
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   112
fi
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   113
48909
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   114
if [ ! -d $DEVKIT_ROOT/tools ]; then
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   115
  # Some of the tools in sysroot are needed in the OpenJDK build. We need
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   116
  # to copy them into a tools dir, including their specific libraries.
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   117
  mkdir -p $DEVKIT_ROOT/tools/usr/bin $DEVKIT_ROOT/tools/lib/sparcv9 \
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   118
      $DEVKIT_ROOT/tools/usr/gnu/bin $DEVKIT_ROOT/tools/usr/bin/sparcv9
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   119
  cp $INSTALL_ROOT/usr/bin/{as,ar,nm,strip,ld,pigz,ldd} \
48909
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   120
       $DEVKIT_ROOT/tools/usr/bin/
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   121
  cp $INSTALL_ROOT/usr/sbin/dtrace $DEVKIT_ROOT/tools/usr/bin/
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   122
  cp $INSTALL_ROOT/usr/sbin/sparcv9/dtrace $DEVKIT_ROOT/tools/usr/bin/sparcv9/
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   123
  cp -rH $INSTALL_ROOT/usr/gnu/bin/* $DEVKIT_ROOT/tools/usr/gnu/bin/
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   124
  cp $INSTALL_ROOT/lib/sparcv9/{libelf.so*,libld.so*,liblddbg.so*} $DEVKIT_ROOT/tools/lib/sparcv9/
48909
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   125
  for t in $(ls $DEVKIT_ROOT/tools/usr/gnu/bin); do
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   126
    if [ -f $DEVKIT_ROOT/tools/usr/gnu/bin/$t ]; then
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   127
      ln -s ../gnu/bin/$t $DEVKIT_ROOT/tools/usr/bin/g$t
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   128
    fi
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   129
  done
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   130
else
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   131
  echo "Skipping copying to tools dir $DEVKIT_ROOT/tools"
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   132
fi
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   133
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   134
if [ ! -d $SOLARIS_STUDIO_DIR ]; then
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   135
  echo "Copying Solaris Studio from $SOLARIS_STUDIO_SRC"
48909
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   136
  mkdir -p ${SOLARIS_STUDIO_DIR}
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   137
  cp -rH $SOLARIS_STUDIO_SRC/. ${SOLARIS_STUDIO_DIR}/
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   138
  # Solaris Studio 12.6 requires libmmheap.so.1 and libsunmath.so.1 to run, but
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   139
  # these libs are not installed by default on all Solaris systems.
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   140
  # Sneak them in from the sysroot to make it run OOTB on more systems.
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   141
  cp $SYSROOT/lib/libsunmath.so.1 $SOLARIS_STUDIO_DIR/lib/compilers/sys/
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   142
  cp $SYSROOT/lib/sparcv9/libsunmath.so.1 $SOLARIS_STUDIO_DIR/lib/compilers/sys/sparcv9/
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   143
  cp $SYSROOT/lib/libmmheap.so.1 $SOLARIS_STUDIO_DIR/lib/compilers/sys/
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   144
  cp $SYSROOT/lib/sparcv9/libmmheap.so.1 $SOLARIS_STUDIO_DIR/lib/compilers/sys/sparcv9/
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   145
else
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   146
  echo "Skipping copying of Solaris Studio"
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   147
fi
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   148
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   149
# Create the devkit.info file
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   150
echo Creating devkit.info
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   151
INFO_FILE=$DEVKIT_ROOT/devkit.info
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   152
rm -f $INFO_FILE
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   153
echo "# This file describes to configure how to interpret the contents of this devkit" >> $INFO_FILE
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   154
echo "DEVKIT_NAME=\"Solaris Studio $SOLARIS_STUDIO_VERSION - Solaris $SOLARIS_VERSION - $ARCH\"" >> $INFO_FILE
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   155
echo "DEVKIT_TOOLCHAIN_PATH=\"\$DEVKIT_ROOT/$SOLARIS_STUDIO_SUBDIR/bin:\$DEVKIT_ROOT/bin\"" >> $INFO_FILE
48909
54b423e1c4cf 8153294: Solaris devkit uses linker from system instead of in devkit
erikj
parents: 34606
diff changeset
   156
echo "DEVKIT_EXTRA_PATH=\"\$DEVKIT_ROOT/tools/usr/bin\"" >> $INFO_FILE
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   157
echo "DEVKIT_SYSROOT=\"\$DEVKIT_ROOT/sysroot\"" >> $INFO_FILE
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   158
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   159
if [ ! -e $BUNDLE ]; then
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   160
  GZIP=$(command -v pigz)
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   161
  if [ -z "$GZIP" ]; then
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   162
    GZIP="gzip"
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   163
  fi
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   164
  echo "Creating $BUNDLE from $DEVKIT_ROOT"
48919
c7e84c0a51c3 8198328: Create devkit for Solaris with developer studio 12.6 and Solaris11.3
erikj
parents: 48909
diff changeset
   165
  (cd $DEVKIT_ROOT && tar cf - . | $GZIP - > "$BUNDLE")
34595
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   166
else
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   167
  echo "Skipping creation of $BUNDLE"
09596fe63e2d 8145391: Updated jprt.properties, devtools, jib and readme with SS12u4
erikj
parents:
diff changeset
   168
fi