Advertisement
Guest User

Untitled

a guest
Jul 14th, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.96 KB | None | 0 0
  1. #! /usr/bin/env bash
  2.  
  3. # Default to 'ldc' next to this file
  4. LDC=`dirname "$0"`/ldc
  5. if [ ! -x "$LDC" ]; then
  6.     # If that doesn't work, assume this script was called via $PATH
  7.     # and do the same for ldc
  8.     if which ldc &> /dev/null; then
  9.         LDC=ldc
  10.     else
  11.         echo 'ldc not found, check your installation' >/dev/stderr
  12.         exit 1
  13.     fi
  14. fi
  15.  
  16. declare -a ARGS
  17. IDX=0
  18. for arg; do
  19.     case "$arg" in
  20.     -C*)
  21.         # turn -Cfoo into -foo.
  22.         # Useful for passing -inline to ldc, for instance.
  23.         arg="-${arg:2}"
  24.         ;;
  25.     -debug|-debug=*|-version=*)
  26.         arg="-d$arg"
  27.         ;;
  28.     -inline)
  29.         arg="-enable-inlining"
  30.         ;;
  31.     -fPIC)
  32.         arg="-relocation-model=pic"
  33.         ;;
  34.     --a|--b|--c|--f|--r|--w|--x|--y)
  35.         # "Hidden debug switches"
  36.         # Are these ever used?
  37.         arg="-hidden-debug${arg:1}"
  38.         ;;
  39.     esac
  40.     ARGS[IDX++]="$arg"
  41. done
  42.  
  43. exec "$LDC" "${ARGS[@]}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement