derle.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. cd gcc-$surum
  2. mv -v ../mpfr-* mpfr
  3. mv -v ../gmp-* gmp
  4. mv -v ../mpc-* mpc
  5. cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
  6. `dirname $($ONSISTEM_TARGET-gcc -print-libgcc-file-name)`/include-fixed/limits.h
  7. for file in gcc/config/{linux,i386/linux{,64}}.h
  8. do
  9. cp -uv $file{,.orig}
  10. sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
  11. -e 's@/usr@/tools@g' $file.orig > $file
  12. echo '
  13. #undef STANDARD_STARTFILE_PREFIX_1
  14. #undef STANDARD_STARTFILE_PREFIX_2
  15. #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
  16. #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
  17. touch $file.orig
  18. done
  19. case $(uname -m) in
  20. x86_64)
  21. sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
  22. ;;
  23. esac
  24. mkdir -v build
  25. cd build
  26. CC=$ONSISTEM_TARGET-gcc \
  27. CXX=$ONSISTEM_TARGET-g++ \
  28. AR=$ONSISTEM_TARGET-ar \
  29. RANLIB=$ONSISTEM_TARGET-ranlib \
  30. ../configure \
  31. --prefix=/tools \
  32. --with-local-prefix=/tools \
  33. --with-native-system-header-dir=/tools/include \
  34. --enable-languages=c,c++ \
  35. --disable-libstdcxx-pch \
  36. --disable-multilib \
  37. --disable-bootstrap \
  38. --disable-libgomp
  39. make