summaryrefslogtreecommitdiff
path: root/manualPorts/gcc/Pkgfile
blob: 99535446d52def62289280b3ce145116ccfddaa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Description: The GNU Compiler Collection
# URL:         http://gcc.gnu.org
# Contributor: CRUX System Team, core-ports at crux dot nu
# Maintainer:  Erich Eckner, crux at eckner dot net
# Depends on:  zlib libmpc zstd

# You can use http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7
# to bootstrap (then you only need core/gcc installed). Run
# > find $install_dir \( -name ld -o -name -as \) -delete
# and
# export PATH="$install_dir/bin:$PATH"
# before compiling ($install_dir should be the directory into which you
# temporarily installed gnat-gpl).

name=gcc
version=10.2.0
release=1
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/$name-$version.tar.xz \
	$name-nocheck-fixincludes.patch $name-4.7.3-multilib-dirs.patch)


build() {
    patch -d $name-$version -p1 -i $SRC/$name-nocheck-fixincludes.patch
    patch -d $name-$version -p1 -i $SRC/$name-4.7.3-multilib-dirs.patch

    mkdir build
    cd build
    ../$name-$version/configure --prefix=/usr \
                                --libexecdir=/usr/lib \
                                --enable-languages=ada,c,c++,objc \
                                --enable-threads=posix \
                                --enable-__cxa_atexit \
                                --enable-clocale=gnu \
                                --enable-shared \
                                --disable-nls \
                                --with-x=no \
                                --with-system-zlib \
                                --enable-multilib \
				--enable-default-pie \
				--enable-default-ssp \
                                --with-pkgversion="CRUX-x86_64-multilib"
    make bootstrap
    make -j1 DESTDIR=$PKG install

    install -d $PKG/lib
    ln -sf ../usr/bin/cpp $PKG/lib/cpp
    ln -sf gcc $PKG/usr/bin/cc
    ln -sf g++ $PKG/usr/bin/c++

    mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
    rm -r $PKG/usr/share/{info,$name-$version} 
    rm -r $PKG/usr/bin/*-linux-gnu-*
    rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed} 

    for D in lib{,32}; do
        install -d -m 0755 $PKG/usr/share/gdb/auto-load/usr/${D}
        mv $PKG/usr/${D}/libstdc++.so.*-gdb.py $PKG/usr/share/gdb/auto-load/usr/${D}
    done

    sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib{,32}/{libstdc++.la,libsupc++.la}
}