forked from raulbalanza/OpenTom
-
Notifications
You must be signed in to change notification settings - Fork 5
/
get_cross_env.sh
70 lines (63 loc) · 2.45 KB
/
get_cross_env.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Source this file to use OpenTomSDK
export AUTOROOT="$(pwd)"
export ROOT="$AUTOROOT"
export SOURCE="$ROOT/src"
export INITRAMFS_ROOT="$ROOT/initramfs"
export ARM_ROOT=arm-sysroot
export ARM_SYSROOT="$ROOT/$ARM_ROOT"
export ARM_APPROOT="$ARM_SYSROOT/usr"
export TOMDIST="$ROOT/opentom_dist"
export DOWNLOADS="$ROOT/Downloads"
export CONFIGS="$ROOT/configs"
export PKG_CONFIG_LIBDIR=$ARM_APPROOT/lib
export PKG_CONFIG_PATH=$ARM_APPROOT/lib/pkgconfig
export DOWNLOADS=Downloads
# Choix du Cross GCC
#if [ "old" == "$1" ]; then
export TOOLCHAIN=old
echo Utilisation de gcc-3.3.4_glibc-2.3.2
export CROSS="$ROOT/gcc-3.3.4_glibc-2.3.2"
# obligatoire pour ce GCC (je pense qu'il utilise des sys-root/../../../lib_du_compilo)
export PREFIX="$CROSS/arm-linux/sys-root"
export T_ARCH=arm-linux
unset MARCH
# export CFLAGS="-mlittle-endian -march=armv4 -mtune=arm9tdmi -mshort-load-bytes -fno-omit-frame-pointer -fno-optimize-sibling-calls -mno-thumb-interwork -O2 -I$PREFIX/include -I$PREFIX/usr/include"
# export CPPFLAGS="-I$PREFIX/include -I$PREFIX/usr/include"
# export LDFLAGS="-L$PREFIX/lib -L$PREFIX/usr/lib"
export CFLAGS="-march=armv5te -mtune=arm9tdmi"
export CPPFLAGS="-march=armv5te -mtune=arm9tdmi"
unset LDFLAGS
unset CONFIG_SYSROOT
#else
# export TOOLCHAIN=new
# echo Utilisation de Sourcery_G++_Lite
# export PREFIX="$ROOT/arm-root"
# export CROSS="$ROOT/Sourcery_G++_Lite"
# #export CROSS="$ROOT/arm-2009q1"
# export T_ARCH=arm-none-linux-gnueabi
# MARCH="-march=armv4 -mtune=arm9tdmi -mlittle-endian"
# export CFLAGS="$MARCH --sysroot=$PREFIX -Wl,--sysroot=$PREFIX -O2 -I$PREFIX/include -I$PREFIX/usr/include"
# export CPPFLAGS="$MARCH -I$PREFIX/include -I$PREFIX/usr/include"
# export LDFLAGS="--sysroot=$PREFIX -L$PREFIX/lib -L$PREFIX/usr/lib"
# export CONFIG_SYSROOT=$PREFIX
#fi
export PATH=$ARM_APPROOT/bin:/usr/bin:/bin:$ROOT/tools:$CROSS/bin
export CC="${T_ARCH}-gcc"
export CXX="${T_ARCH}-g++"
export LD="${T_ARCH}-ld"
export NM="${T_ARCH}-nm -B"
export AR="${T_ARCH}-ar"
export RANLIB="${T_ARCH}-ranlib"
export STRIP="${T_ARCH}-strip"
export OBJCOPY="${T_ARCH}-objcopy"
export LN_S="/bin/ln -s"
export AS="${T_ARCH}-as"
export CROSS_COMPILE="${T_ARCH}-"
export ARCH=arm
export INSTALL_MOD_PATH=${INITRAMFS_ROOT}/usr
# Pour les progs utilisant libtool et son problème de sysroot, créer un script dans /usr/local/bin/${T_ARCH}-gcc
# qui contient
# #! /bin/bash
# exec ${CROSS}/bin/${T_ARCH}-gcc --arm-root=$PREFIX $*
#
# Changer PATH=/usr/local/bin:${CROSS}/bin:/usr/bin:/bin