4 archive
="$pkgname".
tar.bz2
6 make_flags
="--jobs=4 --quiet"
13 echo "======> extraction de l'archive $archive"
14 tar "$tar_flags" "$archive"
18 echo "======> creation d'une version complete de limit.h"
19 cat gcc
/limitx.h gcc
/glimits.h gcc
/limity.h
> \
20 `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/include-fixed
/limits.h
22 echo "======> ajout de -fomit-frame-pointer pour la compilation"
23 cp gcc
/Makefile.
in{,.tmp
}
24 sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc
/Makefile.
in.tmp \
27 echo "======> extraction de l'archive mpfr-3.1.1.tar.xz"
28 tar -Jxf ..
/mpfr-3.1
.1.
tar.xz
30 echo "======> extraction de l'archive gmp-5.1.1.tar.xz"
31 tar -Jxf ..
/gmp-5.1
.1.
tar.xz
33 echo "======> extraction de l'archive mpc-1.0.1.tar.gz"
34 tar -zxf ..
/mpc-1.0
.1.
tar.gz
37 echo "======> changement du dynamic linker"
39 $
(find gcc
/config
-name linux64.h
-o -name linux.h
-o -name sysv4.h
)
42 sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
43 -e 's@/usr@/tools@g' $file.orig
> $file
45 #undef STANDARD_STARTFILE_PREFIX_1
46 #undef STANDARD_STARTFILE_PREFIX_2
47 #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
48 #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
52 echo "======> desactivation de la compilation des fichiers .info"
53 sed -i 's/BUILD_INFO=info/BUILD_INFO=/' gcc
/configure
57 mkdir
-v "$pkgname"-build
60 echo "======> execution du script de configuration"
63 RANLIB
=$LFS_TGT-ranlib \
64 ..
/"$pkgname"/configure
--quiet \
66 --with-local-prefix=/tools \
67 --with-native-system-header-dir=/tools
/include \
68 --enable-clocale=gnu \
70 --enable-threads=posix \
71 --enable-__cxa_atexit \
72 --enable-languages=c
,c
++ \
73 --disable-libstdcxx-pch \
77 --with-mpfr-include=$
(pwd)/..
/$pkgname/mpfr
/src \
78 --with-mpfr-lib=$
(pwd)/mpfr
/src
/.libs
80 echo "======> compilation de $pkgname"
83 echo "======> installation de $pkgname"
86 echo "======> creation d'un lien symbolique cc -> gcc"
87 ln -s gcc
/tools
/bin
/cc
89 echo "======> verification de la toolchain"
90 echo 'main(){}' > dummy.c
92 readelf
-l a.out |
grep ': /tools'
94 echo "======> supression du repertoire" "$pkgname"-build
96 rm -rf "$pkgname"-build
98 echo "======> supression du rÃpertoire $pkgname"
101 echo "======> compilation et installation de $pkgname reussi"