Files
ldc/bin/ldmd
Frits van Bommel 302990a0ba Remove a dead variable from ldmd.
(It used to be used to pass an extra -help to ldc when no files were
specified, but we handle that in ldc itself now)
2009-03-08 09:57:20 +01:00

36 lines
747 B
Bash
Executable File

#! /usr/bin/env bash
# Default to 'ldc' next to this file
LDC=`basename "$0"`/ldc
if [ ! -x "$LDC" ]; then
# If that doesn't work, assume this script was called via $PATH
# and do the same for ldc
if which ldc &> /dev/null; then
LDC=ldc
else
echo 'ldc not found, check your installation' >/dev/stderr
exit 1
fi
fi
declare -a ARGS
IDX=0
for arg; do
case "$arg" in
-debug|-debug=*|-version=*)
arg="-d$arg"
;;
-fPIC)
arg="-relocation-model=pic"
;;
--a|--b|--c|--f|--r|--w|--x|--y)
# "Hidden debug switches"
# Are these ever used?
arg="-hidden-debug${arg:1}"
;;
esac
ARGS[IDX++]="$arg"
done
exec "$LDC" "${ARGS[@]}"