Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2012 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2936885 to your computer and use it in GitHub Desktop.
Save anonymous/2936885 to your computer and use it in GitHub Desktop.
Pkgfile
# Description: The GNU Compiler Collection
# URL: http://gcc.gnu.org
# Maintainer: CRUX System Team, core-ports at crux dot nu
# Depends on: zlib libmpc
name=gcc
version=4.6.2
release=1
source=(http://ftp.gnu.org/gnu/gcc/$name-$version/$name-{core,g++,objc}-$version.tar.bz2
$name-nocheck-fixincludes.patch)
build() {
patch -d $name-$version -p1 -i $SRC/$name-nocheck-fixincludes.patch
mkdir build
cd build
../$name-$version/configure --prefix=/usr \
--mandir=/usr/man \
--libexecdir=/usr/lib \
--enable-languages=c,c++,objc \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-shared \
--enable-lto \
--enable-plugin \
--enable-gold \
--enable-ld=default \
--enable-linker-build-id \
--disable-multilib \
--disable-libssp \
--disable-libstdcxx-pch \
--with-plugin-ld=ld.gold \
--with-ppl \
--enable-cloog-backend=isl \
--with-cloog-include=/usr/include/cloog \
--disable-nls \
--with-x=no \
--with-system-zlib \
--with-pkgversion="CRUX"
make bootstrap
make -j1 DESTDIR=$PKG install
mkdir $PKG/lib
ln -sf ../usr/bin/cpp $PKG/lib/cpp
ln -sf gcc $PKG/usr/bin/cc
ln -sf g++ $PKG/usr/bin/c++
mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
rm $PKG/usr/lib/{libiberty.a,libstdc++.so.6.0.14-gdb.py}
rm -r $PKG/usr/share
rm -r $PKG/usr/bin/*-linux-gnu-*
rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment