aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-04-15 10:40:02 +0000
committerTimo Teräs <timo.teras@iki.fi>2014-04-15 10:40:02 +0000
commitbb62ff0be2acc91f2a2ed37e0314f0088684aef3 (patch)
treebba68b9f342d5852cab856d978bc9543b8e182db
parent3ef61caf02705593434b656b0ad7c65fee0d72c1 (diff)
downloadalpine_aports-bb62ff0be2acc91f2a2ed37e0314f0088684aef3.tar.bz2
alpine_aports-bb62ff0be2acc91f2a2ed37e0314f0088684aef3.tar.xz
alpine_aports-bb62ff0be2acc91f2a2ed37e0314f0088684aef3.zip
main/openjdk6: remove as superceded by openjdk7
-rw-r--r--main/openjdk6/APKBUILD261
-rw-r--r--main/openjdk6/fix-with-pax.patch26
-rw-r--r--main/openjdk6/icedtea-hotspot-musl.patch55
-rw-r--r--main/openjdk6/icedtea-hotspot-noagent-musl.patch56
-rw-r--r--main/openjdk6/icedtea-hotspot-uclibc-fixes.patch101
-rw-r--r--main/openjdk6/icedtea-jdk-execinfo.patch40
-rw-r--r--main/openjdk6/icedtea-jdk-fix-ipv6-init.patch42
-rw-r--r--main/openjdk6/icedtea-jdk-iconv-uclibc.patch39
-rw-r--r--main/openjdk6/icedtea-jdk-musl.patch196
-rw-r--r--main/openjdk6/icedtea-jdk-no-lib-nsl-uclibc.patch84
-rw-r--r--main/openjdk6/icedtea-jdk-no-soname.patch12
-rw-r--r--main/openjdk6/icedtea6-1.9.7-generate_cacerts-1.patch341
12 files changed, 0 insertions, 1253 deletions
diff --git a/main/openjdk6/APKBUILD b/main/openjdk6/APKBUILD
deleted file mode 100644
index dadecdf4b0..0000000000
--- a/main/openjdk6/APKBUILD
+++ /dev/null
@@ -1,261 +0,0 @@
1# Contributor: Timo Teras <timo.teras@iki.fi>
2# Maintainer: Timo Teras <timo.teras@iki.fi>
3pkgname=openjdk6
4_icedteaver=1.12.8
5_openjdkbuild=27
6pkgver=6.$_openjdkbuild.$_icedteaver
7pkgrel=1
8pkgdesc="Sun OpenJDK 6 via IcedTea"
9url="http://icedtea.classpath.org/"
10arch="x86 x86_64"
11license="GPL-2 with Classpath"
12depends="$pkgname-jre"
13options="sover-namecheck"
14makedepends="findutils tar zip paxctl gawk pkgconfig util-linux
15 autoconf automake nss-dev cups-dev jpeg-dev giflib-dev libpng-dev libxt-dev
16 libxp-dev libxtst-dev libxinerama-dev libiconv-dev
17 libxrender-dev alsa-lib-dev freetype-dev xulrunner-dev
18 gtk+2.0-dev ca-certificates libxslt zip"
19install=""
20
21INSTALL_BASE=/usr/lib/jvm/java-1.6-openjdk
22
23if [ "$BOOTSTRAP" != "no" ]; then
24 makedepends="$makedepends java-gcj-compat"
25 BOOTSTRAP_JAVA_HOME="/usr/lib/jvm/java-1.5-gcj/"
26else
27 makedepends="$makedepends $pkgname"
28 BOOTSTRAP_JAVA_HOME="$INSTALL_BASE"
29fi
30
31OPENJDK_VERSION=b$_openjdkbuild
32OPENJDK_DATE=26_oct_2012
33RHINO_VER=1_7R3
34ANT_VER=1.9.2
35
36case $CARCH in
37x86) _jarch=i386;;
38x86_64) _jarch=amd64;;
39arm) _jarch=arm;;
40esac
41
42# exclude xawt from ldpath to avoid duplicate provides for libmawt.so (also in
43# headless).
44# infuture this should be a virtual provides
45_jrelib="$INSTALL_BASE/jre/lib/$_jarch"
46ldpath="$_jrelib:$_jrelib/native_threads:$_jrelib/headless:$_jrelib/server:$_jrelib/jli"
47somask="libjvm.so"
48
49subpackages="$pkgname-jre-lib:jrelib $pkgname-jre $pkgname-jre-base:jrebase
50 $pkgname-doc:doc"
51source="http://download.java.net/openjdk/jdk6/promoted/$OPENJDK_VERSION/openjdk-6-src-$OPENJDK_VERSION-$OPENJDK_DATE.tar.gz
52 http://icedtea.classpath.org/download/source/icedtea6-$_icedteaver.tar.gz
53 http://archive.apache.org/dist/ant/binaries/apache-ant-$ANT_VER-bin.tar.gz
54 ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino$RHINO_VER.zip
55 icedtea-hotspot-uclibc-fixes.patch
56 icedtea-hotspot-musl.patch
57 icedtea-hotspot-noagent-musl.patch
58 icedtea-jdk-fix-ipv6-init.patch
59 icedtea-jdk-iconv-uclibc.patch
60 icedtea-jdk-execinfo.patch
61 icedtea-jdk-musl.patch
62 icedtea-jdk-no-lib-nsl-uclibc.patch
63 icedtea6-1.9.7-generate_cacerts-1.patch
64 icedtea-jdk-no-soname.patch
65 fix-with-pax.patch
66 "
67
68_builddir="$srcdir/icedtea6-$_icedteaver"
69
70unpack() {
71 if [ -z "$force" ]; then
72 verify || return 1
73 initdcheck || return 1
74 fi
75 mkdir -p "$srcdir"
76 msg "Unpacking sources..."
77 tar -C "$srcdir" -zxf icedtea6-$_icedteaver.tar.gz || return 1
78 tar -C "$srcdir" -zxf apache-ant-$ANT_VER-bin.tar.gz || return 1
79 unzip -o -q "rhino$RHINO_VER.zip" -d "$srcdir" || return 1
80}
81
82prepare() {
83 cd "$_builddir"
84
85 # Busybox sha256 does not support longopts
86 sed -e "s/--check/-c/g" -i Makefile.am
87
88 for patch in $source; do
89 case $patch in
90 icedtea-*.patch)
91 cp ../$patch patches
92 ;;
93 *.patch)
94 msg "Applying patch $patch"
95 patch -p1 -i "$srcdir"/$patch || return 1
96 ;;
97 esac
98 done
99}
100
101build() {
102 [ -z "$JOBS" ] && export JOBS=`echo $MAKEFLAGS | sed -n -e 's/.*-j\([0-9]\+\).*/\1/p'`
103 export JAVA_HOME=$BOOTSTRAP_JAVA_HOME
104 export PATH=$JAVA_HOME/bin:$srcdir/apache-ant-$ANT_VER/bin:$PATH
105 export DISTRIBUTION_PATCHES=""
106
107 local patch
108 for patch in $source; do
109 case $patch in
110 icedtea-*.patch)
111 export DISTRIBUTION_PATCHES="$DISTRIBUTION_PATCHES patches/$patch"
112 ;;
113 esac
114 done
115 echo "icedtea patches: $DISTRIBUTION_PATCHES"
116
117 local _bootstrap=""
118 [ "$BOOTSTRAP" = "no" ] && _bootstrap="--disable-bootstrap"
119
120 cd "$_builddir"
121 sh autogen.sh
122 ./configure \
123 --build=$CBUILD \
124 --host=$CHOST \
125 --prefix=/usr \
126 --sysconfdir=/etc \
127 --mandir=/usr/share/man \
128 --infodir=/usr/share/info \
129 --localstatedir=/var \
130 --disable-dependency-tracking \
131 --disable-downloading \
132 --with-parallel-jobs=${JOBS:-2} \
133 --enable-cacerts \
134 --with-ca-dir=/etc/ssl/certs \
135 --with-jdk-home=$BOOTSTRAP_JAVA_HOME \
136 --with-pax=paxctl \
137 $_bootstrap \
138 --with-openjdk-src-zip=$srcdir/openjdk-6-src-$OPENJDK_VERSION-$OPENJDK_DATE.tar.gz \
139 --with-ant-home=$srcdir/apache-ant-$ANT_VER \
140 --with-rhino=$srcdir/rhino$RHINO_VER/js.jar \
141 --with-pkgversion="Alpine ${pkgver}-r${pkgrel}" \
142 --with-abs-install-dir="$INSTALL_BASE" \
143 || return 1
144
145 make || return 1
146}
147
148package() {
149 mkdir -p "$pkgdir"/$INSTALL_BASE
150 cp -a "$_builddir"/openjdk.build/j2sdk-image/* "$pkgdir"/$INSTALL_BASE
151 rm "$pkgdir"/$INSTALL_BASE/src.zip
152 scanelf --nobanner "$pkgdir"/$INSTALL_BASE/bin/* | awk '{print $2}' \
153 | xargs paxctl -c -mr
154}
155
156jrelib() {
157 pkgdesc="OpenJDK 6 Java Runtime (class libraries)"
158 arch="noarch"
159 depends=""
160
161 for A in jre/lib/zi jre/lib/images jre/lib/*.jar jre/lib/security \
162 jre/lib/ext/*.jar jre/lib/cmm jre/ASSEMBLY_EXCEPTION \
163 jre/THIRD_PARTY_README jre/LICENSE ; do
164 dirname=${A%/*}
165 mkdir -p "$subpkgdir"/$INSTALL_BASE/$dirname
166 mv "$pkgdir"/$INSTALL_BASE/$A "$subpkgdir"/$INSTALL_BASE/$dirname
167 done
168}
169
170jrebase() {
171 pkgdesc="OpenJDK 6 Java Runtime (no GUI support)"
172 depends="$pkgname-jre-lib java-common"
173 # manually provide this to avoid clash with libgcj's libjvm.so
174 provides="so:openjdk6:libjvm.so=0"
175
176 mkdir -p "$subpkgdir"/$INSTALL_BASE/bin
177
178 for A in java orbd rmid servertool unpack200 keytool \
179 pack200 rmiregistry tnameserv ; do
180 mv "$pkgdir"/$INSTALL_BASE/bin/$A "$subpkgdir"/$INSTALL_BASE/bin
181 done
182
183 # rest of the jre subdir (which were not taken by -jre subpkg)
184 mv "$pkgdir"/$INSTALL_BASE/jre "$subpkgdir"/$INSTALL_BASE
185
186 # all java stuff seems to need mprotect and randomization off
187 # or otherwise the vm fails to allocate enough memory
188 paxctl -c -mr \
189 "$subpkgdir"/$INSTALL_BASE/bin/* \
190 "$subpkgdir"/$INSTALL_BASE/jre/bin/*
191}
192
193jre() {
194 pkgdesc="OpenJDK 6 Java Runtime"
195 # manually depend to avoid clash with libgcj's libjvm.so
196 depends="so:openjdk6:libjvm.so=0"
197
198 mkdir -p "$subpkgdir"
199 for A in jre/bin/policytool \
200 bin/appletviewer \
201 bin/policytool \
202 jre/lib/$_jarch/xawt \
203 jre/lib/$_jarch/libsplashscreen.so ; do
204 dirname=${A%/*}
205 mkdir -p "$subpkgdir"/$INSTALL_BASE/$dirname
206 mv "$pkgdir"/$INSTALL_BASE/$A "$subpkgdir"/$INSTALL_BASE/$dirname
207 done
208}
209
210doc() {
211 default_doc
212
213 mkdir -p "$subpkgdir"/$INSTALL_BASE/
214 mv "$pkgdir"/$INSTALL_BASE/man "$subpkgdir"/$INSTALL_BASE/
215}
216
217md5sums="3a0963158e07c8829c8bd31a698bd23d openjdk-6-src-b27-26_oct_2012.tar.gz
2187712c4b3b9f8092aa8c7b5cad0b46d06 icedtea6-1.12.8.tar.gz
2199a2826a1819aa128629778217af36c55 apache-ant-1.9.2-bin.tar.gz
22099d94103662a8d0b571e247a77432ac5 rhino1_7R3.zip
22158c107b4c03cd365b4ddf0bfd8179cc4 icedtea-hotspot-uclibc-fixes.patch
222e9beae91433317ccf785bccafaf53b1b icedtea-hotspot-musl.patch
22350ccd48072537d6e9bc562cb65431871 icedtea-hotspot-noagent-musl.patch
224250b0807b59762670954b132e8f8dfba icedtea-jdk-fix-ipv6-init.patch
2257c0814181e5adc0763c5c0a24b01d4cb icedtea-jdk-iconv-uclibc.patch
226bd623081d5d2e63694c3649975b12412 icedtea-jdk-execinfo.patch
2279c7810cb0ff1e89935690e4810199c1f icedtea-jdk-musl.patch
228c4bb40d5b1ff690b27900c5cd06bc1e5 icedtea-jdk-no-lib-nsl-uclibc.patch
2290bc0131c87fcc0d1046e3ba20d205c73 icedtea6-1.9.7-generate_cacerts-1.patch
230d014431e70cdabb82a75e4b9ae4c28a9 icedtea-jdk-no-soname.patch
231d2999b5b67afe485554d14ecd1aa6046 fix-with-pax.patch"
232sha256sums="044c3877b15940ff04f8aa817337f2878a00cc89674854557f1a02f15b1802a0 openjdk-6-src-b27-26_oct_2012.tar.gz
233c2ad74af29af774f778675d3fde952f4defebb2be44f565253d788e2e7af39d4 icedtea6-1.12.8.tar.gz
234cab1b8754e5f1f2aa869e2ba603903ae5e81a585de4eafd00f173531a11b5a45 apache-ant-1.9.2-bin.tar.gz
235885b46e24fe5af23ad3712c5e08e8d97d6d92a4b89e1be860e8fe88e4a3dacd1 rhino1_7R3.zip
2366f3642c6c29b8be6c5fe0f204183bc05e57459546ea64de0491713963b8a8ebd icedtea-hotspot-uclibc-fixes.patch
237d3ad6890f6732f0a87a44de0914fe4146078c204808573118ff7716142f67823 icedtea-hotspot-musl.patch
2383332640b95773532c197d7d8818bfb2ee3217093e4a6bc57914bda355423c842 icedtea-hotspot-noagent-musl.patch
239632683ec88a6fb250ef043aae9cace605d0c669b7058f8c47b62b09b03ecc6c5 icedtea-jdk-fix-ipv6-init.patch
240a36ff13d81a1f1415bedd595b77f2c43574c546938cce7882cb33bbe63464865 icedtea-jdk-iconv-uclibc.patch
2416cebef19d8eec5a4623a96c37ae71b79d124a10478c1db33ad5fc71bc04b30e9 icedtea-jdk-execinfo.patch
2427c5dc3744be7394c106ced3418ce8eb5a0860660d11dce8eb95c6b4faf630958 icedtea-jdk-musl.patch
2436bba2870af0c5eac7b6edb7351e8e1833db401b1bf6b4861a14dcb1fd45cbea6 icedtea-jdk-no-lib-nsl-uclibc.patch
244f83dea0ee1d11deceb45d643cf0cce84099775de88b972e3ea979a8529bf4c85 icedtea6-1.9.7-generate_cacerts-1.patch
2456c0bbe710395c4ced1359ab279be6a7c36da5bfb9fd60dc47d920f06a0456d82 icedtea-jdk-no-soname.patch
246b6aab36220a1318f344573041c28885cfa5ab6e21f393995f47c19db9f09917c fix-with-pax.patch"
247sha512sums="4198f11b2f49c9bc5ffbeadf2d0d87dfa413a918d49faff3a043266bf4a2fa99579fba3c6d75164d87e88b8fc5c97c3c1527560eb25c55cdd42ad813c8e175e8 openjdk-6-src-b27-26_oct_2012.tar.gz
2488e1cdf4124ee7b7c67f1832043546aea530de98ace3bb2177a5015c24aa81f8fd5f5b2a84f3dee7fb83cfb1680eef1fa17af0464c73a6b8947926a2d2c91d202 icedtea6-1.12.8.tar.gz
249618c0c3d80f7c44c2bb8cdfdc2b5278ccd926ab1aa0c8f7099bd0ad5cb4c090f023c0b86c8267052a0a6b1ac57076296fcc16042b9e7a72a1482af63c99e0e49 apache-ant-1.9.2-bin.tar.gz
25077964485481e22d20459ea094c773e1930c5ef22d69bc449375a1ead31f340b3a652e2dd85c645e210be1abc8e623aeb560a5dc81629f388322af270ce868d36 rhino1_7R3.zip
2511fcc9d22bdc0a991e1739f2d15db73c7ada7640223eb79a9db3bfe106c39b0228e9196af10eba754a2f3f6f26b9b2c4b814be23b3149f72103a369bbc5c0fae8 icedtea-hotspot-uclibc-fixes.patch
2528039e155511e066e4c7031b0ad4fe721a86f3be859e949f2e30fda5cefb04d4e1cf64059f6603325f5f13434855346931659c07b1e8527959767f3ff7f83df7b icedtea-hotspot-musl.patch
253f079b4f353a54b8927609c3ce2836ccce0495830557de0c66402e3a0e3f30f08dec4832e4b2fab6fc57d1dbedd1ef93fb15d994ebcec823663cd5a6e90c14c8a icedtea-hotspot-noagent-musl.patch
25448533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774 icedtea-jdk-fix-ipv6-init.patch
255a6ee1c63a171859ab1350481bc3e5d464354f1105d80fc72c1d58620672ca5c1a550b954b35917f89537f0aeb28c49470b27522ce53588e42dedff41e074774c icedtea-jdk-iconv-uclibc.patch
2560391970e6a32946aa3cccf38fdef9c0fe2af26cd0df824b98aa2fcfa1bf661d4a68e339bffcfd16f386c565fc68bb28a29208a67d4bad8a0e847ad02bd8becbb icedtea-jdk-execinfo.patch
257fb9b324763e75a24b7174a5b25a064947d31f25b51e45b3b5225adf02a6eae98467aa1d0edfe606e93621b560900ab4c5acab09be411edff86cd82f6ba830cd3 icedtea-jdk-musl.patch
258833ec90fa9d3d26191303201012e4b8ca220d634497277f7e8c703ca03753720343e22c97dd2f10cd3e3be79c84f95b8c7d0db21545b8a35761c0de7cb834e7a icedtea-jdk-no-lib-nsl-uclibc.patch
2595fbf3571abd6e0eece8fecd45365996ff83368d674782da3435681afdd6cbb51c6da7e8e4d9ca3ba767a1d373a01d0a4109d1c9bf9b93109a34accaee134a8ab icedtea6-1.9.7-generate_cacerts-1.patch
260bf4b184e170f7b0ff64ab30d2162784fe2bd5460d1fa31973259f7065fd4c511c46f97724fe2bd72bb94e9006cb568d0e0c87d1a9c90819e65880f8f44830bb1 icedtea-jdk-no-soname.patch
2617f8ce4b35856ec8c023bdca682773bebeebe9c11652259b968efad370be24885c22bf7bdd687c6665385ca89f75a7df38429e5a7ea4828cdd8be49fce3f8878c fix-with-pax.patch"
diff --git a/main/openjdk6/fix-with-pax.patch b/main/openjdk6/fix-with-pax.patch
deleted file mode 100644
index c9125585b7..0000000000
--- a/main/openjdk6/fix-with-pax.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1--- icedtea6-1.12.6/acinclude.m4.orig
2+++ icedtea6-1.12.6/acinclude.m4
3@@ -1948,10 +1948,10 @@
4 xpaxctl)
5 case "${host_cpu}" in
6 i?86)
7- PAX_COMMAND_ARGS="-msp"
8+ PAX_COMMAND_ARGS="-c -msp"
9 ;;
10 *)
11- PAX_COMMAND_ARGS="-m"
12+ PAX_COMMAND_ARGS="-c -m"
13 ;;
14 esac
15 ;;
16--- icedtea6-1.12.6/Makefile.am.orig
17+++ icedtea6-1.12.6/Makefile.am
18@@ -2192,7 +2192,7 @@
19 fi
20 rm -f stamps/add-tzdata-support-ecj.stamp
21
22-stamps/add-archive-ecj.stamp: stamps/icedtea-ecj.stamp
23+stamps/add-archive-ecj.stamp: stamps/icedtea-ecj.stamp stamps/pax-mark-vm-ecj.stamp
24 if !ENABLE_JAMVM
25 if !ENABLE_CACAO
26 if !ZERO_BUILD
diff --git a/main/openjdk6/icedtea-hotspot-musl.patch b/main/openjdk6/icedtea-hotspot-musl.patch
deleted file mode 100644
index ef61635489..0000000000
--- a/main/openjdk6/icedtea-hotspot-musl.patch
+++ /dev/null
@@ -1,55 +0,0 @@
1--- openjdk.orig/hotspot/src/os/linux/vm/jvm_linux.cpp
2+++ openjdk/hotspot/src/os/linux/vm/jvm_linux.cpp
3@@ -159,7 +159,9 @@
4 #ifdef SIGSTKFLT
5 "STKFLT", SIGSTKFLT, /* Stack fault. */
6 #endif
7+#ifdef SIGCLD
8 "CLD", SIGCLD, /* Same as SIGCHLD (System V). */
9+#endif
10 "CHLD", SIGCHLD, /* Child status has changed (POSIX). */
11 "CONT", SIGCONT, /* Continue (POSIX). */
12 "STOP", SIGSTOP, /* Stop, unblockable (POSIX). */
13--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.inline.hpp
14+++ openjdk/hotspot/src/os/linux/vm/os_linux.inline.hpp
15@@ -44,7 +44,7 @@
16
17 #include <unistd.h>
18 #include <sys/socket.h>
19-#include <sys/poll.h>
20+#include <poll.h>
21 #include <netdb.h>
22
23 inline void* os::thread_local_storage_at(int index) {
24--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
25+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
26@@ -31,7 +31,9 @@
27 // map stack pointer to thread pointer - see notes in threadLS_linux_x86.cpp
28 #define SP_BITLENGTH 32
29 #define PAGE_SHIFT 12
30+ #ifndef PAGE_SIZE
31 #define PAGE_SIZE (1UL << PAGE_SHIFT)
32+ #endif
33 static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)];
34 #endif // !AMD64
35
36--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
37+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
38@@ -79,7 +79,6 @@
39 # include <pwd.h>
40 # include <poll.h>
41 # include <ucontext.h>
42-# include <fpu_control.h>
43
44 #ifdef AMD64
45 #define REG_SP REG_RSP
46@@ -529,6 +528,9 @@
47
48 ShouldNotReachHere();
49 }
50+
51+#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
52+#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
53
54 void os::Linux::init_thread_fpu_state(void) {
55 #ifndef AMD64
diff --git a/main/openjdk6/icedtea-hotspot-noagent-musl.patch b/main/openjdk6/icedtea-hotspot-noagent-musl.patch
deleted file mode 100644
index 0128241a96..0000000000
--- a/main/openjdk6/icedtea-hotspot-noagent-musl.patch
+++ /dev/null
@@ -1,56 +0,0 @@
1--- openjdk.orig/hotspot/make/linux/makefiles/sa.make
2+++ openjdk/hotspot/make/linux/makefiles/sa.make
3@@ -59,9 +59,12 @@
4
5 # if $(AGENT_DIR) does not exist, we don't build SA
6 # also, we don't build SA on Itanium, PowerPC, ARM or zero.
7+# check for thread_db.h too (musl does not have it).
8
9 all:
10- if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
11+ if [ -d $(AGENT_DIR) \
12+ -a -f /usr/include/thread_db.h \
13+ -a "$(SRCARCH)" != "ia64" \
14 -a "$(SRCARCH)" != "arm" \
15 -a "$(SRCARCH)" != "ppc" \
16 -a "$(SRCARCH)" != "zero" ] ; then \
17--- openjdk.orig/hotspot/make/linux/makefiles/saproc.make
18+++ openjdk/hotspot/make/linux/makefiles/saproc.make
19@@ -54,10 +54,13 @@
20
21 # if $(AGENT_DIR) does not exist, we don't build SA
22 # also, we don't build SA on Itanium, PPC, ARM or zero.
23+# check for thread_db.h too (musl does not have it).
24
25+ifneq ($(wildcard /usr/include/thread_db.h),)
26 ifneq ($(wildcard $(AGENT_DIR)),)
27 ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
28 BUILDLIBSAPROC = $(LIBSAPROC)
29+endif
30 endif
31 endif
32
33--- openjdk.orig/hotspot/make/linux/makefiles/defs.make
34+++ openjdk/hotspot/make/linux/makefiles/defs.make
35@@ -144,10 +144,17 @@
36
37 # Serviceability Binaries
38 # No SA Support for PPC, IA64, ARM or zero
39-ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
40- $(EXPORT_LIB_DIR)/sa-jdi.jar
41-ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
42- $(EXPORT_LIB_DIR)/sa-jdi.jar
43+# or if thread_db.h missing (musl)
44+
45+ifneq ($(wildcard /usr/include/thread_db.h),)
46+SA_BINARY_LIST = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
47+ $(EXPORT_LIB_DIR)/sa-jdi.jar
48+else
49+SA_BINARY_LIST =
50+endif
51+
52+ADD_SA_BINARIES/x86 = $(SA_BINARY_LIST)
53+ADD_SA_BINARIES/sparc = $(SA_BINARY_LIST)
54 ADD_SA_BINARIES/ppc =
55 ADD_SA_BINARIES/ia64 =
56 ADD_SA_BINARIES/arm =
diff --git a/main/openjdk6/icedtea-hotspot-uclibc-fixes.patch b/main/openjdk6/icedtea-hotspot-uclibc-fixes.patch
deleted file mode 100644
index 0cf4eade04..0000000000
--- a/main/openjdk6/icedtea-hotspot-uclibc-fixes.patch
+++ /dev/null
@@ -1,101 +0,0 @@
1--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp
2+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
3@@ -109,7 +109,6 @@
4 # include <string.h>
5 # include <syscall.h>
6 # include <sys/sysinfo.h>
7-# include <gnu/libc-version.h>
8 # include <sys/ipc.h>
9 # include <sys/shm.h>
10 # include <link.h>
11@@ -601,6 +600,13 @@
12 // detecting pthread library
13
14 void os::Linux::libpthread_init() {
15+#if 1
16+ // Hard code Alpine Linux supported uclibc/musl compatible settings
17+ os::Linux::set_glibc_version("glibc 2.9");
18+ os::Linux::set_libpthread_version("NPTL");
19+ os::Linux::set_is_NPTL();
20+ os::Linux::set_is_floating_stack();
21+#else
22 // Save glibc and pthread version strings. Note that _CS_GNU_LIBC_VERSION
23 // and _CS_GNU_LIBPTHREAD_VERSION are supported in glibc >= 2.3.2. Use a
24 // generic name for earlier versions.
25@@ -659,6 +665,7 @@
26 if (os::Linux::is_NPTL() || os::Linux::supports_variable_stack_size()) {
27 os::Linux::set_is_floating_stack();
28 }
29+#endif
30 }
31
32 /////////////////////////////////////////////////////////////////////////////
33@@ -2604,11 +2611,7 @@
34 // If we are running with earlier version, which did not have symbol versions,
35 // we should use the base version.
36 void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
37- void *f = dlvsym(handle, name, "libnuma_1.1");
38- if (f == NULL) {
39- f = dlsym(handle, name);
40- }
41- return f;
42+ return dlsym(handle, name);
43 }
44
45 bool os::Linux::libnuma_init() {
46@@ -4783,7 +4786,25 @@
47 // Linux doesn't yet have a (official) notion of processor sets,
48 // so just return the system wide load average.
49 int os::loadavg(double loadavg[], int nelem) {
50+#ifdef __UCLIBC__
51+ FILE *LOADAVG;
52+ double avg[3] = { 0.0, 0.0, 0.0 };
53+ int i, res = -1;;
54+
55+ if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
56+ fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
57+ res = 0;
58+ fclose(LOADAVG);
59+ }
60+
61+ for (i = 0; (i < nelem) && (i < 3); i++) {
62+ loadavg[i] = avg[i];
63+ }
64+
65+ return res;
66+#else
67 return ::getloadavg(loadavg, nelem);
68+#endif
69 }
70
71 void os::pause() {
72--- openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
73+++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
74@@ -238,14 +238,14 @@
75 // checking for nanness
76 #ifdef SOLARIS
77 #ifdef SPARC
78-inline int g_isnan(float f) { return isnanf(f); }
79+inline int g_isnan(float f) { return isnan(f); }
80 #else
81 // isnanf() broken on Intel Solaris use isnand()
82 inline int g_isnan(float f) { return isnand(f); }
83 #endif
84 inline int g_isnan(double f) { return isnand(f); }
85 #elif LINUX
86-inline int g_isnan(float f) { return isnanf(f); }
87+inline int g_isnan(float f) { return isnan(f); }
88 inline int g_isnan(double f) { return isnan(f); }
89 #else
90 #error "missing platform-specific definition here"
91@@ -259,8 +259,8 @@
92
93 // Checking for finiteness
94
95-inline int g_isfinite(jfloat f) { return finite(f); }
96-inline int g_isfinite(jdouble f) { return finite(f); }
97+inline int g_isfinite(jfloat f) { return isfinite(f); }
98+inline int g_isfinite(jdouble f) { return isfinite(f); }
99
100
101 // Wide characters
diff --git a/main/openjdk6/icedtea-jdk-execinfo.patch b/main/openjdk6/icedtea-jdk-execinfo.patch
deleted file mode 100644
index a6499dcb03..0000000000
--- a/main/openjdk6/icedtea-jdk-execinfo.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1--- openjdk.orig/jdk/src/solaris/native/sun/awt/awt_xembed_server.c
2+++ openjdk/jdk/src/solaris/native/sun/awt/awt_xembed_server.c
3@@ -35,7 +35,7 @@
4 #include <X11/Xlib.h>
5 #include <X11/Xatom.h>
6 #include <Xm/MwmUtil.h>
7-#ifdef __linux__
8+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
9 #include <execinfo.h>
10 #endif
11 #include <stdio.h>
12@@ -835,7 +835,7 @@
13 AWT_UNLOCK();
14 }
15
16-#ifdef __linux__
17+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
18 void
19 print_stack (void)
20 {
21--- openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c
22+++ openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c
23@@ -27,7 +27,7 @@
24 #include <X11/Xutil.h>
25 #include <X11/Xos.h>
26 #include <X11/Xatom.h>
27-#ifdef __linux__
28+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
29 #include <execinfo.h>
30 #endif
31
32@@ -689,7 +689,7 @@
33 return ret;
34 }
35
36-#ifdef __linux__
37+#if defined(__linux__) && defined(__GLIBC__) && ! defined(__UCLIBC__)
38 void print_stack(void)
39 {
40 void *array[10];
diff --git a/main/openjdk6/icedtea-jdk-fix-ipv6-init.patch b/main/openjdk6/icedtea-jdk-fix-ipv6-init.patch
deleted file mode 100644
index 11f3bf6dd6..0000000000
--- a/main/openjdk6/icedtea-jdk-fix-ipv6-init.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1--- openjdk/jdk/src/solaris/native/java/net/net_util_md.c.orig
2+++ openjdk/jdk/src/solaris/native/java/net/net_util_md.c
3@@ -561,7 +561,7 @@
4
5 static struct localinterface *localifs = 0;
6 static int localifsSize = 0; /* size of array */
7-static int nifs = 0; /* number of entries used in array */
8+static int nifs = -1; /* number of entries used in array */
9
10 /* not thread safe: make sure called once from one thread */
11
12@@ -573,6 +573,10 @@
13 int index, x1, x2, x3;
14 unsigned int u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,ua,ub,uc,ud,ue,uf;
15
16+ if (nifs >= 0)
17+ return ;
18+ nifs = 0;
19+
20 if ((f = fopen("/proc/net/if_inet6", "r")) == NULL) {
21 return ;
22 }
23@@ -601,7 +605,7 @@
24 localifs = (struct localinterface *) realloc (
25 localifs, sizeof (struct localinterface)* (localifsSize+5));
26 if (localifs == 0) {
27- nifs = 0;
28+ nifs = -1;
29 fclose (f);
30 return;
31 }
32@@ -624,9 +628,7 @@
33 static int getLocalScopeID (char *addr) {
34 struct localinterface *lif;
35 int i;
36- if (localifs == 0) {
37- initLocalIfs();
38- }
39+ initLocalIfs();
40 for (i=0, lif=localifs; i<nifs; i++, lif++) {
41 if (memcmp (addr, lif->localaddr, 16) == 0) {
42 return lif->index;
diff --git a/main/openjdk6/icedtea-jdk-iconv-uclibc.patch b/main/openjdk6/icedtea-jdk-iconv-uclibc.patch
deleted file mode 100644
index 68f858167f..0000000000
--- a/main/openjdk6/icedtea-jdk-iconv-uclibc.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1Index: openjdk/jdk/make/java/npt/Makefile
2===================================================================
3--- openjdk/jdk/make/java/npt/Makefile 2010-06-13 15:11:02.598512448 +0200
4+++ openjdk/jdk/make/java/npt/Makefile 2010-06-13 15:11:28.504759286 +0200
5@@ -65,6 +65,8 @@
6 # We don't want to link against -ljava
7 JAVALIB=
8
9+LDLIBS += -liconv
10+
11 # Add -export options to explicitly spell exported symbols
12 ifeq ($(PLATFORM), windows)
13 OTHER_LCF += -export:nptInitialize -export:nptTerminate
14Index: icedtea6-1.8/openjdk-ecj/jdk/make/java/instrument/Makefile
15===================================================================
16--- openjdk/jdk/make/java/instrument/Makefile 2010-06-13 15:12:14.688505195 +0200
17+++ openjdk/jdk/make/java/instrument/Makefile 2010-06-13 15:12:32.641425670 +0200
18@@ -123,6 +123,8 @@
19 # We don't want to link against -ljava
20 JAVALIB=
21
22+LDLIBS += -liconv
23+
24 #
25 # Add to ambient vpath so we pick up the library files
26 #
27Index: openjdk/jdk/make/sun/splashscreen/Makefile
28===================================================================
29--- openjdk/jdk/make/sun/splashscreen/Makefile 2010-06-13 15:12:48.951840824 +0200
30+++ openjdk/jdk/make/sun/splashscreen/Makefile 2010-06-13 15:13:01.191422891 +0200
31@@ -55,6 +55,8 @@
32
33 JAVALIB=
34
35+LDLIBS += -liconv
36+
37 #
38 # C Flags
39 #
diff --git a/main/openjdk6/icedtea-jdk-musl.patch b/main/openjdk6/icedtea-jdk-musl.patch
deleted file mode 100644
index d0710b646d..0000000000
--- a/main/openjdk6/icedtea-jdk-musl.patch
+++ /dev/null
@@ -1,196 +0,0 @@
1--- openjdk.orig/jdk/src/share/native/sun/awt/medialib/mlib_types.h
2+++ openjdk/jdk/src/share/native/sun/awt/medialib/mlib_types.h
3@@ -27,6 +27,7 @@
4 #ifndef MLIB_TYPES_H
5 #define MLIB_TYPES_H
6
7+#include <stddef.h> /* for NULL */
8 #include <limits.h>
9 #if defined(_MSC_VER)
10 #include <float.h> /* for FLT_MAX and DBL_MAX */
11--- openjdk.orig/jdk/src/solaris/hpi/native_threads/src/sys_api_td.c
12+++ openjdk/jdk/src/solaris/hpi/native_threads/src/sys_api_td.c
13@@ -64,11 +64,11 @@
14 #endif /* NO_INTERRUPTIBLE_IO */
15
16 /*
17- * Linux <sys/resource.h> does not define rlim_t (solaris
18+ * GLIBC <sys/resource.h> does not define rlim_t (solaris
19 * does). THIS IS PROBABLY NOT THE RIGHT THING TO DO, so
20 * somebody please fix this.
21 */
22-#ifdef __linux__
23+#ifdef __GLIBC__
24 typedef int rlim_t ;
25 #else
26 #include <sys/resource.h>
27--- openjdk.orig/jdk/src/solaris/native/java/io/UnixFileSystem_md.c
28+++ openjdk/jdk/src/solaris/native/java/io/UnixFileSystem_md.c
29@@ -66,7 +66,7 @@
30 * linux_largefile.h with a good stat64 structure to compile on
31 * glibc2.0 based systems.
32 */
33-#if defined(__solaris__) && !defined(_LFS_LARGEFILE) || !_LFS_LARGEFILE
34+#if defined(__solaris__) && (!defined(_LFS_LARGEFILE) || !_LFS_LARGEFILE)
35
36 /* The stat64 structure must be provided for systems without large-file support
37 (e.g., Solaris 2.5.1). These definitions are copied from the Solaris 2.6
38--- openjdk.orig/jdk/src/solaris/native/java/lang/java_props_md.c
39+++ openjdk/jdk/src/solaris/native/java/lang/java_props_md.c
40@@ -45,11 +45,13 @@
41 #include "locale_str.h"
42 #include "java_props.h"
43
44+#if !defined(CODESET)
45 #ifdef __linux__
46 #define CODESET _NL_CTYPE_CODESET_NAME
47 #else
48 #ifdef ALT_CODESET_KEY
49 #define CODESET ALT_CODESET_KEY
50+#endif
51 #endif
52 #endif
53
54--- openjdk.orig/jdk/src/solaris/native/java/net/Inet4AddressImpl.c
55+++ openjdk/jdk/src/solaris/native/java/net/Inet4AddressImpl.c
56@@ -45,6 +45,11 @@
57 #define HENT_BUF_SIZE 1024
58 #define BIG_HENT_BUF_SIZE 10240 /* a jumbo-sized one */
59
60+/* glibc vs. linux confusion, define glibc locally to fix musl build */
61+#if defined(__linux__) && !defined(__GLIBC__)
62+#define __GLIBC__
63+#endif
64+
65 #ifndef __GLIBC__
66 /* gethostname() is in libc.so but I can't find a header file for it */
67 extern int gethostname(char *buf, int buf_len);
68--- openjdk.orig/jdk/src/solaris/native/java/net/Inet6AddressImpl.c
69+++ openjdk/jdk/src/solaris/native/java/net/Inet6AddressImpl.c
70@@ -48,6 +48,11 @@
71 #define NI_MAXHOST 1025
72 #endif
73
74+/* glibc vs. linux confusion, define glibc locally to fix musl build */
75+#if defined(__linux__) && !defined(__GLIBC__)
76+#define __GLIBC__
77+#endif
78+
79 #ifndef __GLIBC__
80 /* gethostname() is in libc.so but I can't find a header file for it */
81 extern int gethostname(char *buf, int buf_len);
82--- openjdk.orig/jdk/src/solaris/native/java/net/NetworkInterface.c
83+++ openjdk/jdk/src/solaris/native/java/net/NetworkInterface.c
84@@ -40,7 +40,6 @@
85 #endif
86 #ifdef __linux__
87 #include <sys/ioctl.h>
88-#include <bits/ioctls.h>
89 #include <linux/sockios.h>
90 #include <sys/utsname.h>
91 #include <stdio.h>
92--- openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c
93+++ openjdk/jdk/src/solaris/native/java/net/linux_close.c
94@@ -59,7 +59,7 @@
95 /*
96 * Signal to unblock thread
97 */
98-static int sigWakeup = (__SIGRTMAX - 2);
99+static int sigWakeup;
100
101 /*
102 * The fd table and the number of file descriptors
103@@ -98,6 +98,7 @@
104 /*
105 * Setup the signal handler
106 */
107+ sigWakeup = SIGRTMAX - 2;
108 sa.sa_handler = sig_wakeup;
109 sa.sa_flags = 0;
110 sigemptyset(&sa.sa_mask);
111--- openjdk.orig/jdk/src/solaris/native/java/util/FileSystemPreferences.c
112+++ openjdk/jdk/src/solaris/native/java/util/FileSystemPreferences.c
113@@ -47,7 +47,6 @@
114 return (jint) result;
115 }
116
117-
118 typedef struct flock64 FLOCK;
119
120 /**
121--- openjdk.orig/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_config.h
122+++ openjdk/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_config.h
123@@ -32,7 +32,7 @@
124 #include <X11/Xutil.h>
125 #include <X11/extensions/shape.h>
126 #include <sys/types.h>
127-#include <sys/unistd.h>
128+#include <unistd.h>
129 #include <pthread.h>
130 #include <signal.h>
131 #include <inttypes.h>
132--- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c
133+++ openjdk/jdk/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c
134@@ -34,7 +34,9 @@
135 #include <unistd.h>
136 #include <sys/resource.h>
137 #include <sys/time.h>
138+#include <sys/epoll.h>
139
140+#if 0
141 #ifdef __cplusplus
142 extern "C" {
143 #endif
144@@ -63,6 +65,7 @@
145
146 #ifdef __cplusplus
147 }
148+#endif
149 #endif
150
151 #define RESTARTABLE(_cmd, _result) do { \
152--- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/NativeThread.c
153+++ openjdk/jdk/src/solaris/native/sun/nio/ch/NativeThread.c
154@@ -38,7 +38,7 @@
155 #include <sys/signal.h>
156
157 /* Also defined in src/solaris/native/java/net/linux_close.c */
158-#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
159+#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
160
161 static void
162 nullHandler(int sig)
163--- openjdk.orig/jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h
164+++ openjdk/jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h
165@@ -27,6 +27,7 @@
166 #define OGLFuncs_md_h_Included
167
168 #include <stdlib.h>
169+#include <dlfcn.h>
170 #include <link.h>
171 #include "J2D_GL/glx.h"
172 #include "OGLFuncMacros.h"
173--- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
174+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
175@@ -23,9 +23,7 @@
176 * questions.
177 */
178
179-#define ushort unsigned short
180-#define uint unsigned int
181-#define uchar unsigned char
182+#include <sys/types.h>
183
184 struct unpacker;
185
186--- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
187+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
188@@ -46,6 +46,8 @@
189
190 #include "zip.h"
191
192+#define uchar unsigned char
193+
194 #ifdef NO_ZLIB
195
196 inline bool jar::deflate_bytes(bytes& head, bytes& tail) {
diff --git a/main/openjdk6/icedtea-jdk-no-lib-nsl-uclibc.patch b/main/openjdk6/icedtea-jdk-no-lib-nsl-uclibc.patch
deleted file mode 100644
index 26f89bb546..0000000000
--- a/main/openjdk6/icedtea-jdk-no-lib-nsl-uclibc.patch
+++ /dev/null
@@ -1,84 +0,0 @@
1--- openjdk.orig/hotspot/agent/src/os/solaris/dbx/Makefile
2+++ openjdk/hotspot/agent/src/os/solaris/dbx/Makefile
3@@ -50,7 +50,7 @@
4 CFLAGS_32bit := -xarch=v8
5 CFLAGS_64bit := -xarch=v9
6 CFLAGS := -PIC -xO3 $(INCLUDES)
7-LIBS := -lsocket -lnsl -lrtld_db
8+LIBS := -lsocket -lrtld_db
9 LDFLAGS := -G
10
11 ifneq "$(ARCH)" "i486"
12--- openjdk.orig/jdk/make/java/hpi/hpi_common.gmk
13+++ openjdk/jdk/make/java/hpi/hpi_common.gmk
14@@ -86,5 +86,5 @@
15 # Things that must be linked in.
16 #
17 ifneq ($(PLATFORM), windows)
18-OTHER_LDLIBS += $(LIBSOCKET) -lnsl $(LIBM) -ldl
19+OTHER_LDLIBS += $(LIBSOCKET) $(LIBM) -ldl
20 endif
21--- openjdk.orig/jdk/make/java/java/Makefile
22+++ openjdk/jdk/make/java/java/Makefile
23@@ -205,7 +205,7 @@
24 OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \
25 -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib
26 else
27-OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) -lnsl -ldl \
28+OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) -ldl \
29 -L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
30 endif
31
32--- openjdk.orig/jdk/make/java/java_hprof_demo/Makefile
33+++ openjdk/jdk/make/java/java_hprof_demo/Makefile
34@@ -83,7 +83,7 @@
35 ifeq ($(PLATFORM), windows)
36 OTHER_LDLIBS += wsock32.lib winmm.lib
37 else
38- OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl
39+ OTHER_LDLIBS += $(LIBSOCKET) -ldl
40 endif
41
42 #
43--- openjdk.orig/jdk/make/java/net/Makefile
44+++ openjdk/jdk/make/java/net/Makefile
45@@ -97,7 +97,7 @@
46 # Will not compile at warning level 3 if warnings are fatal
47 COMPILER_WARNINGS_FATAL=false
48 else
49- OTHER_LDLIBS = $(LIBSOCKET) -lnsl -ldl $(JVMLIB)
50+ OTHER_LDLIBS = $(LIBSOCKET) -ldl $(JVMLIB)
51 endif
52 ifeq ($(PLATFORM), linux)
53 OTHER_LDLIBS += -lpthread
54--- openjdk.orig/jdk/make/jpda/transport/socket/Makefile
55+++ openjdk/jdk/make/jpda/transport/socket/Makefile
56@@ -42,11 +42,11 @@
57 endif
58
59 ifeq ($(PLATFORM), linux)
60- OTHER_LDLIBS += -lnsl $(LIBSOCKET) -lpthread
61+ OTHER_LDLIBS += $(LIBSOCKET) -lpthread
62 endif
63
64 ifeq ($(PLATFORM), solaris)
65- OTHER_LDLIBS += -lnsl $(LIBSOCKET)
66+ OTHER_LDLIBS += $(LIBSOCKET)
67 endif
68
69 ifeq ($(PLATFORM), windows)
70--- openjdk.orig/jdk/make/mkdemo/jvmti/hprof/Makefile
71+++ openjdk/jdk/make/mkdemo/jvmti/hprof/Makefile
72@@ -39,10 +39,10 @@
73 EXTRA_LIBS += wsock32.lib winmm.lib
74 endif
75 ifeq ($(PLATFORM), solaris)
76- OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl
77+ OTHER_LDLIBS += $(LIBSOCKET) -ldl
78 endif
79 ifeq ($(PLATFORM), linux)
80- OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl -lpthread
81+ OTHER_LDLIBS += $(LIBSOCKET) -ldl -lpthread
82 endif
83
84 #
diff --git a/main/openjdk6/icedtea-jdk-no-soname.patch b/main/openjdk6/icedtea-jdk-no-soname.patch
deleted file mode 100644
index fe6bbb7329..0000000000
--- a/main/openjdk6/icedtea-jdk-no-soname.patch
+++ /dev/null
@@ -1,12 +0,0 @@
1--- ./openjdk/jdk/make/common/Defs-linux.gmk.orig
2+++ ./openjdk/jdk/make/common/Defs-linux.gmk
3@@ -248,7 +248,9 @@
4 #
5 LDFLAGS_OPT = -Xlinker -O1
6 LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
7+ifdef LIBRARY
8 LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
9+endif
10
11 #
12 # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
diff --git a/main/openjdk6/icedtea6-1.9.7-generate_cacerts-1.patch b/main/openjdk6/icedtea6-1.9.7-generate_cacerts-1.patch
deleted file mode 100644
index 9f3074dff4..0000000000
--- a/main/openjdk6/icedtea6-1.9.7-generate_cacerts-1.patch
+++ /dev/null
@@ -1,341 +0,0 @@
1--- icedtea6-1.10.4/Makefile.am
2+++ icedtea6-1.10.4.mod/Makefile.am
3@@ -1376,6 +1376,19 @@
4 if ENABLE_JAMVM
5 printf -- '-jamvm ALIASED_TO -server\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg
6 endif
7+if GENERATE_CACERTS
8+ if test -n "${CADIR}"; then \
9+ sh scripts/mkcacerts.sh -d "${CADIR}" \
10+ -k $(BUILD_OUTPUT_DIR)/j2sdk-image/bin/keytool \
11+ -o $(BUILD_OUTPUT_DIR)/j2re-image/lib/security/cacerts; \
12+ else \
13+ sh scripts/mkcacerts.sh -f "${CAFILE}" \
14+ -k $(BUILD_OUTPUT_DIR)/j2sdk-image/bin/keytool \
15+ -o $(BUILD_OUTPUT_DIR)/j2re-image/lib/security/cacerts; \
16+ fi; \
17+ cp -f $(BUILD_OUTPUT_DIR)/j2re-image/lib/security/cacerts \
18+ $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security/cacerts;
19+endif
20 @echo "IcedTea is served:" $(BUILD_OUTPUT_DIR)
21 mkdir -p stamps
22 touch stamps/icedtea.stamp
23@@ -1407,6 +1420,19 @@
24 if ENABLE_JAMVM
25 printf -- '-jamvm ALIASED_TO -server\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg
26 endif
27+if GENERATE_CACERTS
28+ if test -n "${CADIR}"; then \
29+ sh scripts/mkcacerts.sh -d "${CADIR}" \
30+ -k $(BUILD_OUTPUT_DIR)/j2sdk-image/bin/keytool \
31+ -o $(BUILD_OUTPUT_DIR)/j2re-image/lib/security/cacerts; \
32+ else \
33+ sh scripts/mkcacerts.sh -f "${CAFILE}" \
34+ -k $(BUILD_OUTPUT_DIR)/j2sdk-image/bin/keytool \
35+ -o $(BUILD_OUTPUT_DIR)/j2re-image/lib/security/cacerts; \
36+ fi; \
37+ cp -f $(BUILD_OUTPUT_DIR)/j2re-image/lib/security/cacerts \
38+ $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/security/cacerts;
39+endif
40 @echo "IcedTea (debug build) is served:" \
41 $(DEBUG_BUILD_OUTPUT_DIR)
42 mkdir -p stamps
43@@ -1457,7 +1483,7 @@
44 $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
45 fi
46 cp $(abs_top_builddir)/tapset/jstack.stp \
47- $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
48+ $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp;
49 endif
50 touch stamps/add-systemtap.stamp
51
52@@ -1483,7 +1509,7 @@
53 $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/hotspot_jni.stp; \
54 fi
55 cp $(abs_top_builddir)/tapset/jstack.stp \
56- $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp
57+ $(DEBUG_BUILD_OUTPUT_DIR)/j2sdk-image/tapset/jstack.stp;
58 endif
59 touch stamps/add-systemtap-debug.stamp
60
61--- icedtea6-1.10.4/Makefile.in
62+++ icedtea6-1.10.4.mod/Makefile.in
63@@ -175,6 +175,8 @@
64 BUILD_ARCH_DIR = @BUILD_ARCH_DIR@
65 BUILD_OS_DIR = @BUILD_OS_DIR@
66 CACAO_IMPORT_PATH = @CACAO_IMPORT_PATH@
67+CADIR = @CADIR@
68+CAFILE = @CAFILE@
69 CC = @CC@
70 CCDEPMODE = @CCDEPMODE@
71 CFLAGS = @CFLAGS@
72--- icedtea6-1.10.4/acinclude.m4
73+++ icedtea6-1.10.4.mod/acinclude.m4
74@@ -1677,3 +1677,94 @@
75 AM_CONDITIONAL([CP40188_JAVAH], test x"${it_cv_cp40188_javah}" = "xyes")
76 AC_PROVIDE([$0])dnl
77 ])
78+
79+--- acinclude.m4 2011-01-22 21:34:29.000000000 -0600
80++++ acinclude.m4 2011-01-22 21:34:58.000000000 -0600
81+@@ -316,6 +316,91 @@
82+ AM_CONDITIONAL([SRC_DIR_HARDLINKABLE], test x"${it_cv_hardlink_src}" = "xyes")
83+ ])
84+
85+AC_DEFUN([IT_GENERATE_CACERTS],
86+[
87+ AC_MSG_CHECKING([whether to generate a cacerts file for distribution])
88+ AC_ARG_ENABLE([cacerts],
89+ [AS_HELP_STRING(--enable-cacerts, generate a cacerts file for distribution [[default=no]])],
90+ [
91+ case "${enableval}" in
92+ no)
93+ generate_cacerts=no
94+ ;;
95+ *)
96+ generate_cacerts=yes
97+ ;;
98+ esac
99+ ],
100+ [
101+ generate_cacerts=no
102+ ])
103+ AC_MSG_RESULT([$generate_cacerts])
104+ AM_CONDITIONAL([GENERATE_CACERTS], test x"${generate_cacerts}" = "xyes")
105+])
106+
107+AC_DEFUN([IT_GET_LOCAL_CACERTS],
108+[
109+ AC_MSG_CHECKING([for a local x509 certificate directory])
110+ AC_ARG_WITH([ca-dir],
111+ [AS_HELP_STRING(--with-ca-dir=DIR, specify a top-level local x509 certificate directory)],
112+ [
113+ if test -d "${withval}"; then
114+ CADIR="${withval}"
115+ fi
116+ ],
117+ [
118+ CADIR=
119+ ])
120+ if test -z "${CADIR}"; then
121+ for dir in /etc/pki/tls/certs \
122+ /usr/share/ca-certificates \
123+ /etc/ssl/certs \
124+ /etc/certs ; do
125+ if test -d "${dir}"; then
126+ CADIR="${dir}"
127+ break
128+ fi
129+ done
130+ if test -z "${CADIR}"; then
131+ CADIR=no
132+ fi
133+ fi
134+ AC_MSG_RESULT(${CADIR})
135+ AC_SUBST(CADIR)
136+
137+ AC_MSG_CHECKING([for a local x509 certificate file])
138+ AC_ARG_WITH([ca-file],
139+ [AS_HELP_STRING(--with-ca-file=FILE, specify a local x509 certificate file)],
140+ [
141+ if test -f "${withval}"; then
142+ CAFILE="${withval}"
143+ fi
144+ ],
145+ [
146+ CAFILE=
147+ ])
148+ if test -z "${CAFILE}"; then
149+ for file in /etc/pki/tls/certs/ca-bundle.crt \
150+ /etc/ssl/certs/ca-bundle.crt \
151+ /etc/ssl/ca-bundle.crt \
152+ /etc/ca-bundle.crt ; do
153+ if test -e "${file}"; then
154+ CAFILE=$file
155+ break
156+ fi
157+ done
158+ if test -z "${CAFILE}"; then
159+ CAFILE=no
160+ fi
161+ fi
162+ AC_MSG_RESULT(${CAFILE})
163+ AC_SUBST(CAFILE)
164+ if test "${CADIR}x" = "nox" -a "${CAFILE}x" = "nox"; then
165+ AC_MSG_WARN([Could not find a suitable x509 certificate store.])
166+ AC_MSG_ERROR([Supply a valid location using --with-ca-dir or --with-ca-file, or remove the --enable-cacerts switch.])
167+ fi
168+])
169--- icedtea6-1.10.4/configure.ac
170+++ icedtea6-1.10.4.mod/configure.ac
171@@ -138,6 +138,13 @@
172 AC_MSG_RESULT([disabled by default (edit java.security to enable)])
173 fi
174
175+IT_GENERATE_CACERTS
176+
177+if test "x${generate_cacerts}" = "xyes"
178+then
179+ IT_GET_LOCAL_CACERTS
180+fi
181+
182 IT_GET_PKGVERSION
183 IT_GET_LSB_DATA
184
185--- /dev/null
186+++ icedtea6-1.10.4.mod/scripts/mkcacerts.sh
187@@ -0,0 +1,154 @@
188+#!/bin/sh
189+# Simple script to extract x509 certificates and create a JRE cacerts file.
190+
191+get_args()
192+ {
193+ if test -z "${1}" ; then
194+ showhelp
195+ exit 1
196+ fi
197+
198+ while test -n "${1}" ; do
199+ case "${1}" in
200+ -f | --cafile)
201+ check_arg $1 $2
202+ CAFILE="${2}"
203+ shift 2
204+ ;;
205+ -d | --cadir)
206+ check_arg $1 $2
207+ CADIR="${2}"
208+ shift 2
209+ ;;
210+ -o | --outfile)
211+ check_arg $1 $2
212+ OUTFILE="${2}"
213+ shift 2
214+ ;;
215+ -k | --keytool)
216+ check_arg $1 $2
217+ KEYTOOL="${2}"
218+ shift 2
219+ ;;
220+ -h | --help)
221+ showhelp
222+ exit 0
223+ ;;
224+ *)
225+ showhelp
226+ exit 1
227+ ;;
228+ esac
229+ done
230+ }
231+
232+check_arg()
233+ {
234+ echo "${2}" | grep -v "^-" > /dev/null
235+ if [ -z "$?" -o ! -n "$2" ]; then
236+ echo "Error: $1 requires a valid argument."
237+ exit 1
238+ fi
239+ }
240+
241+
242+showhelp()
243+ {
244+ echo "`basename ${0}` creates a valid cacerts file for use with IcedTea."
245+ echo ""
246+ echo " -f --cafile The path to a file containing PEM formated CA"
247+ echo " certificates. May not be used with -d/--cadir."
248+ echo " -d --cadir The path to a diectory of PEM formatted CA"
249+ echo " certificates. May not be used with -f/--cafile."
250+ echo " -o --outfile The path to the output file."
251+ echo ""
252+ echo " -k --keytool The path to the java keytool utility."
253+ echo ""
254+ echo " -h --help Show this help message and exit."
255+ echo ""
256+ echo ""
257+ }
258+
259+# Initialize empty variables so that the shell does not polute the script
260+CAFILE=""
261+CADIR=""
262+OUTFILE=""
263+KEYTOOL=""
264+
265+# Process command line arguments
266+get_args ${@}
267+
268+# Handle common errors
269+if test "${CAFILE}x" == "x" -a "${CADIR}x" == "x" ; then
270+ echo "ERROR! You must provide an x509 certificate store!"
271+ echo "\'$(basename ${0}) --help\' for more info."
272+ echo ""
273+ exit 1
274+fi
275+
276+if test "${CAFILE}x" != "x" -a "${CADIR}x" != "x" ; then
277+ echo "ERROR! You cannot provide two x509 certificate stores!"
278+ echo "\'$(basename ${0}) --help\' for more info."
279+ echo ""
280+ exit 1
281+fi
282+
283+if test "${KEYTOOL}x" == "x" ; then
284+ echo "ERROR! You must provide a valid keytool program!"
285+ echo "\'$(basename ${0}) --help\' for more info."
286+ echo ""
287+ exit 1
288+fi
289+
290+if test "${OUTFILE}x" == "x" ; then
291+ echo "ERROR! You must provide a valid output file!"
292+ echo "\'$(basename ${0}) --help\' for more info."
293+ echo ""
294+ exit 1
295+fi
296+
297+# Get on with the work
298+
299+# If using a CAFILE, split it into individual files in a temp directory
300+if test "${CAFILE}x" != "x" ; then
301+ TEMPDIR=`mktemp -d`
302+ CADIR="${TEMPDIR}"
303+
304+ # Get a list of staring lines for each cert
305+ CERTLIST=`grep -n "^-----BEGIN" "${CAFILE}" | cut -d ":" -f 1`
306+
307+ # Get a list of ending lines for each cert
308+ ENDCERTLIST=`grep -n "^-----END" "${CAFILE}" | cut -d ":" -f 1`
309+
310+ # Start a loop
311+ for certbegin in `echo "${CERTLIST}"` ; do
312+ for certend in `echo "${ENDCERTLIST}"` ; do
313+ if test "${certend}" -gt "${certbegin}"; then
314+ break
315+ fi
316+ done
317+ sed -n "${certbegin},${certend}p" "${CAFILE}" > "${CADIR}/${certbegin}"
318+ keyhash=`openssl x509 -noout -in "${CADIR}/${certbegin}" -hash`
319+ echo "Generated PEM file with hash: ${keyhash}."
320+ mv "${CADIR}/${certbegin}" "${CADIR}/${keyhash}.pem"
321+ done
322+fi
323+
324+# Write the output file
325+for cert in `find "${CADIR}" -type f -name "*.pem" -o -name "*.crt"`
326+do
327+ ls "${cert}"
328+ tempfile=`mktemp`
329+ certbegin=`grep -n "^-----BEGIN" "${cert}" | cut -d ":" -f 1`
330+ certend=`grep -n "^-----END" "${cert}" | cut -d ":" -f 1`
331+ sed -n "${certbegin},${certend}p" "${cert}" > "${tempfile}"
332+ echo yes | "${KEYTOOL}" -import -alias `basename "${cert}"` -keystore \
333+ "${OUTFILE}" -storepass 'changeit' -file "${tempfile}"
334+ rm "${tempfile}"
335+done
336+
337+if test "${TEMPDIR}x" != "x" ; then
338+ rm -rf "${TEMPDIR}"
339+fi
340+exit 0
341+