comparison bin/ldmd2 @ 1453:f35a9a77d256

More tweaks.
author Robert Clipsham <robert@octarineparrot.com>
date Mon, 01 Jun 2009 18:58:21 +0100
parents
children 593f99fddd2f
comparison
equal deleted inserted replaced
1452:638d16625da2 1453:f35a9a77d256
1 #! /usr/bin/env bash
2
3 # Default to 'ldc' next to this file
4 LDC=`basename "$0"`/ldc2
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 ldc2 &> /dev/null; then
9 LDC=ldc2
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[@]}"