# Building the Java 1.7 BSD version of OpenJDK on Mac OS X # # filename: update.sh # latest version available here: http://gist.github.com/617451 # # Stephen Bannasch, 2009 11 29, tested on Mac OS X 10.5.8 # # This script assumes: # Apple's Mac OX X developer tools are installed # hg (mercurial) is installed # The forest extension to hg is installed # SoyLatte 32-bit Java 1.6 is located here: # /usr/local/soylatte16-i386-1.0.3 # ALT_JIBX_LIBS_PATH points to JIBX v1.1.5 # # References: # http://wikis.sun.com/display/mlvm # http://wikis.sun.com/display/mlvm/Building # http://hg.openjdk.java.net/mlvm/mlvm/file/tip/README.txt # http://bit.ly/8TKqcS # http://landonf.bikemonkey.org/static/soylatte/ # http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html # http://sourceforge.net/projects/jibx/files/ # # http://hgbook.red-bean.com/read/advanced-uses-of-mercurial-queues.html # # Prerequisites: # SoyLatte 32-bit Java 1.6 # # Download v1.0.3 of Landon Fuller's SoyLatte Java 1.6 32 bit release # and install or link it to /usr/local/soylatte16-i386-1.0.3 and test it: # # $ /usr/local/soylatte16-i386-1.0.3/bin/java -version # java version "1.6.0_03-p3" # Java(TM) SE Runtime Environment (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00) # Java HotSpot(TM) Server VM (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00, mixed mode) # # JiBX v1.1.5 (Binding XML to Java libraries) # # Download and install v1.1.5 of JIBX from sourceforge # http://sourceforge.net/projects/jibx/files/ # update the ALT_JIBX_LIBS_PATH variable in this script. # # Basic setup after installing prerequisites: # hg fclone http://hg.openjdk.java.net/bsd-port/bsd-port bsd # cd bsd # # Create the ALT_COMPILER_PATH directoru and compiler links: # In the sources/ dir create the ALT_COMPILER_PATH dir and # the following symbolic links to the gcc 4.0 compilers: # # cd sources # mkdir ALT_COMPILER_PATH # cd ALT_COMPILER_PATH # ln -s /usr/bin .SOURCE # ln -s .SOURCE/g++-4.0 g++ # ln -s .SOURCE/gcc-4.0 gcc # # Building: # cd bsd # source update.sh # # After building see if the new build can report it's version number: # $ ./build/bsd-amd64/j2sdk-image/bin/java -version # openjdk version "1.7.0-internal" # OpenJDK Runtime Environment (build 1.7.0-internal-stephen_2010_10_08_15_33-b00) # OpenJDK 64-Bit Server VM (build 19.0-b05, mixed mode) SOYLATTE=/usr/local/soylatte16-i386-1.0.3 # echo ' # *** popping previously applied patches to bsdport sources: hotspot, jdk, and langtools ... # ' # cd hotspot; hg qpop -a; hg parent; cd - # cd jdk; hg qpop -a; hg parent; cd - # cd langtools; hg qpop -a; hg parent; cd - echo ' *** updating bsdport sources... ' hg fpull -u echo ' *** cleaning previous build products ... ' mv build build.del; rm -rf build.del & # Remove file with versioned name of last build and symbolic link to last build. # Used when referring to a build when copying to /usr/local or creating a tarball. 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 bsd-port: java 1.7.0 ... ' unset CLASSPATH unset JAVA_HOME unset LD_LIBRARY_PATH env -i PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin \ LANG=C \ CC=gcc-4.0 \ CXX=g++-4.0 \ make \ ALT_BOOTDIR=$SOYLATTE \ ALT_JDK_IMPORT_PATH=$SOYLATTE \ ALT_FREETYPE_HEADERS_PATH=/usr/X11R6/include \ ALT_FREETYPE_LIB_PATH=/usr/X11R6/lib \ ALT_CUPS_HEADERS_PATH=/usr/include \ ALLOW_DOWNLOADS=true \ ANT_HOME=/usr/share/ant \ NO_DOCS=true \ HOTSPOT_BUILD_JOBS=2 \ ARCH_DATA_MODEL=64 \ ALT_COMPILER_PATH=$(pwd -P)/ALT_COMPILER_PATH/ \ LD_LIBRARY_PATH= echo ' testing build: ./build/bsd-amd64/j2sdk-image/bin/java -version ' ./build/bsd-amd64/j2sdk-image/bin/java -version # Save a name with the date to use when referring to this build # when copying to /usr/local or creating a tarball later. buildname=java-1.7.0-internal-`date "+%Y_%m_%d"` ln -Ffs build/bsd-amd64/j2sdk-image/ $buildname echo $buildname > .last_build