CRUX-ARM : Home

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