Mercurial > projects > ldc
comparison find-alt-triple.sh @ 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 | |
children | ca191c141cec |
comparison
equal
deleted
inserted
replaced
1021:d1ec9ff0e9ba | 1022:6fccb5a036e4 |
---|---|
1 #!/bin/sh | |
2 | |
3 HOST_TARGET=$1 | |
4 | |
5 [ "$HOST_TARGET" == "" ] && exit 1 | |
6 | |
7 REST=`echo $HOST_TARGET | sed -e 's/[a-zA-Z0-9_]*\(\-.*\)/\1/'` | |
8 X86=`echo $HOST_TARGET | sed -e 's/\(i[3-9]86\)\-.*/\1/'` | |
9 X86_64=`echo $HOST_TARGET | sed -e 's/\(x86_64\)\-.*/\1/'` | |
10 | |
11 ALT= | |
12 if [ "$X86_64" != "$HOST_TARGET" ]; then | |
13 ALT="i686$REST" | |
14 | |
15 elif [ "$X86" != "$HOST_TARGET" ]; then | |
16 ALT="x86_64$REST" | |
17 fi | |
18 | |
19 echo $ALT |