building jdk7u-dev on Mac OS X (original) (raw)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
#!/bin/sh |
---|
# |
# https://wikis.oracle.com/display/OpenJDK/Mac+OS+X+Port |
# |
# hg clone http://hg.openjdk.java.net/jdk7u/jdk7u-dev |
# cd jdk7u-dev |
# |
# this script: https://gist.github.com/1904211 |
# |
# The Ruby script: jdk/src/macosx/native/jobjc/run-and-write-if-okay |
# doesn't work using Ruby 1.9.2, |
# |
# If you are using the RVM (Ruby Version Manager) then create the file '.rvmrc' |
# with the following to enable usage of the original system Ruby when building: |
# |
# rvm system |
# |
export JDK_IMPORT_PATH=`/usr/libexec/java_home -v 1.7` |
export JDK_UPDATE_VERSION=04 |
echo ' |
*** updating jdk7u-dev sources... |
' |
hg fpull -u |
# delete the previous build dir in the background if it exists |
if [ -e build ] |
then |
mv build build.del; rm -rf build.del & |
fi |
# Remove file with versioned name of last build and symbolic link to last build. |
# Used when referring to a build when copying or creating a tarball later. |
if [ -e .last_build ] |
then |
echo ' |
removing references to last build |
' |
buildname=`cat .last_build` |
rm -f .last_build |
rm -f $buildname |
fi |
echo ' |
*** building jdk7u-dev: java 1.7.0 ... |
' |
unset LC_ALL LANG CLASSPATH JAVA_HOME LD_LIBRARY_PATH; make ALLOW_DOWNLOADS=true SA_APPLE_BOOT_JAVA=true ALWAYS_PASS_TEST_GAMMA=true ALT_BOOTDIR=`/usr/libexec/java_home -v 1.6` HOTSPOT_BUILD_JOBS=`sysctl -n hw.ncpu` |
BUILD="build/macosx-amd64/j2sdk-bundle/1.7.0.jdk" |
BUILD_HOME="$BUILD/Contents/Home" |
BUILT_IMAGE="$BUILD_HOME/bin/java" |
JTREG_INVOKE="jtreg -XX:+UnlockExperimentalVMOptions -ignore:quiet -jdk:$BUILD_HOME" |
echo " |
*** smoketest build: $BUILT_IMAGE -version |
$BUILT_IMAGE -version |
" |
$BUILT_IMAGE -version |
echo " |
Run two suites of java/lang tests as a level-2 smoke-test |
*** running jdk/test/java/lang/String tests: |
$JTREG_INVOKE jdk/test/java/lang/String |
" |
$JTREG_INVOKE jdk/test/java/lang/String |
echo " |
*** running jdk/test/java/lang/invoke tests: |
$JTREG_INVOKE jdk/test/java/lang/invoke |
" |
$JTREG_INVOKE jdk/test/java/lang/invoke |
# Save a name with the date for referring to this build and create a symbolic |
# link to use when copying or creating a tarball later. |
buildname=1.7.0_$JDK_UPDATE_VERSION-`date "+%Y_%m_%d".jdk` |
ln -Ffs BUILD/BUILD/ BUILD/buildname |
echo $buildname > .last_build |
echo ' |
*** if the build works install with this command: |
' |
echo "cp -r $buildname ~/Library/Java/JavaVirtualMachines" |