view find-alt-triple.sh @ 1168:ab186e535e72

A different fix to #218 and DMD2682 that does not lead to constant folding regressions. Fixes run/const_15, run/c/const_16_B. The price is removing the lvalueness of struct literals. If it turns out too much code depends on this behavior or we don't want to break with DMD, we could keep struct literals as lvalues and instead convert struct literals used as expression initializers into struct initializers.
author Christian Kamm <kamm incasoftware de>
date Sun, 29 Mar 2009 11:43:45 +0200
parents ca191c141cec
children
line wrap: on
line source

#!/bin/bash

HOST_TARGET=$1

[ "$HOST_TARGET" = "" ] && exit 1

REST=`echo $HOST_TARGET   | sed -e 's/[a-zA-Z0-9_]*\(\-.*\)/\1/'`
X86=`echo $HOST_TARGET    | sed -e 's/\(i[3-9]86\)\-.*/\1/'`
X86_64=`echo $HOST_TARGET | sed -e 's/\(x86_64\)\-.*/\1/'`

ALT=
if [ "$X86_64" != "$HOST_TARGET" ]; then
    ALT="i686$REST"

elif [ "$X86" != "$HOST_TARGET" ]; then
    ALT="x86_64$REST"
fi

echo $ALT