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