view bin/ldmd @ 1105:cdb7e1167803

- Fixed building tango-user-ldc on x86-32. - Added CMake option for extra LLVM components to be linked in.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Thu, 12 Mar 2009 22:30:30 +0100
parents 599e3d6d0dbd
children e40c65bd8c5d
line wrap: on
line source

#! /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[@]}"