--- old/common/autoconf/basics.m4 2015-06-11 15:06:45.131353074 +0200 +++ new/common/autoconf/basics.m4 2015-06-11 15:06:45.043349339 +0200 @@ -436,7 +436,6 @@ BASIC_PATH_PROGS(CYGPATH, cygpath) BASIC_PATH_PROGS(READLINK, [greadlink readlink]) BASIC_PATH_PROGS(DF, df) - BASIC_PATH_PROGS(SETFILE, SetFile) BASIC_PATH_PROGS(CPIO, [cpio bsdcpio]) ]) @@ -574,10 +573,11 @@ ) if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then - # detect if Xcode is installed by running xcodebuild -version + # If a devkit has been supplied, find xcodebuild in the toolchain_path. + # If not, detect if Xcode is installed by running xcodebuild -version # if no Xcode installed, xcodebuild exits with 1 # if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0 - if /usr/bin/xcodebuild -version >/dev/null 2>&1; then + if test "x$DEVKIT_ROOT" != x || /usr/bin/xcodebuild -version >/dev/null 2>&1; then # We need to use xcodebuild in the toolchain dir provided by the user, this will # fall back on the stub binary in /usr/bin/xcodebuild AC_PATH_PROG([XCODEBUILD], [xcodebuild], [/usr/bin/xcodebuild], [$TOOLCHAIN_PATH]) @@ -961,6 +961,7 @@ AC_MSG_RESULT([yes]) fi fi + BASIC_REQUIRE_PROGS(SETFILE, SetFile) fi ]) --- old/common/autoconf/build-aux/config.guess 2015-06-11 15:06:45.515369369 +0200 +++ new/common/autoconf/build-aux/config.guess 2015-06-11 15:06:45.427365635 +0200 @@ -86,4 +86,11 @@ fi fi +# Test and fix cpu on Macosx when C preprocessor is not on the path +echo $OUT | grep i386-apple-darwin > /dev/null 2> /dev/null +if test $? = 0; then + REAL_CPU=`uname -m` + OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'` +fi + echo $OUT --- /dev/null 2015-05-04 14:54:52.500140544 +0200 +++ new/make/devkit/createMacosxDevkit.sh 2015-06-11 15:06:45.803381590 +0200 @@ -0,0 +1,147 @@ +#!/bin/bash +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This script copies part of an Xcode installer into a devkit suitable +# for building OpenJDK and OracleJDK. The installation .dmg files for Xcode +# and the aux tools need to be available. +# erik.joelsson@oracle.com + +USAGE="$0 []" + +if [ "$1" = "" ] || [ "$2" = "" ]; then + echo $USAGE + exit 1 +fi + +XCODE_DMG="$1" +XQUARTZ_DMG="$2" +AUXTOOLS_DMG="$3" + +SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" +BUILD_DIR="${SCRIPT_DIR}/../../build/devkit" + +# Mount XCODE_DMG +if [ -e "/Volumes/Xcode" ]; then + hdiutil detach /Volumes/Xcode +fi +hdiutil attach $XCODE_DMG + +# Find the version of Xcode +XCODE_VERSION="$(/Volumes/Xcode/Xcode.app/Contents/Developer/usr/bin/xcodebuild -version \ + | awk '/Xcode/ { print $2 }' )" + +DEVKIT_ROOT="${BUILD_DIR}/Xcode${XCODE_VERSION}-devkit" +DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz" + +echo "Xcode version: $XCODE_VERSION" +echo "Creating devkit in $DEVKIT_ROOT" + +################################################################################ +# Copy files to root +mkdir -p $DEVKIT_ROOT +if [ ! -d $DEVKIT_ROOT/Xcode.app ]; then + echo "Copying Xcode.app..." + cp -RH "/Volumes/Xcode/Xcode.app" $DEVKIT_ROOT/ +fi +# Trim out some seemingly unneeded parts to save space. +rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Applications +rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/iPhone* +rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Documentation +rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/share/man +if [ -e $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk ]; then + rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk + rm -rf $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/share/man +fi + +hdiutil detach /Volumes/Xcode + +################################################################################ +# Copy Freetype into sysroot +if [ -e "/Volumes/XQuartz-*" ]; then + hdiutil detach /Volumes/XQuartz-* +fi +hdiutil attach $XQUARTZ_DMG + +echo "Copying freetype..." +rm -rf /tmp/XQuartz +pkgutil --expand /Volumes/XQuartz-*/XQuartz.pkg /tmp/XQuartz/ +rm -rf /tmp/x11 +mkdir /tmp/x11 +cd /tmp/x11 +cat /tmp/XQuartz-*/x11.pkg/Payload | gunzip -dc |cpio -i + +cp -RH opt/X11/include/freetype2 \ + $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/ +cp -RH opt/X11/include/ft2build.h \ + $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/ +cp -RH opt/X11/lib/libfreetype.* \ + $DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/ + +cd - + +hdiutil detach /Volumes/XQuartz-* + +################################################################################ +# Optionally copy PackageMaker + +if [ -e "$AUXTOOLS_DMG" ]; then + if [ -e "/Volumes/Auxiliary Tools" ]; then + hdiutil detach "/Volumes/Auxiliary Tools" + fi + hdiutil attach $AUXTOOLS_DMG + + echo "Copying PackageMaker.app..." + cp -RH "/Volumes/Auxiliary Tools/PackageMaker.app" $DEVKIT_ROOT/ + + hdiutil detach "/Volumes/Auxiliary Tools" +fi + +################################################################################ +# Generate devkit.info + +echo-info() { + echo "$1" >> $DEVKIT_ROOT/devkit.info +} + +echo "Generating devkit.info..." +rm -f $DEVKIT_ROOT/devkit.info +echo-info "# This file describes to configure how to interpret the contents of this devkit" +echo-info "DEVKIT_NAME=\"Xcode $XCODE_VERSION (devkit)\"" +echo-info "DEVKIT_TOOLCHAIN_PATH=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:\$DEVKIT_ROOT/Xcode.app/Contents/Developer/usr/bin\"" +echo-info "DEVKIT_SYSROOT=\"\$DEVKIT_ROOT/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk\"" +echo-info "DEVKIT_EXTRA_PATH=\"\$DEVKIT_ROOT/PackageMaker.app/Contents/MacOS:\$DEVKIT_TOOLCHAIN_PATH\"" + +################################################################################ +# Copy this script + +echo "Copying this script..." +cp $0 $DEVKIT_ROOT/ + +################################################################################ +# Create bundle + +echo "Creating bundle..." +(cd $DEVKIT_ROOT && tar c - . | gzip - > "$DEVKIT_BUNDLE")