trylink 324 B

123456789101112131415161718
  1. #!/bin/sh
  2. debug=false
  3. function try {
  4. added="$1"
  5. shift
  6. $debug && echo "Trying: $* $added"
  7. "$@" $added >/dev/null 2>&1 \
  8. && exit 0
  9. }
  10. try "" "$@"
  11. try "-lm" "$@"
  12. try "-lcrypt" "$@"
  13. try "-Wl,--start-group -lcrypt -lm -Wl,--end-group" "$@"
  14. # It failed. Rerun & let people see the error messages
  15. "$@" $added