launch.ld-tigcc 700 B

12345678910111213141516171819202122232425262728293031323334
  1. #! /bin/sh
  2. #
  3. # Compile and install the TIGCC linker
  4. #
  5. isbsd=`uname | grep "BSD"`
  6. if [ "$isbsd" = "" ]; then
  7. #Assume GNU make
  8. make=make
  9. else
  10. make=gmake
  11. fi
  12. echo Installing TIGCC linker...
  13. cd ../sources/ld-tigcc
  14. # OS X requires a switch to enable nested functions. ld-tigcc doesn't actually
  15. # require an executable stack, but Apple's compiler is not clever enough to
  16. # make the distinction.
  17. if [ -z "$CC" ]
  18. then CC="gcc"
  19. fi
  20. if [ -z "$CFLAGS" ]
  21. then CFLAGS="-Os -s -fno-exceptions"
  22. fi
  23. if $CC -v --help 2>/dev/null | grep fnested-functions >/dev/null
  24. then export CFLAGS="$CFLAGS -fnested-functions"
  25. fi
  26. ${make} -e
  27. cp ld-tigcc $TIGCC/bin
  28. cp ar-tigcc $TIGCC/bin
  29. ${make} clean
  30. echo Done.