annotate make/devkit/createMacosxDevkit6.sh @ 52576:367ca5f32505

8213829: Remove circular dependency between g1CollectedHeap and g1ConcurrentMark Summary: Improve include statements related to g1CollectedHeap.inline.hpp Reviewed-by: kbarrett, tschatzl
author manc
date Tue, 13 Nov 2018 22:08:44 -0800
parents 1a80e1d10cc4
children 28094715ae71
rev   line source
erikj@31123 1 #!/bin/bash
erikj@31123 2 #
erikj@31123 3 # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
erikj@31123 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
erikj@31123 5 #
erikj@31123 6 # This code is free software; you can redistribute it and/or modify it
erikj@31123 7 # under the terms of the GNU General Public License version 2 only, as
erikj@31123 8 # published by the Free Software Foundation. Oracle designates this
erikj@31123 9 # particular file as subject to the "Classpath" exception as provided
erikj@31123 10 # by Oracle in the LICENSE file that accompanied this code.
erikj@31123 11 #
erikj@31123 12 # This code is distributed in the hope that it will be useful, but WITHOUT
erikj@31123 13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
erikj@31123 14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
erikj@31123 15 # version 2 for more details (a copy is included in the LICENSE file that
erikj@31123 16 # accompanied this code).
erikj@31123 17 #
erikj@31123 18 # You should have received a copy of the GNU General Public License version
erikj@31123 19 # 2 along with this work; if not, write to the Free Software Foundation,
erikj@31123 20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
erikj@31123 21 #
erikj@31123 22 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
erikj@31123 23 # or visit www.oracle.com if you need additional information or have any
erikj@31123 24 # questions.
erikj@31123 25 #
erikj@31123 26
erikj@31123 27 # This script copies part of an Xcode installer into a devkit suitable
erikj@31123 28 # for building OpenJDK and OracleJDK. The installation .dmg files for Xcode
erikj@31123 29 # and the aux tools need to be available.
erikj@31123 30 # erik.joelsson@oracle.com
erikj@31123 31
erikj@33439 32 USAGE="$0 <Xcode.dmg> <XQuartz.dmg> <gnu make binary> [<auxtools.dmg>]"
erikj@31123 33
erikj@31123 34 if [ "$1" = "" ] || [ "$2" = "" ]; then
erikj@31123 35 echo $USAGE
erikj@31123 36 exit 1
erikj@31123 37 fi
erikj@31123 38
erikj@31123 39 XCODE_DMG="$1"
erikj@31123 40 XQUARTZ_DMG="$2"
erikj@33439 41 GNU_MAKE="$3"
erikj@33439 42 AUXTOOLS_DMG="$4"
erikj@31123 43
erikj@31123 44 SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
erikj@31123 45 BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
erikj@31123 46
erikj@31123 47 # Mount XCODE_DMG
erikj@31123 48 if [ -e "/Volumes/Xcode" ]; then
erikj@31123 49 hdiutil detach /Volumes/Xcode
erikj@31123 50 fi
erikj@31123 51 hdiutil attach $XCODE_DMG
erikj@31123 52
erikj@31123 53 # Find the version of Xcode
erikj@31123 54 XCODE_VERSION="$(/Volumes/Xcode/Xcode.app/Contents/Developer/usr/bin/xcodebuild -version \
erikj@31123 55 | awk '/Xcode/ { print $2 }' )"
erikj@33439 56 SDK_VERSION="MacOSX10.9"
erikj@33439 57 if [ ! -e "/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk" ]; then
erikj@33439 58 echo "Expected SDK version not found: ${SDK_VERSION}"
erikj@33439 59 exit 1
erikj@33439 60 fi
erikj@31123 61
erikj@33439 62 DEVKIT_ROOT="${BUILD_DIR}/Xcode${XCODE_VERSION}-${SDK_VERSION}"
erikj@31123 63 DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
erikj@31123 64
erikj@31123 65 echo "Xcode version: $XCODE_VERSION"
erikj@31123 66 echo "Creating devkit in $DEVKIT_ROOT"
erikj@31123 67
erikj@31123 68 ################################################################################
erikj@31123 69 # Copy files to root
erikj@31123 70 mkdir -p $DEVKIT_ROOT
erikj@31123 71 if [ ! -d $DEVKIT_ROOT/Xcode.app ]; then
erikj@31123 72 echo "Copying Xcode.app..."
erikj@31123 73 cp -RH "/Volumes/Xcode/Xcode.app" $DEVKIT_ROOT/
erikj@31123 74 fi
erikj@31123 75 # Trim out some seemingly unneeded parts to save space.
erikj@31123 76 rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Applications
erikj@31123 77 rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/iPhone*
erikj@31123 78 rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Documentation
erikj@31123 79 rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/share/man
erikj@33439 80 ( cd $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
erikj@33439 81 && rm -rf `ls | grep -v ${SDK_VERSION}` )
erikj@33439 82 rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/${SDK_VERSION}.sdk/usr/share/man
erikj@31123 83
erikj@31123 84 hdiutil detach /Volumes/Xcode
erikj@31123 85
erikj@31123 86 ################################################################################
erikj@31123 87 # Copy Freetype into sysroot
erikj@31123 88 if [ -e "/Volumes/XQuartz-*" ]; then
erikj@31123 89 hdiutil detach /Volumes/XQuartz-*
erikj@31123 90 fi
erikj@31123 91 hdiutil attach $XQUARTZ_DMG
erikj@31123 92
erikj@31123 93 echo "Copying freetype..."
erikj@31123 94 rm -rf /tmp/XQuartz
erikj@31123 95 pkgutil --expand /Volumes/XQuartz-*/XQuartz.pkg /tmp/XQuartz/
erikj@31123 96 rm -rf /tmp/x11
erikj@31123 97 mkdir /tmp/x11
erikj@31123 98 cd /tmp/x11
erikj@33439 99 cat /tmp/XQuartz/x11.pkg/Payload | gunzip -dc | cpio -i
erikj@31123 100
erikj@33439 101 mkdir -p $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/include/
erikj@33439 102 mkdir -p $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/lib/
erikj@31123 103 cp -RH opt/X11/include/freetype2 \
erikj@33439 104 $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/include/
erikj@31123 105 cp -RH opt/X11/include/ft2build.h \
erikj@33439 106 $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/include/
erikj@31123 107 cp -RH opt/X11/lib/libfreetype.* \
erikj@33439 108 $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/X11/lib/
erikj@31123 109
erikj@31123 110 cd -
erikj@31123 111
erikj@31123 112 hdiutil detach /Volumes/XQuartz-*
erikj@31123 113
erikj@31123 114 ################################################################################
erikj@33439 115 # Copy gnu make
erikj@33439 116 mkdir -p $DEVKIT_ROOT/bin
erikj@33439 117 cp $GNU_MAKE $DEVKIT_ROOT/bin
erikj@33439 118
erikj@33439 119 ################################################################################
erikj@31123 120 # Optionally copy PackageMaker
erikj@31123 121
erikj@31123 122 if [ -e "$AUXTOOLS_DMG" ]; then
erikj@31123 123 if [ -e "/Volumes/Auxiliary Tools" ]; then
erikj@31123 124 hdiutil detach "/Volumes/Auxiliary Tools"
erikj@31123 125 fi
erikj@31123 126 hdiutil attach $AUXTOOLS_DMG
erikj@31123 127
erikj@31123 128 echo "Copying PackageMaker.app..."
erikj@31123 129 cp -RH "/Volumes/Auxiliary Tools/PackageMaker.app" $DEVKIT_ROOT/
erikj@31123 130
erikj@31123 131 hdiutil detach "/Volumes/Auxiliary Tools"
erikj@31123 132 fi
erikj@31123 133
erikj@31123 134 ################################################################################
erikj@31123 135 # Generate devkit.info
erikj@31123 136
erikj@31123 137 echo-info() {
erikj@31123 138 echo "$1" >> $DEVKIT_ROOT/devkit.info
erikj@31123 139 }
erikj@31123 140
erikj@31123 141 echo "Generating devkit.info..."
erikj@31123 142 rm -f $DEVKIT_ROOT/devkit.info
erikj@31123 143 echo-info "# This file describes to configure how to interpret the contents of this devkit"
erikj@33439 144 echo-info "# The parameters used to create this devkit were:"
erikj@33439 145 echo-info "# $*"
erikj@31123 146 echo-info "DEVKIT_NAME=\"Xcode $XCODE_VERSION (devkit)\""
erikj@31123 147 echo-info "DEVKIT_TOOLCHAIN_PATH=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:\$DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/bin\""
erikj@31123 148 echo-info "DEVKIT_SYSROOT=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk\""
erikj@33439 149 echo-info "DEVKIT_EXTRA_PATH=\"\$DEVKIT_ROOT/bin:\$DEVKIT_ROOT/PackageMaker.app/Contents/MacOS:\$DEVKIT_TOOLCHAIN_PATH\""
erikj@31123 150
erikj@31123 151 ################################################################################
erikj@31123 152 # Copy this script
erikj@31123 153
erikj@31123 154 echo "Copying this script..."
erikj@31123 155 cp $0 $DEVKIT_ROOT/
erikj@31123 156
erikj@31123 157 ################################################################################
erikj@31123 158 # Create bundle
erikj@31123 159
erikj@31123 160 echo "Creating bundle..."
erikj@31123 161 (cd $DEVKIT_ROOT && tar c - . | gzip - > "$DEVKIT_BUNDLE")