launch.ld-tigcc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 "msys|mingw|cygwin"`
  36. iswin2=`uname -a | grep -E "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 $TIGCC/bin || exit 1
  42. iswin1=`echo $GCC4TIHOST | grep -E "msys|mingw|cygwin"`
  43. iswin2=`uname -a | grep -E "msys|mingw|cygwin"`
  44. if [ "x$iswin1" = "x" -a "x$iswin2" = "x" ]; then
  45. ${install} ld-tigcc $TIGCC/bin || exit 1
  46. ${install} ar-tigcc $TIGCC/bin || exit 1
  47. else
  48. if [ -f "ld-tigcc.exe" ]; then
  49. ${install} ld-tigcc.exe $TIGCC/bin || exit 1
  50. else
  51. ${install} ld-tigcc $TIGCC/bin/ld-tigcc.exe || exit 1
  52. fi
  53. if [ -f "ar-tigcc.exe" ]; then
  54. ${install} ar-tigcc.exe $TIGCC/bin || exit 1
  55. else
  56. ${install} ar-tigcc $TIGCC/bin/ar-tigcc.exe || exit 1
  57. fi
  58. ${install} link.dll $TIGCC/bin || exit 1
  59. fi
  60. ${make} clean
  61. cd $ORG_PWD/scripts
  62. echo Done.
  63. exit 0