3 archive_name
=$src_name-$version.
tar.xz
4 url0
=ftp://ftp.lip6.fr
/pub
/$src_name/releases
/$src_name-$version/$archive_name
6 .
$nyan_root/builders
/gcc-common
/fragments.sh
8 src_dir
=$src_dir_root/$src_name-$version
13 build_dir
=$builds_dir_root/$pkg_name-$target_gnu_triple
19 export PATH
=$cross_toolchain_dir_root/bin
:$PATH
21 # work around gcc fixinclude system headers location bug (only for gcc<8)
22 # see gcc-common, we don't define sysroot here because it's a native compiler.
23 # trick the fixinclude garbage
24 restore_build_system_hdrs
=no
25 if $
(readlink
-f /nyan
/glibc
/current
/include-linux
>/dev
/null
2>&1); then
26 mv -f /nyan
/glibc
/current
/include-linux
/nyan
/glibc
/current
/include-linux.BK || true
27 restore_build_system_hdrs
=yes
29 mkdir
-p /nyan
/glibc
/current
30 ln -fs $target_sysroot/nyan
/glibc
/current
/include-linux
/nyan
/glibc
/current
/include-linux
32 gcc_compilers_cross_configure
34 make -j $threads_n all-gcc
35 make install-gcc DESTDIR
=$target_sysroot
37 # restore any existing build system includes
38 if test "x$restore_build_system_hdrs" = "xyes"; then
39 mv -f /nyan
/glibc
/current
/include-linux.BK
/nyan
/glibc
/current
/include-linux || true
41 rm -f /nyan
/glibc
/current
/include-linux
43 rmdir -p /nyan
/glibc
/current || true
45 make all-target-libgcc
46 make install-target-libgcc DESTDIR
=$target_sysroot
48 make all-target-libstdc
++-v3
49 make install-target-libstdc
++-v3 DESTDIR
=$target_sysroot
52 rm -Rf $target_sysroot/nyan
/toolchains
/0/share
/info
53 rm -Rf $target_sysroot/nyan
/toolchains
/0/share
/man
54 rm -Rf $target_sysroot/nyan
/toolchains
/0/share
/gcc
*
55 rmdir -p $target_sysroot/nyan
/toolchains
/0/share || true
56 find $target_sysroot/nyan
/toolchains
/0 -type f
-name '*.la' |
xargs rm -f
57 find $target_sysroot/nyan
/toolchains
/0 -type f |
while read f
; do if file $f |
egrep 'ELF.+(shared|executable)' >/dev
/null
; then $target_gnu_triple-strip -s $f; fi; done
59 rm -Rf $build_dir $src_dir