contrib/gcj/Pkgfile
2011-10-31 22:16:37 +11:00

74 lines
1.8 KiB
Plaintext

# Description: GNU Java Compiler.
# URL: http://gcc.gnu.org/
# Maintainer: Danny Rawlins, monster dot romster at gmail dot com
# Packager: Aaron Marks, nymacro at gmail dot com
# Depends on: alsa-lib gtk
name=gcj
version=4.5.3
release=1
source=(ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$version/gcc-{core,g++,java}-$version.tar.bz2
gcc-nocheck-fixincludes.patch)
build() {
patch -d gcc-$version -p 1 -i $SRC/gcc-nocheck-fixincludes.patch
mkdir build
cd build
../gcc-$version/configure \
--prefix=/usr \
--libexecdir=/usr/lib \
--enable-languages=java \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-shared \
--disable-nls \
--with-x=no \
--with-system-zlib \
--with-pkgversion="CRUX"
if [ -n "$(pkginfo -i | grep '^ccache ')" ]; then
CC="/usr/bin/ccache"
elif [ -n "$(pkginfo -i | grep '^distcc ')" ]; then
CC="/usr/bin/distcc"
fi
make \
LD_LIBRARY_PATH="/usr/lib" \
STAGE_CC_WRAPPER="$CC" \
STAGE1_CFLAGS="-g -O2"
BOOT_CFLAGS="$CFLAGS" \
GCJFLAGS="$CFLAGS" \
STAGE1_MAKEFLAGS="$MAKEFLAGS" \
STAGE2_MAKEFLAGS="$MAKEFLAGS"
make -j 1 DESTDIR=$PKG install
rm -rf \
$PKG/usr/{share,info} $PKG/usr/lib*/{libiberty.a,*-gdb.py} \
$PKG/usr/lib/nof/*-gdb.py \
$PKG/usr/bin/*-linux-gnu-* \
$PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed} \
$PKG/usr/lib/gcc/*/$version/include/README \
$PKG/usr/man/man1/{cpp,gcc,gcov,g++}.1 \
59 $PKG/usr/man/man7
# remove files already on the system out of the port
for i in $(pkginfo -l gcc |sed -e "s|^|/|"); do
if [ -e "$i" ] && [ ! -d "$i" ]; then
if [ -e "$PKG$i" ]; then
rm "$PKG$i"
fi
fi
done
# remove empty directories
find $PKG -depth -empty -delete
# remove build links from *.la files
for i in `find $PKG -name '*.la' | sed -e "s|$PKG|/|"`; do
sed -i "s|-L$SRC[^ ]* ||g" $PKG/$i
done
}