diff options
Diffstat (limited to 'recipes-core/icedtea/icedtea6-native.inc')
-rw-r--r-- | recipes-core/icedtea/icedtea6-native.inc | 215 |
1 files changed, 215 insertions, 0 deletions
diff --git a/recipes-core/icedtea/icedtea6-native.inc b/recipes-core/icedtea/icedtea6-native.inc new file mode 100644 index 0000000..afd7239 --- /dev/null +++ b/recipes-core/icedtea/icedtea6-native.inc | |||
@@ -0,0 +1,215 @@ | |||
1 | DESCRIPTION = "Harness to build the source code from OpenJDK using Free Software build tools" | ||
2 | HOMEPAGE = "http://icedtea.classpath.org" | ||
3 | LICENSE = "GPL with Classpath Exception" | ||
4 | INC_PR = "r4" | ||
5 | |||
6 | DEPENDS = "virtual/javac-native virtual/java-native classpath-native \ | ||
7 | xalan-j-native xerces-j-native rhino-native \ | ||
8 | ant-native \ | ||
9 | libx11-native xproto-native libxt-native libxext-native \ | ||
10 | freetype-native zlib-native giflib-native jpeg-native \ | ||
11 | zip-native \ | ||
12 | " | ||
13 | |||
14 | inherit native java autotools | ||
15 | |||
16 | JAVA_HOME[unexport] = "1" | ||
17 | |||
18 | # No parallel build yet. | ||
19 | PARALLEL_MAKE = "" | ||
20 | |||
21 | # openjdk-ecj looks in /usr/include and /usr/lib for freetype by default. | ||
22 | export ALT_FREETYPE_HEADERS_PATH = "${STAGING_INCDIR}/freetype2" | ||
23 | export ALT_FREETYPE_LIB_PATH = "${STAGING_LIBDIR}" | ||
24 | |||
25 | # Configure options compatible with Cacao >= 0.99 only! | ||
26 | EXTRA_OECONF = "\ | ||
27 | --with-parallel-jobs=1 \ | ||
28 | --disable-docs \ | ||
29 | --disable-pulse-java \ | ||
30 | --disable-plugin \ | ||
31 | --disable-npplugin \ | ||
32 | --disable-xrender \ | ||
33 | \ | ||
34 | --with-ecj=${STAGING_BINDIR_NATIVE}/ecj-bootstrap \ | ||
35 | \ | ||
36 | --with-ecj-jar=${STAGING_DATADIR_JAVA_NATIVE}/ecj-bootstrap.jar \ | ||
37 | --with-java=${STAGING_BINDIR_NATIVE}/java \ | ||
38 | --with-javac=${STAGING_BINDIR_NATIVE}/ecj-bootstrap \ | ||
39 | --with-javah=${STAGING_BINDIR_NATIVE}/gjavah \ | ||
40 | --with-jar=${STAGING_BINDIR_NATIVE}/fastjar \ | ||
41 | --with-rmic=${STAGING_BINDIR_NATIVE}/grmic \ | ||
42 | --with-xalan2-jar=${STAGING_DATADIR_NATIVE}/java/xalan2.jar \ | ||
43 | --with-xalan2-serializer-jar=${STAGING_DATADIR_NATIVE}/java/serializer.jar \ | ||
44 | --with-xerces2-jar=${STAGING_DATADIR_NATIVE}/java/xercesImpl.jar \ | ||
45 | --with-rhino=${STAGING_DATADIR_NATIVE}/java/rhino.jar \ | ||
46 | --with-openjdk-src-dir=${WORKDIR}/openjdk-src-dir \ | ||
47 | --with-gcj-home=${WORKDIR}/fake-jdk \ | ||
48 | \ | ||
49 | --enable-openjdk-cross-compilation \ | ||
50 | " | ||
51 | |||
52 | JDK_DIR = "icedtea6-native" | ||
53 | |||
54 | JDK_INSTALL_DIR = "${D}/${libdir_jvm}/${JDK_DIR}" | ||
55 | |||
56 | do_configure_prepend() { | ||
57 | |||
58 | case "${TARGET_ARCH}" in | ||
59 | x86_64) | ||
60 | libarch=amd64 | ||
61 | ;; | ||
62 | i386|i486|i586|i686) | ||
63 | libarch=x86 | ||
64 | ;; | ||
65 | *) | ||
66 | arch=${TARGET_ARCH} | ||
67 | libarch=${TARGET_ARCH} | ||
68 | ;; | ||
69 | esac | ||
70 | |||
71 | chmod -R ug+w ${WORKDIR}/openjdk-src-dir | ||
72 | (cd ${WORKDIR}/openjdk-src-dir && sh ${S}/fsg.sh) | ||
73 | |||
74 | # Automatically copy everything that starts with "icedtea" and ends with | ||
75 | # ".patch" into the patches directory. | ||
76 | find ${WORKDIR} -maxdepth 1 -name "icedtea*.patch" -exec cp {} ${S}/patches \; | ||
77 | |||
78 | # Prepare JDK-like directory with Classpath' files which we can treat as a | ||
79 | # SYSTEM_GCJ_DIR afterwards. | ||
80 | mkdir -p ${WORKDIR}/fake-jdk/jre/lib/ | ||
81 | ln -sf ${STAGING_DATADIR_NATIVE}/classpath/glibj.zip ${WORKDIR}/fake-jdk/jre/lib/rt.jar | ||
82 | |||
83 | mkdir -p ${WORKDIR}/fake-jdk/include | ||
84 | for i in ${STAGING_INCDIR_NATIVE}/classpath/* ;do | ||
85 | test -r $i | continue; | ||
86 | bn=`basename $i` | ||
87 | ln -sf $i ${WORKDIR}/fake-jdk/include/$bn; | ||
88 | done | ||
89 | } | ||
90 | |||
91 | do_configure_append() { | ||
92 | oe_runmake patch-ecj | ||
93 | |||
94 | for F in openjdk-ecj/jdk/make/common/shared/Compiler-gcc.gmk openjdk-ecj/corba/make/common/shared/Compiler-gcc.gmk ; | ||
95 | do | ||
96 | sed -i \ | ||
97 | -e"s|\$(COMPILER_PATH)gcc\$(GCC_SUFFIX)|${CC}|" \ | ||
98 | -e"s|\$(COMPILER_PATH)gcc\$(GCC_SUFFIX) -E|${CPP}|" \ | ||
99 | -e"s|\$(COMPILER_PATH)g++\$(GCC_SUFFIX)|${CXX}|" \ | ||
100 | $F | ||
101 | done | ||
102 | |||
103 | for F in openjdk-ecj/hotspot/make/linux/makefiles/gcc.make openjdk-ecj/hotspot/agent/src/os/linux/Makefile ; | ||
104 | do | ||
105 | sed -i \ | ||
106 | -e"s|gcc\$(GCC_SUFFIX)|${CC}|" \ | ||
107 | -e"s|g++\$(GCC_SUFFIX)|${CXX}|" \ | ||
108 | $F | ||
109 | done | ||
110 | } | ||
111 | |||
112 | EXTRA_OEMAKE = ' \ | ||
113 | ZIPEXE="${STAGING_BINDIR_NATIVE}/zip" \ | ||
114 | ' | ||
115 | |||
116 | do_compile() { | ||
117 | # OpenJDK uses slightly different names for certain arches. We need to know | ||
118 | # this to create some files which are expected by the build. | ||
119 | case "${TARGET_ARCH}" in | ||
120 | x86_64) | ||
121 | arch=amd64 | ||
122 | libarch=amd64 | ||
123 | ;; | ||
124 | i386|i486|i586|i686) | ||
125 | arch=x86 | ||
126 | libarch=x86 | ||
127 | ;; | ||
128 | *) | ||
129 | arch=${TARGET_ARCH} | ||
130 | libarch=${TARGET_ARCH} | ||
131 | ;; | ||
132 | esac | ||
133 | |||
134 | install -d openjdk-ecj/control/build/linux-$arch/hotspot/import/jre/lib | ||
135 | if [ $libarch != $arch ]; then | ||
136 | # Something is strange with the directoy naming. OpenJDK uses both variants. | ||
137 | ln -sf $libarch openjdk-ecj/control/build/linux-$arch/hotspot/import/jre/lib/$arch | ||
138 | fi | ||
139 | |||
140 | |||
141 | # First build hotspot to get a libjvm.so | ||
142 | echo "1/2 Building Hotspot" | ||
143 | oe_runmake hotspot | ||
144 | |||
145 | # Remove the strange recursive symlink that is created here (If it is not there, then just skip this). | ||
146 | rm -f bootstrap/ecj/jre/lib/$libarch || true | ||
147 | |||
148 | # Copy libjvm.so for target into bootstrap/jdk1.6.0/jre/lib | ||
149 | install -d bootstrap/ecj/jre/lib/$libarch | ||
150 | cp openjdk-ecj/build/linux-$arch/j2sdk-image/jre/lib/$libarch/server/libjvm.so bootstrap/ecj/jre/lib/$libarch | ||
151 | |||
152 | # OpenJDK build expects these files to exist (by creating those files we pretend | ||
153 | # that stuff was compiled) | ||
154 | common_dir=openjdk-ecj/build/linux-$arch/tmp/sun | ||
155 | for D in javax.sound/jsoundalsa sun.awt.X11/xawt sun.awt/jawt; | ||
156 | do | ||
157 | echo "creating $common_dir/$D/obj64/.files_compiled" | ||
158 | install -d $common_dir/$D/obj64 | ||
159 | touch $common_dir/$D/obj64/.files_compiled | ||
160 | |||
161 | echo "creating $common_dir/$D/obj/.files_compiled" | ||
162 | install -d $common_dir/$D/obj | ||
163 | touch $common_dir/$D/obj/.files_compiled | ||
164 | done | ||
165 | |||
166 | # now use the jni.h from the hotspot | ||
167 | #cp | ||
168 | |||
169 | echo "2/2 Running make icedtea-against-ecj" | ||
170 | # Now cross-compile bootstrap JDK | ||
171 | rm stamps/icedtea-against-ecj.stamp stamps/icedtea-ecj.stamp || true | ||
172 | oe_runmake icedtea-against-ecj | ||
173 | |||
174 | # Creates a nice symlink which allows us to reach the created files easily. | ||
175 | oe_runmake stamps/bootstrap-directory-symlink.stamp | ||
176 | } | ||
177 | |||
178 | do_install() { | ||
179 | case "${TARGET_ARCH}" in | ||
180 | x86_64) | ||
181 | JDK_ARCH=amd64 | ||
182 | ;; | ||
183 | i386|i486|i586|i686) | ||
184 | JDK_ARCH=x86 | ||
185 | ;; | ||
186 | *) | ||
187 | JDK_ARCH=${TARGET_ARCH} | ||
188 | ;; | ||
189 | esac | ||
190 | |||
191 | install -d ${JDK_INSTALL_DIR} | ||
192 | |||
193 | for F in bootstrap/icedtea/{bin,include,jre,lib} | ||
194 | do | ||
195 | cp -RL $F ${JDK_INSTALL_DIR} | ||
196 | done | ||
197 | |||
198 | install -d ${JDK_INSTALL_DIR}/include/hpi | ||
199 | cp openjdk-ecj/jdk/src/solaris/hpi/export/*.h ${JDK_INSTALL_DIR}/include/hpi | ||
200 | cp openjdk-ecj/jdk/src/share/hpi/export/*.h ${JDK_INSTALL_DIR}/include/hpi | ||
201 | |||
202 | install -d ${JDK_INSTALL_DIR}/include/javavm | ||
203 | cp openjdk-ecj/jdk/src/share/javavm/export/*.h ${JDK_INSTALL_DIR}/include/javavm | ||
204 | cp openjdk-ecj/jdk/src/solaris/javavm/export/*.h ${JDK_INSTALL_DIR}/include/javavm | ||
205 | |||
206 | install -d ${JDK_INSTALL_DIR}/generated | ||
207 | cp generated/sun/awt/X11/generator/sizer.32 ${JDK_INSTALL_DIR}/generated | ||
208 | |||
209 | # Fix libjvm.so dependency of libfontmanager.so | ||
210 | ln -sf server/libjvm.so ${JDK_INSTALL_DIR}/jre/lib/${JDK_ARCH}/libjvm.so | ||
211 | ln -sf server/libjvm.so ${JDK_INSTALL_DIR}/jre/lib/${JDK_ARCH}/libjvm.so.0 | ||
212 | |||
213 | # Fix missing write permissions on the files. | ||
214 | chmod ug+w -R ${JDK_INSTALL_DIR} | ||
215 | } | ||