launch.ld-tigcc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #! /bin/sh
  2. #
  3. # Compile and install the GCC4TI linker
  4. #
  5. isbsd=`uname -a | grep "BSD"`
  6. isos=`uname -a | grep "opensolaris"`
  7. if [ "x$isbsd" = "x" -a "x$isos" = "x" ]; then
  8. #Assume GNU make
  9. make=make
  10. else
  11. make=gmake
  12. fi
  13. if [ "x$isos" = "x" ]; then
  14. #Assume GNU or BSD install
  15. install=install
  16. else
  17. install=ginstall
  18. fi
  19. echo Installing GCC4TI linker...
  20. ORG_PWD=$PWD/..
  21. cd "$ORG_PWD/sources/ld-tigcc"
  22. # OS X requires a switch to enable nested functions. ld-tigcc doesn't actually
  23. # require an executable stack, but Apple's compiler is not clever enough to
  24. # make the distinction.
  25. if [ -z "$CC" ]
  26. then CC="gcc"
  27. fi
  28. if [ -z "$CFLAGS" ]
  29. then CFLAGS="-Os -s -fno-exceptions"
  30. fi
  31. if $CC -v --help 2>/dev/null | grep fnested-functions >/dev/null
  32. then export CFLAGS="$CFLAGS -fnested-functions"
  33. fi
  34. linkdll=
  35. iswin1=`echo $GCC4TIHOST | grep -E -i "msys|mingw|cygwin"`
  36. iswin2=`uname -a | grep -E -i "msys|mingw|cygwin"`
  37. if [ "x$iswin1" != "x" -o "x$iswin2" != "x" ]; then
  38. linkdll="link.dll"
  39. fi
  40. ${make} -e all ${linkdll} || exit 1
  41. ${install} -d "$PREFIX_GCC4TI/bin" || exit 1
  42. if [ "x$iswin1" = "x" -a "x$iswin2" = "x" ]; then
  43. ${install} ld-tigcc "$PREFIX_GCC4TI/bin" || exit 1
  44. ${install} ar-tigcc "$PREFIX_GCC4TI/bin" || exit 1
  45. else
  46. if [ -f "ld-tigcc.exe" ]; then
  47. ${install} ld-tigcc.exe "$PREFIX_GCC4TI/bin" || exit 1
  48. else
  49. ${install} ld-tigcc "$PREFIX_GCC4TI/bin/ld-tigcc.exe" || exit 1
  50. fi
  51. if [ -f "ar-tigcc.exe" ]; then
  52. ${install} ar-tigcc.exe "$PREFIX_GCC4TI/bin" || exit 1
  53. else
  54. ${install} ar-tigcc "$PREFIX_GCC4TI/bin/ar-tigcc.exe" || exit 1
  55. fi
  56. ${install} link.dll "$PREFIX_GCC4TI/bin" || exit 1
  57. fi
  58. ${make} clean
  59. cd "$ORG_PWD/scripts"
  60. echo Done.
  61. exit 0