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