derle.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. mv -v ../mpfr-* mpfr
  2. mv -v ../gmp-* gmp
  3. mv -v ../mpc-* mpc
  4. for file in gcc/config/{linux,i386/linux{,64}}.h
  5. do
  6. cp -uv $file{,.orig}
  7. sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
  8. -e 's@/usr@/tools@g' $file.orig > $file
  9. echo '
  10. #undef STANDARD_STARTFILE_PREFIX_1
  11. #undef STANDARD_STARTFILE_PREFIX_2
  12. #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
  13. #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
  14. touch $file.orig
  15. done
  16. case $(uname -m) in
  17. x86_64)
  18. sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
  19. ;;
  20. esac
  21. mkdir -v build
  22. cd build
  23. ../configure \
  24. --target=$ONSISTEM_TARGET \
  25. --prefix=/tools \
  26. --with-glibc-version=2.11 \
  27. --with-sysroot=$ONSISTEM_CHROOT \
  28. --with-newlib \
  29. --without-headers \
  30. --with-local-prefix=/tools \
  31. --with-native-system-header-dir=/tools/include \
  32. --disable-nls \
  33. --disable-shared \
  34. --disable-multilib \
  35. --disable-decimal-float \
  36. --disable-threads \
  37. --disable-libatomic \
  38. --disable-libgomp \
  39. --disable-libmpx \
  40. --disable-libquadmath \
  41. --disable-libssp \
  42. --disable-libvtv \
  43. --disable-libstdcxx \
  44. --enable-languages=c,c++
  45. make