CRUX-ARM : Home

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