talimat 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. version=5.3.0
  2. source=(\
  3. http://ftp.gnu.org/gnu/gmp/gmp-6.1.0.tar.xz \
  4. http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.xz \
  5. http://www.multiprecision.org/mpc/download/mpc-1.0.3.tar.gz \
  6. ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/gcc-$version.tar.bz2)
  7. derle()
  8. {
  9. cd gcc-$version
  10. mv ../mpfr-3.1.3 mpfr
  11. mv ../gmp-6.1.0 gmp
  12. mv ../mpc-1.0.3 mpc
  13. for file in \
  14. $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
  15. do
  16. cp -uv $file{,.orig}
  17. sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
  18. -e 's@/usr@/tools@g' $file.orig > $file
  19. echo '
  20. #undef STANDARD_STARTFILE_PREFIX_1
  21. #undef STANDARD_STARTFILE_PREFIX_2
  22. #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
  23. #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
  24. touch $file.orig
  25. done
  26. mkdir -v build
  27. cd build
  28. ../configure \
  29. --target=$LFS_TGT \
  30. --prefix=/tools \
  31. --with-glibc-version=2.11 \
  32. --with-sysroot=$LFS \
  33. --with-newlib \
  34. --without-headers \
  35. --with-local-prefix=/tools \
  36. --with-native-system-header-dir=/tools/include \
  37. --disable-nls \
  38. --disable-shared \
  39. --disable-multilib \
  40. --disable-decimal-float \
  41. --disable-threads \
  42. --disable-libatomic \
  43. --disable-libgomp \
  44. --disable-libquadmath \
  45. --disable-libssp \
  46. --disable-libvtv \
  47. --disable-libstdcxx \
  48. --enable-languages=c,c++
  49. make
  50. make install
  51. }