aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-11-09 10:40:13 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-11-09 10:40:13 +0000
commitc300b6ea3630232e3f016c03e0a331462fc7556d (patch)
treeffd990ebb1d775052b0be1361d0b009318d3615c
parent922a6ed44cd16207c8cae7cbfae9da69d8961ac2 (diff)
downloadaports-c300b6ea3630232e3f016c03e0a331462fc7556d.tar.bz2
aports-c300b6ea3630232e3f016c03e0a331462fc7556d.tar.xz
main/gcc: initial support for java
-rw-r--r--main/gcc/APKBUILD88
-rw-r--r--main/gcc/boehem-gc-uclibc.patch11
2 files changed, 90 insertions, 9 deletions
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index 06e175175d..4e2feaa93a 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -15,18 +15,21 @@ else
_with_arch="i486"
fi
-pkgrel=7
+pkgrel=8
pkgdesc="The GNU Compiler Collection"
url="http://gcc.gnu.org"
license="GPL LGPL"
depends="binutils libgcc libgomp libobjc"
makedepends="bison flex gmp-dev mpfr-dev texinfo libmpc-dev gawk zlib-dev"
-subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp libobjc"
+subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp libobjc
+ $pkgname-java libgcj"
source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-core-$pkgver.tar.bz2
ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-g++-$pkgver.tar.bz2
ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-objc-$pkgver.tar.bz2
+ ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-java-$pkgver.tar.bz2
http://distfiles.gentoo.org/distfiles/gcc-$pkgver-piepatches-v${_piepatchver}.tar.bz2
http://distfiles.gentoo.org/distfiles/gcc-$_specs_gcc_ver-specs-$_specs_ver.tar.bz2
+ ftp://sourceware.org/pub/java/ecj-latest.jar
09_all_gcc-4.5-Wtrampolines.patch
15_all_gcc-libgomp-no-werror.patch
@@ -37,8 +40,8 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-core-$pkgver.tar.bz2
uclibc-getipinfo.patch
gcc-4.5-dynamic-linker.patch
PR32219.patch
+ boehem-gc-uclibc.patch
"
-# 50_all_pr45312-kernel-miscompile.patch
_gccdir="$srcdir"/gcc-$pkgver
prepare() {
@@ -74,6 +77,9 @@ prepare() {
-i gcc/Makefile.in || return 1
sed -e "/stage1_cflags=/s/-fno-stack-protector/-fno-stack-protector -fno-PIE/" \
-i configure
+
+ # see http://gcc.gnu.org/ml/java/2008-04/msg00027.html
+ mv "$srcdir"/ecj-latest.jar ecj.jar
}
build() {
@@ -85,9 +91,9 @@ build() {
../configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
- --build=${CHOST:-$_chost} \
+ --build=${CBUILD:-$_chost} \
--host=${CHOST:-$_chost} \
- --target=${CHOST:-$_chost} \
+ --target=${CTARGET:-$_chost} \
--disable-altivec \
--disable-checking \
--disable-fixed-point \
@@ -99,13 +105,12 @@ build() {
--enable-__cxa_atexit \
--enable-cld \
--enable-esp \
- --enable-languages=c,c++,objc \
+ --enable-languages=c,c++,objc,java \
--enable-shared \
--enable-target-optspace \
--enable-tls \
--enable-threads \
- --with-arch=i486 \
- $_with_arch \
+ --with-arch=$_with_arch \
$_dynamic_linker \
--with-dynamic-linker-prefix=/lib \
--with-system-zlib \
@@ -128,6 +133,23 @@ package() {
for i in *.specs; do
install -m644 $i "$pkgdir"/usr/share/gcc/$i || return 1
done
+
+ # we dont support gcj -static
+ # and saving 35MB is not bad.
+ find "$pkgdir" -name libgcj.a -o -name libgtkpeer.a \
+ -o -name libgjsmalsa.a -o -name libgcj-tools.a \
+ -o -name libjvm.a -o -name libgij.a -o -name libgcj_bc.a \
+ -o -name libjavamath.a \
+ | xargs rm -f \
+ || return 1
+ sed -i -e 's/lib: /&%{static:%eJava programs cannot be linked statically}/' \
+ "$pkdir"/usr/lib/libgcj.spec
+
+ # remove ffi
+ rm "$pkgdir"/usr/lib/libffi*
+ find "$pkgdir" -name 'ffi*.h' | xargs rm -f
+
+
}
libcxx() {
@@ -175,11 +197,58 @@ libgomp() {
mv "$pkgdir"/usr/lib/libgomp.so.* "$subpkgdir"/usr/lib/
}
+java() {
+ pkgdesc="Java support for GCC"
+ mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib
+ cd "$pkgdir"/usr/bin
+ mv gcj gcj-dbtool gjavah gcjh jcf-dump "$subpkgdir"/usr/bin/
+ cd "$pkgdir"
+ for i in $(find usr/ -name ecj1 -o -name jc1 -o -name jvgenmain); do
+ mkdir -p "$subpkgdir"/${i%/*}
+ mv "$pkgdir"/$i "$subpkgdir"/$i || return 1
+ done
+ mv \
+ "$pkgdir"/usr/lib/libgcj*.so \
+ "$pkgdir"/usr/lib/libgcj*.la \
+ "$pkgdir"/usr/lib/libgij.so \
+ "$pkgdir"/usr/lib/libgij.la \
+ "$pkgdir"/usr/lib/libgcj.spec \
+ "$subpkgdir"/usr/lib/
+}
+
+libgcj() {
+ pkgdesc="Java runtime library for gcc"
+ mkdir -p "$subpkgdir"/usr/bin
+ cd "$pkgdir"/usr/bin
+ mv aot-compile gappletviewer gc-analyze gij gjar gjarsigner gkeytool\
+ gnative2ascii gorbd grmic grmid grmiregistry gserialver \
+ gtnameserv i486-alpine-linux-uclibc-gcj jv-convert \
+ rebuild-gcj-db \
+ "$subpkgdir"/usr/bin/
+ cd "$pkgdir"
+ for i in $(find usr/lib -name jc1 -o -name jvgenmain); do
+ mkdir -p "$subpkgdir"/${i%/*}
+ mv "$pkgdir"/$i "$subpkgdir"/$i || return 1
+ done
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/gcj-* \
+ "$pkgdir"/usr/lib/libgcj*.so.* \
+ "$pkgdir"/usr/lib/libgij.so.* \
+ "$pkgdir"/usr/lib/logging.properties \
+ "$pkgdir"/usr/lib/security \
+ "$subpkgdir"/usr/lib/
+
+ mkdir -p "$subpkgdir"/usr/share/
+ mv "$pkgdir"/usr/share/java "$subpkgdir"/usr/share/
+}
+
md5sums="dc8959e31b01a65ce10d269614815054 gcc-core-4.5.1.tar.bz2
b294953ff0bb2f20c7acb2bf005d832a gcc-g++-4.5.1.tar.bz2
3c11b7037896e967eddf8178af2ddd98 gcc-objc-4.5.1.tar.bz2
+0f8692921c918ae6491857e5b00acc53 gcc-java-4.5.1.tar.bz2
1f86fe5dc7d506b7fc04fcd8b7d2693c gcc-4.5.1-piepatches-v0.4.5.tar.bz2
441c76504e1d97170117c294e65c7a72 gcc-4.4.3-specs-0.2.0.tar.bz2
+d7cd6a27c8801e66cbaa964a039ecfdb ecj-latest.jar
ab090760506eb70aa4436a349c6bd788 09_all_gcc-4.5-Wtrampolines.patch
1c00bd9d12891a3e2311b32b98deb6fa 15_all_gcc-libgomp-no-werror.patch
45951dd3bbc979c9e043c7203745cf31 51_all_gcc-3.4-libiberty-pic.patch
@@ -187,4 +256,5 @@ c4045bfa85d8be780affd465be9d8ca8 gcc-spec-env.patch
2db1e3482c5dd59dab70f701afa2ca80 pt_gnu_eh_frame.patch
6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch
7f35da0f88f4d9c3d3839498bbda0eb3 gcc-4.5-dynamic-linker.patch
-6c866c7fb8d56deb8f6d652bee64e228 PR32219.patch"
+6c866c7fb8d56deb8f6d652bee64e228 PR32219.patch
+2c6cb49bb9bfd8b6e690222e66ccc901 boehem-gc-uclibc.patch"
diff --git a/main/gcc/boehem-gc-uclibc.patch b/main/gcc/boehem-gc-uclibc.patch
new file mode 100644
index 0000000000..0fa6884105
--- /dev/null
+++ b/main/gcc/boehem-gc-uclibc.patch
@@ -0,0 +1,11 @@
+--- ./boehm-gc/include/gc.h.orig
++++ ./boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif