]> rtime.felk.cvut.cz Git - arc.git/blob - scripts/guess_cc.sh
Merge with e3d24894e6cb082a255328755604b04b0542b39e
[arc.git] / scripts / guess_cc.sh
1 #/bin/bash
2 #
3 # Tries to get a compiler depending on SHELL/OS. On Windows it defaults
4 # to CodeSourcery installed at c:\devtools\Codesourcery\<arch>
5 #
6
7 UNAME=`uname`
8 echo $UNAME
9 echo $1
10
11 if [ "$ARCH" == "PPC" ]; then
12         if test x${UNAME:0:7} = xMINGW32; then
13           COMPILER=/c/devtools/Codesourcery/freescale-4.3/bin/powerpc-eabi-
14         elif test x${UNAME:0:9} = xCYGWIN_NT; then
15           COMPILER=/cygdrive/c/devtools/Codesourcery/freescale-4.3/bin/powerpc-eabi-
16         elif test x${UNAME:0:5} = xDarwin; then
17           COMPILER=/opt/powerpc-eabi/bin/powerpc-eabi-
18         else
19           echo No default path for $UNAME set. Quitting.
20         fi
21 elif [ "$ARCH" == "ARM" ]; then
22         if test x${UNAME:0:7} = xMINGW32; then
23           COMPILER=/c/devtools/Codesourcery/arm-2009q1/bin/arm-none-eabi-
24         elif test x${UNAME:0:9} = xCYGWIN_NT; then
25           COMPILER=/cygdrive/c/devtools/Codesourcery/arm-2009q1/bin/arm-none-eabi-
26         elif test x${UNAME:0:5} = xDarwin; then
27           COMPILER=/opt/arm-elf/bin/arm-none-eabi-
28         else
29           echo No default path for $UNAME set. Quitting.
30         fi
31 elif [ "$ARCH" == "HCS12" ]; then
32         COMPILER=/opt/m6812-elf/bin/m6812-elf-
33 else
34         echo baaaad
35 fi
36
37 if [ -f ${COMPILER}gcc ]; then
38   echo Using compiler: ${COMPILER}
39 else
40    echo ${COMPILER} does not exist...
41    exit 1
42 fi
43
44 export CROSS_COMPILE=$COMPILER
45