diff options
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/openjdk/files/jvm.cfg | 41 | ||||
-rw-r--r-- | recipes/openjdk/openjdk-6-common.inc | 47 |
2 files changed, 83 insertions, 5 deletions
diff --git a/recipes/openjdk/files/jvm.cfg b/recipes/openjdk/files/jvm.cfg new file mode 100644 index 0000000000..9e008e97f9 --- /dev/null +++ b/recipes/openjdk/files/jvm.cfg @@ -0,0 +1,41 @@ +# Copyright 2003 Sun Microsystems, Inc. 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. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# +# +# List of JVMs that can be used as an option to java, javac, etc. +# Order is important -- first in this list is the default JVM. +# NOTE that this both this file and its format are UNSUPPORTED and +# WILL GO AWAY in a future release. +# +# You may also select a JVM in an arbitrary location with the +# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported +# and may not be available in a future release. +# +-server ERROR +-client IGNORE +-hotspot ERROR +-classic WARN +-native ERROR +-green ERROR +-zero ALIASED_TO -server +-cacao ERROR diff --git a/recipes/openjdk/openjdk-6-common.inc b/recipes/openjdk/openjdk-6-common.inc index 84fc526e17..c38aadc71c 100644 --- a/recipes/openjdk/openjdk-6-common.inc +++ b/recipes/openjdk/openjdk-6-common.inc @@ -10,7 +10,7 @@ ICEDTEA = "NEEDS TO BE SET" S = "${WORKDIR}/${ICEDTEA}" B = "${S}/build" -INC_PR = "r8" +INC_PR = "r9" SRC_URI = "\ ${ICEDTEA_URI} \ @@ -21,6 +21,7 @@ SRC_URI = "\ ${CACAO_URI} \ ${OEPATCHES} \ ${ICEDTEAPATCHES} \ + file://jvm.cfg \ " JDK_PN = "openjdk-6" @@ -337,6 +338,8 @@ do_install() { rm ${D}${JDK_HOME}/bin/$bf ln -s ${JDK_HOME}/jre/bin/$bf ${D}${JDK_HOME}/bin/$bf done + + install -m644 ${WORKDIR}/jvm.cfg ${D}${JDK_HOME}/jre/lib/${JDK_ARCH}/ } # Manual staging step that is only needed for oe-stable. @@ -459,19 +462,53 @@ RDEPENDS_${JDK_PN}-jdk = "${JDK_PN}-jre" FILES_${JDK_PN}-doc = "${JDK_HOME}/man" pkg_postinst_${JDK_PN}-vm-shark () { - sed -i -e "s|^\-shark.*||" -e "s|\(^\-server*\)|\-shark KNOWN\n\1|" ${JDK_HOME}/jre/lib/arm/jvm.cfg + if grep -q "\-cacao KNOWN" ${JDK_HOME}/jre/lib/arm/jvm.cfg && grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/arm/jvm.cfg; then + sed -i -e "/\-cacao KNOWN/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg + echo "-cacao KNOWN" >> ${JDK_HOME}/jre/lib/arm/jvm.cfg + fi + + sed -i -e "/\-shark.*/d" -e "s|\(^\-server*\)|\-shark KNOWN\n\1|" -e "/^$/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg } pkg_prerm_${JDK_PN}-vm-shark () { - sed -i -e "s|^\-shark.*||" ${JDK_HOME}/jre/lib/arm/jvm.cfg + sed -i -e "/^\-shark.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg + if grep -q "\-cacao KNOWN" ${JDK_HOME}/jre/lib/arm/jvm.cfg && grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/arm/jvm.cfg; then + sed -i -e "/\-cacao KNOWN/d" -e "s|\(^\-server*\)|\-cacao KNOWN\n\1|" ${JDK_HOME}/jre/lib/arm/jvm.cfg + fi } pkg_postinst_${JDK_PN}-vm-cacao () { - sed -i -e "s|^\-cacao.*|\-cacao KNOWN|" ${JDK_HOME}/jre/lib/arm/jvm.cfg + if grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/arm/jvm.cfg && ! grep -q "\-shark KNOWN" ${JDK_HOME}/jre/lib/arm/jvm.cfg; then + sed -i -e "/\-cacao.*/d" -e "s|\(^\-server*\)|\-cacao KNOWN\n\1|" -e "/^$/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg + else + sed -i -e "s|^\-cacao.*|\-cacao KNOWN|" -e "/^$/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg + fi } pkg_prerm_${JDK_PN}-vm-cacao () { - sed -i -e "s|^\-cacao.*|\-cacao ERROR|" ${JDK_HOME}/jre/lib/arm/jvm.cfg + if grep -q "\-server ERROR" ${JDK_HOME}/jre/lib/arm/jvm.cfg && ! grep -q "\-shark KNOWN" ${JDK_HOME}/jre/lib/arm/jvm.cfg; then + sed -i -e "/\-cacao.*/d" -e "/^$/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg + echo "-cacao ERROR" >> ${JDK_HOME}/jre/lib/arm/jvm.cfg + else + sed -i -e "s|^\-cacao.*|\-cacao ERROR|" -e "/^$/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg + fi +} + +pkg_postinst_${JDK_PN}-vm-zero () { + if grep -q "\-cacao KNOWN" ${JDK_HOME}/jre/lib/arm/jvm.cfg && ! grep -q "\-shark KNOWN" ${JDK_HOME}/jre/lib/arm/jvm.cfg; then + sed -i -e "/\-cacao KNOWN/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg + echo "-cacao KNOWN" >> ${JDK_HOME}/jre/lib/arm/jvm.cfg + fi + + sed -i -e "s|^\-server.*|\-server KNOWN|" -e "/^$/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg +} + +pkg_prerm_${JDK_PN}-vm-zero () { + if grep -q "\-cacao KNOWN" ${JDK_HOME}/jre/lib/arm/jvm.cfg && ! grep -q "\-shark KNOWN" ${JDK_HOME}/jre/lib/arm/jvm.cfg; then + sed -i -e "/\-cacao KNOWN/d" -e "s|\(^\-server*\)|\-cacao KNOWN\n\1|" ${JDK_HOME}/jre/lib/arm/jvm.cfg + fi + + sed -i -e "s|^\-server.*|\-server ERROR|" -e "/^$/d" ${JDK_HOME}/jre/lib/arm/jvm.cfg } pkg_postinst_${JDK_PN}-jre () { |