CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
gcc: updated to 5.2.0
[crossrootfs.git] / gcc / Pkgfile
CommitLineData
6dca1d21
JB
1# Description: The GNU Compiler Collection
2# URL: http://gcc.gnu.org
3# Maintainer: CRUX System Team, core-ports at crux dot nu
b751b192 4# Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
747a910d 5# Depends on: zlib libmpc
6dca1d21
JB
6
7name=gcc
ecd7d154
VM
8version=5.2.0
9release=2
cd1d0db8
VM
10source=(ftp://gcc.gnu.org/pub/gcc/releases/$name-$version/$name-$version.tar.bz2
11 $name-nocheck-fixincludes.patch $name-$version-gnueabihf.patch)
6dca1d21
JB
12
13
14build() {
90f92569 15 cd $name-$version
cd1d0db8 16
ecd7d154 17# patch -p1 -i $SRC/$name-$version-gnueabihf.patch
cd1d0db8 18 patch -p1 -i $SRC/$name-nocheck-fixincludes.patch
3af34845 19 sed -i 's|REVISION|REVISION " (CRUX-ARM)"|' $name/version.c
ecd7d154 20 # apply a sed substitution that will suppress the installation of libiberty.a
90f92569 21 sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
90f92569
JB
22
23 mkdir $SRC/build
24 cd $SRC/build
25
ecd7d154 26 export CXXFLAGS="-O2 -pipe"
90f92569 27 LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
9be8a544
VM
28 ../$name-$version/configure --build=$CHOST \
29 --host=$CTARGET \
30 --target=$CTARGET \
90f92569 31 --prefix=/usr \
2d0bfa97 32 --mandir=/usr/man \
90f92569
JB
33 --libexecdir=/usr/lib \
34 --enable-languages=c,c++ \
2d0bfa97 35 --disable-libstdcxx-pch \
90f92569 36 --enable-threads=posix \
90f92569
JB
37 --enable-__cxa_atexit \
38 --enable-clocale=gnu \
2d0bfa97 39 --enable-shared \
d4c11352 40 --with-float=hard \
90f92569 41 --disable-nls \
2d0bfa97
VM
42 --with-x=no \
43 --with-system-zlib \
60f5b73f 44 --with-pkgversion="CRUX-ARM"
90f92569
JB
45
46 # prevent GCC from looking in the wrong directories for headers and libraries
47 sed "/^HOST_\(GMP\|PPL\|CLOOG\)\(LIBS\|INC\)/s:-[IL]/\(lib\|include\)::" -i Makefile
48
ecd7d154
VM
49 make
50 make -j1 DESTDIR=$PKG install
90f92569
JB
51
52 mkdir $PKG/lib
53 ln -sf ../usr/bin/cpp $PKG/lib/cpp
54 ln -sf gcc $PKG/usr/bin/cc
55 ln -sf g++ $PKG/usr/bin/c++
2d0bfa97 56
90f92569 57 mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
2d0bfa97 58
ecd7d154 59 rm $PKG/usr/lib/libstdc++.so.6.0.21-gdb.py
2d0bfa97
VM
60 rm -r $PKG/usr/share
61 rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
90f92569
JB
62
63 sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}
6dca1d21 64}