Mercurial > projects > ldc
changeset 1022:6fccb5a036e4
Added script to find the alternative triple of the host.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Sun, 01 Mar 2009 22:27:37 +0100 |
parents | d1ec9ff0e9ba |
children | ca191c141cec |
files | find-alt-triple.sh |
diffstat | 1 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/find-alt-triple.sh Sun Mar 01 22:27:37 2009 +0100 @@ -0,0 +1,19 @@ +#!/bin/sh + +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