launch.gcc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #! /bin/sh
  2. #
  3. # This script launches configure with the right arguments
  4. # The tree must have been patched before doing this.
  5. #
  6. isbsd=`uname -a | grep "BSD"`
  7. isos=`uname -a | grep "opensolaris"`
  8. if [ "x$isbsd" = "x" -a "x$isos" = "x" ]; then
  9. #Assume GNU make
  10. make=make
  11. else
  12. make=gmake
  13. fi
  14. if [ "x$isos" = "x" ]; then
  15. #Assume GNU or BSD install
  16. install=install
  17. else
  18. install=ginstall
  19. fi
  20. echo GCC4TI script: Configuring, compiling and installing gcc...
  21. CFLAGS_FOR_BUILD="$CFLAGS"
  22. export CFLAGS_FOR_BUILD
  23. CC_FOR_BUILD="$CC"
  24. export CC_FOR_BUILD
  25. ORG_PWD=$PWD/..
  26. mkdir "$ORG_PWD/build"; cd "$ORG_PWD/build"; mkdir gcc; cd gcc
  27. if [ "x$GCC4TIHOST" = "x" ]; then
  28. ../../download/gcc.ti/configure "--prefix=$PREFIX_GCC4TI" --target=m68k-coff --with-gnu-as --disable-nls --disable-multilib --disable-shared --enable-static --disable-threads --disable-win32-registry --disable-checking --disable-werror --disable-pch --disable-mudflap --disable-libssp
  29. else
  30. echo Compiling GCC4TI gcc on custom host $GCC4TIHOST
  31. ../../download/gcc.ti/configure "--prefix=$PREFIX_GCC4TI" --target=m68k-coff --with-gnu-as --disable-nls --disable-multilib --disable-shared --enable-static --disable-threads --disable-win32-registry --disable-checking --disable-werror --disable-pch --disable-mudflap --disable-libssp --host=$GCC4TIHOST
  32. fi
  33. if [ $? -ne 0 ]; then
  34. echo "GCC4TI script: Error while configuring GCC"
  35. exit 1
  36. fi
  37. #GCC 4.0 is very annoying because of its habit to configure subdirectories only during make.
  38. #This keeps us from patching the generated makefile in advance.
  39. #So we have to call make 3 times to get it to work with our removed directories.
  40. CC=$CC ${make}
  41. echo You should have seen an error. This is normal. GCC4TI installation continues.
  42. # Create dummy libiberty testsuite makefile
  43. rm -f libiberty/testsuite/Makefile
  44. echo all: >libiberty/testsuite/Makefile
  45. ${make}
  46. echo You should have seen an error. This is normal. GCC4TI installation continues.
  47. # Create dummy build-libiberty testsuite makefile
  48. rm -f `ls -d build-*`/libiberty/testsuite/Makefile
  49. echo all: >`ls -d build-*`/libiberty/testsuite/Makefile
  50. ${make}
  51. echo You should have seen an error. This is normal. GCC4TI installation continues.
  52. # Finish gcc installation
  53. ${install} -d "$PREFIX_GCC4TI/bin/" || exit 1
  54. iswin1=`echo $GCC4TIHOST | grep -E -i "msys|mingw|cygwin"`
  55. iswin2=`uname -a | grep -E -i "msys|mingw|cygwin"`
  56. if [ "x$iswin1" = "x" -a "x$iswin2" = "x" ]; then
  57. ${install} gcc/cc1 "$PREFIX_GCC4TI/bin/" || exit 1
  58. ${install} gcc/xgcc "$PREFIX_GCC4TI/bin/gcc" || exit 1
  59. else
  60. ${install} gcc/cc1.exe "$PREFIX_GCC4TI/bin/" || exit 1
  61. ${install} gcc/xgcc.exe "$PREFIX_GCC4TI/bin/gcc.exe" || exit 1
  62. fi
  63. cd "$ORG_PWD/scripts"
  64. echo Done.
  65. exit 0