CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
binutils: updated to 2.27
[crossrootfs.git] / gcc / Pkgfile
... / ...
CommitLineData
1# Description: The GNU Compiler Collection
2# URL: http://gcc.gnu.org
3# Maintainer: CRUX System Team, core-ports at crux dot nu
4# Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
5# Depends on: zlib libmpc
6
7name=gcc
8version=5.3.0
9release=1
10source=(ftp://gcc.gnu.org/pub/gcc/releases/$name-$version/$name-$version.tar.bz2
11 $name-nocheck-fixincludes.patch $name-$version-gnueabihf.patch)
12
13
14build() {
15 cd $name-$version
16
17# patch -p1 -i $SRC/$name-$version-gnueabihf.patch
18 patch -p1 -i $SRC/$name-nocheck-fixincludes.patch
19 sed -i 's|REVISION|REVISION " (CRUX-ARM)"|' $name/version.c
20 # apply a sed substitution that will suppress the installation of libiberty.a
21 sed 's|install_to_$(INSTALL_DEST) ||' -i libiberty/Makefile.in
22
23 mkdir $SRC/build
24 cd $SRC/build
25
26 export CXXFLAGS="-O2 -pipe"
27 LDFLAGS="-Wl,-rpath-link,$CROSSTOOLS/$CTARGET/lib" \
28 ../$name-$version/configure --build=$CHOST \
29 --host=$CTARGET \
30 --target=$CTARGET \
31 --prefix=/usr \
32 --mandir=/usr/man \
33 --libexecdir=/usr/lib \
34 --enable-languages=c,c++ \
35 --disable-libstdcxx-pch \
36 --enable-threads=posix \
37 --enable-__cxa_atexit \
38 --enable-clocale=gnu \
39 --enable-shared \
40 --with-float=hard \
41 --disable-nls \
42 --with-x=no \
43 --with-system-zlib \
44 --with-pkgversion="CRUX-ARM"
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
49 make
50
51 # prevent libtool from adding host lib paths for relink at install
52 # based on patch submitted by Vincent Cadet for libtool bug #21455
53 # see https://lists.gnu.org/archive/html/bug-libtool/2015-09/msg00012.html
54 for lt_file in $(find $SRC/build/$CTARGET -name libtool) ; do
55 sed -i 's/\(add_dir=\"\)\$add_dir \(-L\$inst_prefix_dir\$libdir\"\)/\1\2/' $lt_file
56 done
57
58 make -j1 DESTDIR=$PKG install
59
60 mkdir $PKG/lib
61 ln -sf ../usr/bin/cpp $PKG/lib/cpp
62 ln -sf gcc $PKG/usr/bin/cc
63 ln -sf g++ $PKG/usr/bin/c++
64
65 mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
66
67 rm $PKG/usr/lib/libstdc++.so.6.0.21-gdb.py
68 rm -r $PKG/usr/share
69 rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
70
71 sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib/{libstdc++.la,libsupc++.la}
72}