summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jtools/Makefile4
-rw-r--r--jtools/ant/Makefile6
-rw-r--r--jtools/ecj/Makefile2
-rw-r--r--jtools/gcj/Makefile4
-rw-r--r--jtools/gcj/patches/disable-ldd-check.patch20
-rw-r--r--jtools/gcj/patches/no-lib64.patch100
-rw-r--r--jtools/openjdk7/Makefile57
-rw-r--r--jtools/openjdk7/patches/openadk.patch39
-rw-r--r--jtools/rules.mk2
-rw-r--r--package/openjdk7/Makefile99
-rw-r--r--package/openjdk7/patches/openadk.patch368
-rw-r--r--toolchain/eglibc/Makefile2
12 files changed, 576 insertions, 127 deletions
diff --git a/jtools/Makefile b/jtools/Makefile
index 728d46dac..4c911b33d 100644
--- a/jtools/Makefile
+++ b/jtools/Makefile
@@ -8,6 +8,10 @@ ifneq ($(ADK_PACKAGE_OPENJDK),)
# jikes is for ant
TARGETS+=fastjar gcj ecj jikes classpath jamvm ant openjdk qemu
endif
+ifneq ($(ADK_PACKAGE_OPENJDK7),)
+# jikes is for ant
+TARGETS+=fastjar gcj ecj jikes classpath jamvm ant openjdk7
+endif
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
diff --git a/jtools/ant/Makefile b/jtools/ant/Makefile
index 06a7f750c..1741ed703 100644
--- a/jtools/ant/Makefile
+++ b/jtools/ant/Makefile
@@ -4,10 +4,10 @@
include $(TOPDIR)/rules.mk
PKG_NAME:= ant
-PKG_VERSION:= 1.8.2
+PKG_VERSION:= 1.8.4
PKG_RELEASE:= 1
-PKG_MD5SUM:= 0d9e108afcd15b820150b8085c96d2b1
-PKG_SITES:= http://www.apache.org/dist/ant/source/
+PKG_MD5SUM:= c474fa9d0c35a24037c23b6e476862c1
+PKG_SITES:= http://archive.apache.org/dist/ant/source/
DISTFILES:= apache-$(PKG_NAME)-$(PKG_VERSION)-src.tar.bz2
WRKDIST= $(WRKDIR)/apache-$(PKG_NAME)-$(PKG_VERSION)
diff --git a/jtools/ecj/Makefile b/jtools/ecj/Makefile
index af051f9b9..2154bedce 100644
--- a/jtools/ecj/Makefile
+++ b/jtools/ecj/Makefile
@@ -17,7 +17,7 @@ ${STAGING_JAVA_HOST_DIR}/usr/bin/ecj:
DYLD_LIBRARY_PATH=$(STAGING_JAVA_HOST_DIR)/usr/lib:$(STAGING_JAVA_HOST_DIR)/usr/lib64 \
LD_LIBRARY_PATH=$(STAGING_JAVA_HOST_DIR)/usr/lib:$(STAGING_JAVA_HOST_DIR)/usr/lib64 \
PATH=$(STAGING_JAVA_HOST_DIR)/usr/bin:$$PATH \
- $(STAGING_JAVA_HOST_DIR)/usr/bin/gcj -O2 -findirect-dispatch \
+ $(STAGING_JAVA_HOST_DIR)/usr/bin/gcj -lgcj -O2 -findirect-dispatch \
-o ${STAGING_JAVA_HOST_DIR}/usr/bin/ecj.native \
--main=org.eclipse.jdt.internal.compiler.batch.Main \
$(TOPDIR)/jtools_build/gcc-$(GCJ_VER)/ecj.jar
diff --git a/jtools/gcj/Makefile b/jtools/gcj/Makefile
index 429574c7c..9af18704c 100644
--- a/jtools/gcj/Makefile
+++ b/jtools/gcj/Makefile
@@ -5,8 +5,8 @@ include $(TOPDIR)/rules.mk
PKG_NAME:= gcj
PKG_RELEASE:= 1
-PKG_VERSION:= 4.5.3
-PKG_MD5SUM:= d6559145853fbaaa0fd7556ed93bce9a
+PKG_VERSION:= 4.7.3
+PKG_MD5SUM:= 86f428a30379bdee0224e353ee2f999e
PKG_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/}
DISTFILES:= gcc-$(PKG_VERSION).tar.bz2
diff --git a/jtools/gcj/patches/disable-ldd-check.patch b/jtools/gcj/patches/disable-ldd-check.patch
deleted file mode 100644
index 370ffc9a8..000000000
--- a/jtools/gcj/patches/disable-ldd-check.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -Nur gcc-4.5.3.orig/gcc/configure gcc-4.5.3/gcc/configure
---- gcc-4.5.3.orig/gcc/configure 2010-12-03 13:35:37.000000000 +0100
-+++ gcc-4.5.3/gcc/configure 2011-10-19 11:29:26.155085565 +0200
-@@ -24579,16 +24579,7 @@
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_gnu_unique_object" >&5
- $as_echo "$gcc_cv_as_gnu_unique_object" >&6; }
- if test $gcc_cv_as_gnu_unique_object = yes; then
-- # Also check for ld.so support, i.e. glibc 2.11 or higher.
-- if test x$host = x$build -a x$host = x$target &&
-- glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
-- glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
-- glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
-- glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
-- if test "$glibcnum" -ge 2011 ; then
- enable_gnu_unique_object=yes
-- fi
-- fi
- fi
- fi
-
diff --git a/jtools/gcj/patches/no-lib64.patch b/jtools/gcj/patches/no-lib64.patch
deleted file mode 100644
index 5c6e0b045..000000000
--- a/jtools/gcj/patches/no-lib64.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-diff -Nur gcc-4.5.3.orig/gcc/config/i386/linux64.h gcc-4.5.3/gcc/config/i386/linux64.h
---- gcc-4.5.3.orig/gcc/config/i386/linux64.h 2010-03-24 21:44:48.000000000 +0100
-+++ gcc-4.5.3/gcc/config/i386/linux64.h 2011-08-24 06:35:30.000000000 +0200
-@@ -59,7 +59,7 @@
- done. */
-
- #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
--#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
-+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux-x86-64.so.2"
-
- #if TARGET_64BIT_DEFAULT
- #define SPEC_32 "m32"
-diff -Nur gcc-4.5.3.orig/gcc/config/i386/t-linux64 gcc-4.5.3/gcc/config/i386/t-linux64
---- gcc-4.5.3.orig/gcc/config/i386/t-linux64 2009-04-21 21:03:23.000000000 +0200
-+++ gcc-4.5.3/gcc/config/i386/t-linux64 2011-08-24 06:35:30.000000000 +0200
-@@ -25,7 +25,7 @@
-
- MULTILIB_OPTIONS = m64/m32
- MULTILIB_DIRNAMES = 64 32
--MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
-+MULTILIB_OSDIRNAMES = ../lib $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
-
- LIBGCC = stmp-multilib
- INSTALL_LIBGCC = install-multilib
-diff -Nur gcc-4.5.3.orig/gcc/config/mips/linux64.h gcc-4.5.3/gcc/config/mips/linux64.h
---- gcc-4.5.3.orig/gcc/config/mips/linux64.h 2009-02-20 16:20:38.000000000 +0100
-+++ gcc-4.5.3/gcc/config/mips/linux64.h 2011-08-24 06:35:30.000000000 +0200
-@@ -36,9 +36,9 @@
- %{profile:-lc_p} %{!profile:-lc}}"
-
- #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
--#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
--#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
--#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
-+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld.so.1"
-+#define GLIBC_DYNAMIC_LINKERN32 "/lib/ld.so.1"
-+#define UCLIBC_DYNAMIC_LINKERN32 "/lib/ld-uClibc.so.0"
- #define LINUX_DYNAMIC_LINKERN32 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32)
-
-diff -Nur gcc-4.5.3.orig/gcc/config/mips/t-linux64 gcc-4.5.3/gcc/config/mips/t-linux64
---- gcc-4.5.3.orig/gcc/config/mips/t-linux64 2009-04-21 21:03:23.000000000 +0200
-+++ gcc-4.5.3/gcc/config/mips/t-linux64 2011-08-24 06:35:30.000000000 +0200
-@@ -18,7 +18,7 @@
-
- MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
- MULTILIB_DIRNAMES = n32 32 64
--MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
-+MULTILIB_OSDIRNAMES = ../lib ../lib ../lib
-
- EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-
-diff -Nur gcc-4.5.3.orig/gcc/config/rs6000/linux64.h gcc-4.5.3/gcc/config/rs6000/linux64.h
---- gcc-4.5.3.orig/gcc/config/rs6000/linux64.h 2010-11-17 07:09:53.000000000 +0100
-+++ gcc-4.5.3/gcc/config/rs6000/linux64.h 2011-08-24 06:35:30.000000000 +0200
-@@ -341,7 +341,7 @@
- #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
-
- #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
--#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
-+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
- #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
- #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
- #if UCLIBC_DEFAULT
-diff -Nur gcc-4.5.3.orig/gcc/config/rs6000/t-linux64 gcc-4.5.3/gcc/config/rs6000/t-linux64
---- gcc-4.5.3.orig/gcc/config/rs6000/t-linux64 2009-04-21 21:03:23.000000000 +0200
-+++ gcc-4.5.3/gcc/config/rs6000/t-linux64 2011-08-24 06:35:30.000000000 +0200
-@@ -36,7 +36,7 @@
- MULTILIB_EXTRA_OPTS = fPIC mstrict-align
- MULTILIB_EXCEPTIONS = m64/msoft-float
- MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
--MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
-+MULTILIB_OSDIRNAMES = ../lib $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
- MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
-
- softfp_wrap_start := '\#ifndef __powerpc64__'
-diff -Nur gcc-4.5.3.orig/gcc/config/sparc/linux64.h gcc-4.5.3/gcc/config/sparc/linux64.h
---- gcc-4.5.3.orig/gcc/config/sparc/linux64.h 2010-09-22 23:15:37.000000000 +0200
-+++ gcc-4.5.3/gcc/config/sparc/linux64.h 2011-08-24 06:36:52.000000000 +0200
-@@ -110,7 +110,7 @@
- /* If ELF is the default format, we should not use /lib/elf. */
-
- #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
--#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
-+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux.so.2"
-
- #ifdef SPARC_BI_ARCH
-
-diff -Nur gcc-4.5.3.orig/gcc/config/sparc/t-linux64 gcc-4.5.3/gcc/config/sparc/t-linux64
---- gcc-4.5.3.orig/gcc/config/sparc/t-linux64 2010-10-04 18:54:26.000000000 +0200
-+++ gcc-4.5.3/gcc/config/sparc/t-linux64 2011-08-24 06:37:15.000000000 +0200
-@@ -26,7 +26,7 @@
-
- MULTILIB_OPTIONS = m64/m32
- MULTILIB_DIRNAMES = 64 32
--MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
-+MULTILIB_OSDIRNAMES = ../lib $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
-
- LIBGCC = stmp-multilib
- INSTALL_LIBGCC = install-multilib
diff --git a/jtools/openjdk7/Makefile b/jtools/openjdk7/Makefile
new file mode 100644
index 000000000..927a7c2d8
--- /dev/null
+++ b/jtools/openjdk7/Makefile
@@ -0,0 +1,57 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= icedtea
+PKG_VERSION:= 2.3.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 95ab4fd5c9832149f1e50ef24a1264ff
+PKG_DESCR:= OpenJDK 7 Java VM
+PKG_SECTION:= lang
+PKG_URL:= http://openjdk.org/
+PKG_SITES:= http://icedtea.classpath.org/download/source/
+
+include ../rules.mk
+
+OPENJDK_NATIVE_ENV+= JAVACFLAGS="-cp ${STAGING_JAVA_HOST_DIR}/usr/share/java/libgcj-$(GCJ_VER).jar"
+OPENJDK_NATIVE_ENV+= DYLD_LIBRARY_PATH=$(STAGING_JAVA_HOST_DIR)/usr/lib:$(STAGING_JAVA_HOST_DIR)/usr/lib64
+OPENJDK_NATIVE_ENV+= LD_LIBRARY_PATH=$(STAGING_JAVA_HOST_DIR)/usr/lib:$(STAGING_JAVA_HOST_DIR)/usr/lib64
+OPENJDK_NATIVE_ENV+= ADK_ECJ=$(STAGING_JAVA_HOST_DIR)/usr/bin/ecj PATH=$$PATH:$(STAGING_JAVA_HOST_DIR)/usr/bin
+OPENJDK_NATIVE_ENV+= BOOTCLASSPATH="$(STAGING_JAVA_HOST_DIR)/usr/share/jamvm/classes.zip:$(STAGING_JAVA_HOST_DIR)/usr/share/classpath/glibj.zip"
+
+install: ${STAGING_JAVA_HOST_DIR}/bootstrap-jdk/bin/java
+
+CONFIGURE_ARGS+=\
+ --enable-bootstrap \
+ --enable-zero \
+ --with-jdk-home=$(STAGING_JAVA_HOST_DIR)/usr/lib/jvm \
+ --with-java=$(STAGING_JAVA_HOST_DIR)/usr/bin/java \
+ --with-javac=$(STAGING_JAVA_HOST_DIR)/usr/bin/ecj \
+ --with-ecj-jar=${STAGING_JAVA_HOST_DIR}/usr/share/java/ecj.jar \
+ --without-hotspot-build \
+ --disable-system-jpeg \
+ --disable-system-lcms \
+ --disable-system-zlib \
+ --disable-system-png \
+ --disable-system-gif \
+ --disable-system-gtk \
+ --disable-system-gio \
+ --disable-system-fontconfig \
+ --disable-compile-against-syscalls \
+ --without-rhino \
+ --disable-docs
+
+$(WRKDIST)/.configured: ${WRKDIST}/.prepared
+ (cd ${WRKBUILD}; export ${OPENJDK_NATIVE_ENV}; ./configure ${CONFIGURE_ARGS})
+ touch $@
+
+$(WRKBUILD)/.compiled: ${WRKDIST}/.configured
+ export ${OPENJDK_NATIVE_ENV}; $(MAKE) -C $(WRKBUILD) icedtea-boot
+ touch $@
+
+${STAGING_JAVA_HOST_DIR}/bootstrap-jdk/bin/java: $(WRKBUILD)/.compiled
+ $(CP) $(WRKSRC)/openjdk.build-boot/j2sdk-image $(STAGING_JAVA_HOST_DIR)/bootstrap-jdk
+ touch $@
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/jtools/openjdk7/patches/openadk.patch b/jtools/openjdk7/patches/openadk.patch
new file mode 100644
index 000000000..11eb2aea6
--- /dev/null
+++ b/jtools/openjdk7/patches/openadk.patch
@@ -0,0 +1,39 @@
+diff -Nur icedtea-2.3.4.orig/Makefile.in icedtea-2.3.4/Makefile.in
+--- icedtea-2.3.4.orig/Makefile.in 2013-01-15 10:44:02.000000000 +0100
++++ icedtea-2.3.4/Makefile.in 2013-02-11 17:32:45.000000000 +0100
+@@ -640,7 +640,7 @@
+ $(am__append_14) $(am__append_15) $(DISTRIBUTION_PATCHES)
+
+ # Bootstrapping patches
+-ICEDTEA_BOOT_PATCHES = patches/boot/javafiles.patch \
++ICEDTEA_BOOT_PATCHES = patches/topdir-openwrt.patch patches/boot/javafiles.patch \
+ patches/boot/ant-javac.patch patches/boot/corba-idlj.patch \
+ patches/boot/corba-no-gen.patch patches/boot/corba-orb.patch \
+ patches/boot/demos.patch patches/boot/ecj-fphexconstants.patch \
+@@ -2033,7 +2033,7 @@
+ # Optional native ecj
+ stamps/native-ecj.stamp:
+ mkdir -p stamps
+-@BUILD_NATIVE_ECJ_TRUE@ ${GCJ} $(IT_CFLAGS) -Wl,-Bsymbolic -findirect-dispatch -o native-ecj \
++@BUILD_NATIVE_ECJ_TRUE@ ${GCJ} -lgcj $(IT_CFLAGS) -Wl,-Bsymbolic -findirect-dispatch -o native-ecj \
+ @BUILD_NATIVE_ECJ_TRUE@ --main=org.eclipse.jdt.internal.compiler.batch.Main ${ECJ_JAR}
+ touch $@
+
+diff -Nur icedtea-2.3.4.orig/patches/topdir-openwrt.patch icedtea-2.3.4/patches/topdir-openwrt.patch
+--- icedtea-2.3.4.orig/patches/topdir-openwrt.patch 1970-01-01 01:00:00.000000000 +0100
++++ icedtea-2.3.4/patches/topdir-openwrt.patch 2013-02-12 09:37:29.000000000 +0100
+@@ -0,0 +1,14 @@
++diff -Nur openjdk-boot.orig/Makefile icedtea7-forest-2-3-8bd8e70d4a03.2/Makefile
++--- openjdk-boot.orig/Makefile 2013-01-14 23:24:55.000000000 +0100
+++++ openjdk-boot/Makefile 2013-02-11 17:28:22.000000000 +0100
++@@ -53,9 +53,7 @@
++ REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
++ REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
++
++-ifndef TOPDIR
++- TOPDIR:=.
++-endif
+++TOPDIR:=.
++
++ ifndef JDK_TOPDIR
++ JDK_TOPDIR=$(TOPDIR)/jdk
diff --git a/jtools/rules.mk b/jtools/rules.mk
index 6b7ea0336..689d211a0 100644
--- a/jtools/rules.mk
+++ b/jtools/rules.mk
@@ -3,6 +3,6 @@
WRKDIR_BASE= ${JTOOLS_BUILD_DIR}
WRKDIR= ${WRKDIR_BASE}
-GCJ_VER:= 4.5.3
+GCJ_VER:= 4.7.3
include ${TOPDIR}/mk/buildhlp.mk
diff --git a/package/openjdk7/Makefile b/package/openjdk7/Makefile
new file mode 100644
index 000000000..648072418
--- /dev/null
+++ b/package/openjdk7/Makefile
@@ -0,0 +1,99 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= icedtea
+PKG_VERSION:= 2.3.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 644095a19eece799735119482de3aa9f
+PKG_DESCR:= OpenJDK 7 Java VM
+PKG_SECTION:= lang
+PKG_BUILDDEP:= alsa-lib xproto jpeg zlib giflib libpng freetype cups
+PKG_BUILDDEP+= libX11 libXt libXp libXinerama libXrender libXtst libiconv
+PKG_DEPENDS:= zlib libstdcxx libffi libpthread libxtst libxi
+PKG_URL:= http://openjdk.org/
+PKG_SITES:= http://icedtea.classpath.org/download/source/
+
+PKG_HOST_DEPENDS:= !darwin !cygwin !openbsd !netbsd !freebsd
+PKG_ARCH_DEPENDS:= arm mips x86 x86_64
+PKG_SYSTEM_DEPENDS:= !linksys-ag241 !fon-fon2100 !broadcom-bcm47xx
+
+PKG_SUBPKGS:= OPENJDK7
+PKG_CHOICES_OPENJDK7:= ZERO SHARK CACAO
+PKGCD_ZERO:= zero-assembly backend
+PKGCD_SHARK:= Shark JIT backend (needs eglibc/glibc)
+PKGCB_SHARK:= llvm
+PKGCD_CACAO:= Cacao JIT backend
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,OPENJDK7,openjdk7,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+# for UINTPTR_MAX in stdint.h
+TARGET_CFLAGS+= -D__STDC_LIMIT_MACROS
+# segfaults with march=pentium-m/atom
+TARGET_CFLAGS:= $(subst march=pentium-m,march=i686,$(TARGET_CFLAGS))
+TARGET_CFLAGS:= $(subst march=atom,march=i686,$(TARGET_CFLAGS))
+TARGET_CFLAGS:= $(filter-out -fhonour-copts,$(TARGET_CFLAGS))
+BOOTSTRAPJDK:= ${STAGING_JAVA_HOST_DIR}/bootstrap-jdk
+
+ifeq ($(ARCH),x86)
+JDKARCH:= i386
+else
+JDKARCH:= $(ARCH)
+endif
+
+ifeq ($(ADK_PACKAGE_OPENJDK7_ZERO),y)
+CONFIGURE_BACKEND:= --enable-zero
+endif
+ifeq ($(ADK_PACKAGE_OPENJDK7_SHARK),y)
+CONFIGURE_BACKEND:= --enable-shark \
+ --with-llvm-config=$(STAGING_TARGET_DIR)/usr/bin/llvm-config
+endif
+ifeq ($(ADK_PACKAGE_OPENJDK7_CACAO),y)
+CONFIGURE_BACKEND:= --enable-cacao
+endif
+
+CONFIGURE_COMMON:= --disable-docs \
+ --with-jdk-home=$(BOOTSTRAPJDK) \
+ --with-java=$(BOOTSTRAPJDK)/bin/java \
+ --with-javac=$(BOOTSTRAPJDK)/bin/javac \
+ --with-javah=$(BOOTSTRAPJDK)/bin/javah \
+ --with-jar=$(BOOTSTRAPJDK)/bin/jar \
+ --with-rmic=$(BOOTSTRAPJDK)/bin/rmic \
+ --with-native2ascii=$(BOOTSTRAPJDK)/bin/native2ascii \
+ --with-gcj=$(STAGING_JAVA_HOST_DIR)/usr/bin/gcj \
+ --without-hotspot-build \
+ --disable-system-jpeg \
+ --disable-system-lcms \
+ --disable-system-zlib \
+ --disable-system-png \
+ --disable-system-gif \
+ --disable-system-gtk \
+ --disable-system-gio \
+ --disable-system-fontconfig \
+ --disable-compile-against-syscalls \
+ --without-rhino
+
+CONFIGURE_ARGS+= $(CONFIGURE_BACKEND)
+CONFIGURE_ARGS+= $(CONFIGURE_COMMON)
+CONFIGURE_ARGS+= --disable-bootstrap
+
+CONFIGURE_ENV+= PATH=$(STAGING_JAVA_HOST_DIR)/usr/bin:$${PATH}:${STAGING_TARGET_DIR}/usr/bin
+MAKE_ENV+= ALT_COMPILER_PATH=$(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME) \
+ ALT_OPENWIN_HOME=$(STAGING_DIR)/usr/ \
+ ALT_CUPS_HEADERS_PATH=$(STAGING_DIR)/usr/include/ \
+ ALT_FREETYPE_HEADERS_PATH=$(STAGING_DIR)/usr/include/ \
+ OTHER_CFLAGS='$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)' \
+ OTHER_CXXFLAGS='$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)' \
+ GCC_HONOUR_COPTS=s CROSS_COMPILE_ARCH=$(JDKARCH)
+
+ALL_TARGET:= icedtea
+
+openjdk7-install:
+ $(INSTALL_DIR) $(IDIR_OPENJDK7)/usr
+ $(CP) $(WRKBUILD)/openjdk.build/j2re-image/* $(IDIR_OPENJDK7)/usr
+ rm -rf $(IDIR_OPENJDK7)/usr/man
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openjdk7/patches/openadk.patch b/package/openjdk7/patches/openadk.patch
new file mode 100644
index 000000000..e9f27cdd7
--- /dev/null
+++ b/package/openjdk7/patches/openadk.patch
@@ -0,0 +1,368 @@
+diff -Nur icedtea-2.3.6.orig/Makefile.in icedtea-2.3.6/Makefile.in
+--- icedtea-2.3.6.orig/Makefile.in 2013-02-12 14:23:58.000000000 +0100
++++ icedtea-2.3.6/Makefile.in 2013-05-02 10:37:29.000000000 +0200
+@@ -77,7 +77,6 @@
+ @WITH_ALT_HSBUILD_TRUE@ patches/hotspot/$(HSBUILD)/7089790-bsd_port.patch \
+ @WITH_ALT_HSBUILD_TRUE@ patches/hotspot/$(HSBUILD)/7098194-macosx_port.patch \
+ @WITH_ALT_HSBUILD_TRUE@ patches/hotspot/$(HSBUILD)/7116189-setnativethreadname.patch \
+-@WITH_ALT_HSBUILD_TRUE@ patches/hotspot/$(HSBUILD)/6924259-string_offset.patch \
+ @WITH_ALT_HSBUILD_TRUE@ patches/hotspot/$(HSBUILD)/revert_arm_debug.patch
+
+ @WITH_RHINO_TRUE@am__append_6 = \
+@@ -640,7 +639,7 @@
+ $(am__append_14) $(am__append_15) $(DISTRIBUTION_PATCHES)
+
+ # Bootstrapping patches
+-ICEDTEA_BOOT_PATCHES = patches/boot/javafiles.patch \
++ICEDTEA_BOOT_PATCHES = patches/openadk.patch patches/boot/javafiles.patch \
+ patches/boot/ant-javac.patch patches/boot/corba-idlj.patch \
+ patches/boot/corba-no-gen.patch patches/boot/corba-orb.patch \
+ patches/boot/demos.patch patches/boot/ecj-fphexconstants.patch \
+@@ -2033,7 +2032,7 @@
+ # Optional native ecj
+ stamps/native-ecj.stamp:
+ mkdir -p stamps
+-@BUILD_NATIVE_ECJ_TRUE@ ${GCJ} $(IT_CFLAGS) -Wl,-Bsymbolic -findirect-dispatch -o native-ecj \
++@BUILD_NATIVE_ECJ_TRUE@ ${GCJ} -lgcj -Wl,-Bsymbolic -findirect-dispatch -o native-ecj \
+ @BUILD_NATIVE_ECJ_TRUE@ --main=org.eclipse.jdt.internal.compiler.batch.Main ${ECJ_JAR}
+ touch $@
+
+diff -Nur icedtea-2.3.6.orig/patches/openadk.patch icedtea-2.3.6/patches/openadk.patch
+--- icedtea-2.3.6.orig/patches/openadk.patch 1970-01-01 01:00:00.000000000 +0100
++++ icedtea-2.3.6/patches/openadk.patch 2013-05-03 17:22:54.000000000 +0200
+@@ -0,0 +1,335 @@
++diff -Nur openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
++--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp 2013-01-14 23:25:00.000000000 +0100
+++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2013-02-18 10:18:27.000000000 +0100
++@@ -115,7 +115,6 @@
++ # include <string.h>
++ # include <syscall.h>
++ # include <sys/sysinfo.h>
++-# include <gnu/libc-version.h>
++ # include <sys/ipc.h>
++ # include <sys/shm.h>
++ # include <link.h>
++@@ -644,9 +643,7 @@
++ os::Linux::set_glibc_version(str);
++ } else {
++ // _CS_GNU_LIBC_VERSION is not supported, try gnu_get_libc_version()
++- static char _gnu_libc_version[32];
++- jio_snprintf(_gnu_libc_version, sizeof(_gnu_libc_version),
++- "glibc %s %s", gnu_get_libc_version(), gnu_get_libc_release());
+++ static char _gnu_libc_version[32] = "2.9";
++ os::Linux::set_glibc_version(_gnu_libc_version);
++ }
++
++@@ -2640,10 +2637,7 @@
++ // If we are running with earlier version, which did not have symbol versions,
++ // we should use the base version.
++ void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
++- void *f = dlvsym(handle, name, "libnuma_1.1");
++- if (f == NULL) {
++- f = dlsym(handle, name);
++- }
+++ void *f = dlsym(handle, name);
++ return f;
++ }
++
++@@ -4908,7 +4902,21 @@
++ // Linux doesn't yet have a (official) notion of processor sets,
++ // so just return the system wide load average.
++ int os::loadavg(double loadavg[], int nelem) {
++- return ::getloadavg(loadavg, nelem);
+++ FILE *LOADAVG;
+++ double avg[3] = { 0.0, 0.0, 0.0 };
+++ int i, res = -1;;
+++
+++ if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
+++ fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
+++ res = 0;
+++ fclose(LOADAVG);
+++ }
+++
+++ for (i = 0; (i < nelem) && (i < 3); i++) {
+++ loadavg[i] = avg[i];
+++ }
+++
+++ return res;
++ }
++
++ void os::pause() {
++diff -Nur openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
++--- openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2013-01-14 23:25:00.000000000 +0100
+++++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2013-02-18 10:18:28.000000000 +0100
++@@ -253,7 +253,7 @@
++ #elif defined(__APPLE__)
++ inline int g_isnan(double f) { return isnan(f); }
++ #elif defined(LINUX) || defined(_ALLBSD_SOURCE)
++-inline int g_isnan(float f) { return isnanf(f); }
+++inline int g_isnan(float f) { return __isnanf(f); }
++ inline int g_isnan(double f) { return isnan(f); }
++ #else
++ #error "missing platform-specific definition here"
++diff -Nur openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
++--- openjdk.orig/jdk/make/com/sun/java/pack/Makefile 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/make/com/sun/java/pack/Makefile 2013-02-18 10:18:28.000000000 +0100
++@@ -80,7 +80,7 @@
++ LDDFLAGS += $(ZIPOBJS)
++ endif
++ else
++- OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
+++ CXXFLAGS_COMMON += -DNO_ZLIB -DUNPACK_JNI
++ OTHER_LDLIBS += $(JVMLIB)
++ endif
++
++diff -Nur openjdk.orig/jdk/make/common/Defs.gmk openjdk/jdk/make/common/Defs.gmk
++--- openjdk.orig/jdk/make/common/Defs.gmk 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/make/common/Defs.gmk 2013-02-18 10:22:13.000000000 +0100
++@@ -204,7 +204,7 @@
++ ifeq ($(PLATFORM), macosx)
++ FREETYPE_HEADERS_PATH = /usr/X11R6/include
++ else
++- FREETYPE_HEADERS_PATH = /usr/include
+++ FREETYPE_HEADERS_PATH = /usr/include/disabled
++ endif
++ endif
++ endif
++diff -Nur openjdk.orig/jdk/make/common/shared/Platform.gmk openjdk/jdk/make/common/shared/Platform.gmk
++--- openjdk.orig/jdk/make/common/shared/Platform.gmk 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/make/common/shared/Platform.gmk 2013-02-18 10:18:28.000000000 +0100
++@@ -160,9 +160,6 @@
++ else
++ mach := $(shell uname -m)
++ endif
++- ifneq (,$(wildcard /usr/bin/dpkg-architecture))
++- mach := $(shell (dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null || echo $(mach)) | sed 's/powerpc$$/ppc/;s/hppa/parisc/')
++- endif
++ archExpr = case "$(mach)" in \
++ i[3-9]86) \
++ echo i586 \
++diff -Nur openjdk.orig/jdk/make/java/instrument/Makefile openjdk/jdk/make/java/instrument/Makefile
++--- openjdk.orig/jdk/make/java/instrument/Makefile 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/make/java/instrument/Makefile 2013-02-18 10:18:28.000000000 +0100
++@@ -140,6 +140,8 @@
++ # We don't want to link against -ljava
++ JAVALIB=
++
+++OTHER_LDLIBS += -liconv
+++
++ #
++ # Add to ambient vpath so we pick up the library files
++ #
++diff -Nur openjdk.orig/jdk/make/java/nio/Makefile openjdk/jdk/make/java/nio/Makefile
++--- openjdk.orig/jdk/make/java/nio/Makefile 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/make/java/nio/Makefile 2013-02-18 10:18:28.000000000 +0100
++@@ -923,7 +923,7 @@
++
++ $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
++ $(prep-target)
++- ($(CD) $(TEMPDIR); $(NIO_CC) $(CPPFLAGS) $(LDDFLAGS) \
+++ ($(CD) $(TEMPDIR); $(NIO_CC) -static $(CPPFLAGS) $(LDDFLAGS) \
++ -o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
++
++ ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
++@@ -934,8 +934,12 @@
++ $(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
++ $(prep-target)
++ NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@
+++ifdef CROSS_COMPILE_ARCH
+++ $(QEMU) $(GENSOR_EXE) >> $@
+++else
++ $(GENSOR_EXE) >> $@
++ endif
+++endif
++ #
++ # Generated sun.nio.cs SingleByte classes
++ #
++@@ -959,7 +963,7 @@
++
++ $(GENUC_EXE) : $(GENUC_SRC)
++ $(prep-target)
++- $(NIO_CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
+++ $(NIO_CC) -static $(CPPFLAGS) -o $@ $(GENUC_SRC)
++
++ ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
++ $(SFS_GEN)/UnixConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/UnixConstants-$(PLATFORM)-$(ARCH).java
++@@ -969,8 +973,12 @@
++ $(SFS_GEN)/UnixConstants.java: $(GENUC_EXE)
++ $(prep-target)
++ NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENUC_COPYRIGHT_YEARS)" > $@
+++ifdef CROSS_COMPILE_ARCH
+++ $(QEMU) $(GENUC_EXE) >> $@
+++else
++ $(GENUC_EXE) >> $@
++ endif
+++endif
++
++ GENSC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genSolarisConstants.c
++
++@@ -981,7 +989,7 @@
++
++ $(GENSC_EXE) : $(GENSC_SRC)
++ $(prep-target)
++- $(NIO_CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
+++ $(NIO_CC) -static $(CPPFLAGS) -o $@ $(GENSC_SRC)
++
++ ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
++ $(SFS_GEN)/SolarisConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/SolarisConstants-$(PLATFORM)-$(ARCH).java
++@@ -991,7 +999,11 @@
++ $(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE)
++ $(prep-target)
++ NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENSC_COPYRIGHT_YEARS)" > $@
+++ifdef CROSS_COMPILE_ARCH
+++ $(QEMU) $(GENSC_EXE) >> $@
+++else
++ $(GENSC_EXE) >> $@
++ endif
+++endif
++
++ .PHONY: sources
++diff -Nur openjdk.orig/jdk/make/java/npt/Makefile openjdk/jdk/make/java/npt/Makefile
++--- openjdk.orig/jdk/make/java/npt/Makefile 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/make/java/npt/Makefile 2013-02-18 10:18:28.000000000 +0100
++@@ -64,6 +64,8 @@
++ # We don't want to link against -ljava
++ JAVALIB=
++
+++OTHER_LDLIBS += -liconv
+++
++ # Add -export options to explicitly spell exported symbols
++ ifeq ($(PLATFORM), windows)
++ OTHER_LCF += -export:nptInitialize -export:nptTerminate
++diff -Nur openjdk.orig/jdk/make/sun/awt/mawt.gmk openjdk/jdk/make/sun/awt/mawt.gmk
++--- openjdk.orig/jdk/make/sun/awt/mawt.gmk 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/make/sun/awt/mawt.gmk 2013-02-18 10:42:16.000000000 +0100
++@@ -151,22 +151,6 @@
++ #endif
++
++ LIBXTST = -lXtst
++-ifeq ($(PLATFORM), linux)
++- ifeq ($(ARCH_DATA_MODEL), 64)
++- # XXX what about the rest of them?
++- LIBXT = -lXt
++- else
++- # Allows for builds on Debian GNU Linux, X11 is in a different place
++- LIBXT = $(firstword $(wildcard $(OPENWIN_LIB)/libXt.a) \
++- $(wildcard /usr/lib/libXt.a))
++- LIBSM = $(firstword $(wildcard $(OPENWIN_LIB)/libSM.a) \
++- $(wildcard /usr/lib/libSM.a))
++- LIBICE = $(firstword $(wildcard $(OPENWIN_LIB)/libICE.a) \
++- $(wildcard /usr/lib/libICE.a))
++- LIBXTST = $(firstword $(wildcard $(OPENWIN_LIB)/libXtst.a) \
++- $(wildcard /usr/lib/libXtst.a))
++- endif
++-endif
++
++ # Use -lXmu for EditRes support
++ LIBXMU_DBG = -lXmu
++@@ -181,7 +165,7 @@
++ OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
++ # XXX what is this define below? Isn't it motif-related?
++ OTHER_CFLAGS += -DXMSTRINGDEFINES=1
++-OTHER_LDLIBS = $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi
+++OTHER_LDLIBS = $(LIBXMU) $(LIBXTST) -lXext -lXt -lSM -lICE -lX11 -lXi
++ endif
++
++ endif
++@@ -230,11 +214,6 @@
++ CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps/fontconfig2
++ endif
++
++-ifndef HEADLESS
++-CPPFLAGS += -I$(OPENWIN_HOME)/include
++-LDFLAGS += -L$(OPENWIN_LIB)
++-
++-endif # !HEADLESS
++
++ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
++ -I$(SHARE_SRC)/native/$(PKGDIR)/../font \
++@@ -269,11 +248,6 @@
++ endif # !HEADLESS
++ endif # PLATFORM
++
++-ifeq ($(PLATFORM), linux)
++- # Checking for the X11/extensions headers at the additional location
++- CPPFLAGS += -I$(firstword $(wildcard $(OPENWIN_HOME)/include/X11/extensions) \
++- $(wildcard /usr/include/X11/extensions))
++-endif
++
++ ifeq ($(PLATFORM), macosx))
++ CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
++diff -Nur openjdk.orig/jdk/make/sun/splashscreen/Makefile openjdk/jdk/make/sun/splashscreen/Makefile
++--- openjdk.orig/jdk/make/sun/splashscreen/Makefile 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/make/sun/splashscreen/Makefile 2013-02-18 10:18:28.000000000 +0100
++@@ -55,6 +55,8 @@
++
++ JAVALIB=
++
+++OTHER_LDLIBS += -liconv
+++
++ #
++ # C Flags
++ #
++diff -Nur openjdk.orig/jdk/src/solaris/native/sun/awt/awt_InputMethod.c openjdk/jdk/src/solaris/native/sun/awt/awt_InputMethod.c
++--- openjdk.orig/jdk/src/solaris/native/sun/awt/awt_InputMethod.c 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/src/solaris/native/sun/awt/awt_InputMethod.c 2013-02-18 10:18:28.000000000 +0100
++@@ -246,7 +246,8 @@
++ if (wcs == NULL)
++ return NULL;
++
++- n = len*MB_CUR_MAX + 1;
+++ //evil hack for uclibc
+++ n = len*1 + 1;
++
++ mbs = (char *) malloc(n * sizeof(char));
++ if (mbs == NULL) {
++diff -Nur openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c
++--- openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c 2013-01-14 23:25:02.000000000 +0100
+++++ openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c 2013-02-18 10:18:28.000000000 +0100
++@@ -27,9 +27,6 @@
++ #include <X11/Xutil.h>
++ #include <X11/Xos.h>
++ #include <X11/Xatom.h>
++-#ifdef __linux__
++-#include <execinfo.h>
++-#endif
++
++ #include <jvm.h>
++ #include <jni.h>
++@@ -785,25 +782,6 @@
++ return ret;
++ }
++
++-#ifdef __linux__
++-void print_stack(void)
++-{
++- void *array[10];
++- size_t size;
++- char **strings;
++- size_t i;
++-
++- size = backtrace (array, 10);
++- strings = backtrace_symbols (array, size);
++-
++- fprintf (stderr, "Obtained %zd stack frames.\n", size);
++-
++- for (i = 0; i < size; i++)
++- fprintf (stderr, "%s\n", strings[i]);
++-
++- free (strings);
++-}
++-#endif
++
++ Window get_xawt_root_shell(JNIEnv *env) {
++ static jclass classXRootWindow = NULL;
++diff -Nur openjdk.orig/Makefile openjdk/Makefile
++--- openjdk.orig/Makefile 2013-01-14 23:24:55.000000000 +0100
+++++ openjdk/Makefile 2013-02-18 10:18:28.000000000 +0100
++@@ -53,9 +53,7 @@
++ REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
++ REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
++
++-ifndef TOPDIR
++- TOPDIR:=.
++-endif
+++TOPDIR:=.
++
++ ifndef JDK_TOPDIR
++ JDK_TOPDIR=$(TOPDIR)/jdk
diff --git a/toolchain/eglibc/Makefile b/toolchain/eglibc/Makefile
index fa8153804..0961e7bca 100644
--- a/toolchain/eglibc/Makefile
+++ b/toolchain/eglibc/Makefile
@@ -7,6 +7,8 @@ include Makefile.inc
include Makefile.multilib
include ${TOPDIR}/mk/buildhlp.mk
+# eglibc does not compile with Os
+TARGET_CFLAGS_LIBC:= $(subst Os,O2,$(TARGET_CFLAGS))
ifneq ($(ADK_DEBUG),)
TARGET_CFLAGS_LIBC+= -O2
endif