Anunţ

Caută printre mesajele de pe forum înainte de a scrie unul nou!
Formulează corect întrebarea sau problema pe care o ai.
Respectă regulile forumului și Codul de Conduită!

#1 23 Nov 2018 09:00:18

Tehmatix
Membru nou
Înregistrat: 23 Nov 2018
Mesaje: 1

ToolChain

Salut,
Sunt invatacel in linux. Folosesc Ubuntu 14.04.3 LTS. Ma poate ajuta cineva cu ceva sfaturi la o compilare
Readme.txt

Cod:

+ How to compile toolchain
1.Installation Procedures
 - An installation shell script is provided
  - Due to MTK Build has set the abstract path for toolchain, the wrong path would cause build fail;
  - INSTALL_PATH must be
   - /mtkoss/gnuarm
  - chmod +x install-shell
  - source ./install-shell [TOOLCHAIN_TAR_NAME] [INSTALL_PATH]
  - Example usage
   - source ./install-shell /share/toolchains/gnuarm_4.5.1.20110725.tgz /mtkoss/gnuarm
2.Check Installation Results
 - Check Installation Folder
  - List target installation folder contents
   - E.g. ls /mtkoss/gnuarm
    - soft_4.5.1_2.6.27_arm11-rhel4
 - Check by Getting GCC Version Successfully
 - GCC execution file is located at /mtkoss/gnuarm /soft_4.5.1_2.6.27_arm11-rhel4/i686/bin
 - Check the GCC file name
  - ls / mtkoss/gnuarm/soft_4.5.1_2.6.27_arm11-rhel4/i686/bin/*gcc
 - Run GCC to check its version
  - armv6z-mediatek451_001_soft-linux-gnueabi-gcc --version
3.Compile Option Necessary
  - User Space Application :
   - CC_FLAG += -march=armv7-a -mtune=cortex-a9
   - VFP CA9 Version:
    - CC_FLAG += -mfloat-abi=softfp -mfpu=vfpv3-d16 -fPIC
  - Kernel:
   - CC_FLAG += -fno-unwind-tables
  - uboot/bootloader:
   - CC_FLAG += -fno-unwind-tables
   - CC_FLAG += -march=armv7-a -mtune=cortex-a9
   - ASM_FLAG += -march=armv7-a -mtune=cortex-a9
4.Compile Option Conclusion
 - For third_party application library generation, please follow
  - None_vfp version:
   - CC_FLAG += -g
  - Vfp version:
   - CC_FLAG += -g -mfloat-abi=softfp -mfpu=vfp
  - CA9 version:
   - CC_FLAG += -g -mfloat-abi=softfp -mfpu=vfpv3-d16 -fPIC
   - The Following is optional
    - CC_FLAG += -march=armv7-a -mtune=cortex-a9

toolchian export path
  export PATH="/mtkoss/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686/bin:$PATH";

(GPL 2.0)gdb

1. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
2. export CC=${CROSS_COMPILE}gcc
3. tar -jxvf gdb-6.6.tar.bz2
4. patch -N -p1 -d gdb-6.6 < gdb-6.6-patch/gdb-6.6-thread_db_use_events_mtk.patch
5. cd gdb-6.6/gdb/gdbserver/
6. ./configure --prefix=$PWD/install_dir --host=armv7a-mediatek451_001_vfp-linux-gnueabi
7. make
80. make install

(GPL 2.0)grep

1. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
2. export CC=${CROSS_COMPILE}gcc
3. tar -jxvf grep-2.5.1a.tar.bz2
4. cd grep-2.5.1a/
5. ./configure --prefix=$PWD/install_dir --host=armv7a-mediatek451_001_vfp-linux-gnueabi
6. make
7. make install

(GPL 2.0)gzip

1. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
2. export CC=${CROSS_COMPILE}gcc
3. tar -zxvf gzip-1.3.12.tar.gz
4. patch -N -p1 -d gzip-1.3.12 < gzip-1.3.12-futimens.patch  
5. cd gzip-1.3.12/
6. ./configure --prefix=$PWD/install_dir --host=armv7a-mediatek451_001_vfp-linux-gnueabi
7. make
8. make install

(GPL 2.0)inetutils

1. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
2. export CC=${CROSS_COMPILE}gcc
3. tar -zxvf inetutils-1.4.2.tar.gz
4. add  "#define NULL (0)" in  "inetutils-1.4.2/libicmp/icmp_timestamp.c" begin
5. patch -N -p1 -d inetutils-1.4.2 < inetutils-1.4.2-gcc4_fixes-1.patch
6. cd inetutils-1.4.2/
7. ./configure --prefix=$PWD/install_dir --host=armv7a-mediatek451_001_vfp-linux-gnueabi
8. make
9. make install

(GPL 2.0)iproute2

2. export CC=armv7a-mediatek451_001_vfp-linux-gnueabi-gcc
3. tar -zxv -f db-4.8.30.tar.gz
4. cd db-4.8.30/build_unix
5. ../dist/configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=/usr/local --enable-compat185 && make
6. cd ../../
7. tar xvf iproute2-2.6.38.tar.bz2
8. patch -N -p1 -d iproute2-2.6.38 < iproute2-2.6.38_mtk.patch
9. cd iproute2-2.6.38 && make

(GPL 2.0)libnl

1. export CC=armv7a-mediatek451_001_vfp-linux-gnueabi-gcc
2. ./configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=$PWD/install_dir
3. make
4. make install

(GPL 2.0)dibbler

1. tar -zxv -f dibbler-0.8.0-src.tar.gz
2. patch -N -p1 -d dibbler-0.8.0 < dibbler-0.8.0-src_mtk.patch
3. cd dibbler-0.8.0 
4. ./poslib/configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi
5. CC=armv7a-mediatek451_001_vfp-linux-gnueabi-gcc CXX=armv7a-mediatek451_001_vfp-linux-gnueabi-g++ AR=armv7a-mediatek451_001_vfp-linux-gnueabi-ar CHOST=armv7a-mediatek451_001_vfp-linux-gnueabi && make client

(GPL 2.0)/sysvinit-2.88.tar.bz2

1. tar xvfj sysvinit-2.88.tar.bz2
2. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
3. export CC=${CROSS_COMPILE}gcc
4. cd sysvinit-2.88
5. make
6. make install ROOT=$PWD/install_dir

(GPL 2.0) bash-3.2.48.tar.gz

1. tar xvzf bash-3.2.48.tar.gz
2. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
3. export CC=${CROSS_COMPILE}gcc
4. cd bash-3.2.48
5. ./configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=$PWD/install_dir 
6. make
7. make install

(GPL 2.0) coreutils-6.9.tar.bz2

1. tar xvjf coreutils-6.9.tar.bz2
2. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
3. export CC=${CROSS_COMPILE}gcc
4. cd coreutils-6.9
5. ./configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=$PWD/install_dir 
6. make
7. make install

(GPL 2.0) findutils-4.2.31.tar.gz

1. tar xvzf findutils-4.2.31.tar.gz
2. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
3. export CC=${CROSS_COMPILE}gcc
4. cd findutils-4.2.31
5. ./configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=$PWD/install_dir 
6. make
7. make install

(GPL 2.0) gawk-3.1.5.tar.gz

1. tar xvzf gawk-3.1.5.tar.gz
2. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
3. export CC=${CROSS_COMPILE}gcc
4. cd gawk-3.1.5
5. ./configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=$PWD/install_dir 
6. make
7. make install

(LGPL 2.02.1) libmtp-0.3.6

1. tar xvfz libusb-1.0.2.tar.gz
3. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
4. cd source/mtp/mtp-0.3.6/
5. sh build_7a.sh
6. cd ../../../../library/mtp/mtp-0.3.6/install/
7. you can see library under the "install forlder"


(GPL 2.0) wifi_tools.tgz

1. tar xvzf wifi_tools.tgz
2. Modify Makefile below
   [Makefile]
     6 ## Distributions should probably use /, but they probably know better...
     7 ifndef PREFIX
     8   PREFIX = /usr/local
     9 endif
    10
    11 ## Compiler to use (modify this for cross compile).
    12 CC = /mtkoss/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686/bin/armv7a-mediatek451_001_vfp-linux-gnueabi-gcc
    13 ## Other tools you need to modify for cross compile (static lib only).
    14 AR = /mtkoss/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686/bin/armv7a-mediatek451_001_vfp-linux-gnueabi-ar
    15 RANLIB = /mtkoss/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686/bin/armv7a-mediatek451_001_vfp-linux-gnueabi-ranlib
    16
3. make
4. you can see libiw.so.29

(LGPL2.02.1) glibc-2.12.2.tar.bz2

1. tar xvjf glibc-2.12.2.tar.bz2
2. cd glibc
3. Modify Makefile like below
   [Makefile_8560]
     Set Toolchain Path
    7
    8 ifndef TOOL_CHAIN_BIN_PATH
    9 TOOL_CHAIN_BIN_PATH = /mtkoss/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686/bin
    10 endif
    12
      Set Kernel Path
    29 ifndef KERNEL_ROOT
    30 #KERNEL_ROOT=/proj/mtk94009/wkspace/debug/BDP/Dev/BDP_V301/BDP_Linux/linux-2.6.35
    31 KERNEL_ROOT=$(GLIBC_ROOT)/../../../BDP_Linux/linux-2.6.35
    32 endif
 
4. make -f Makefile_8568
5. Output will locate sysroot folder in the path

(GPL 2.0) iputils-install.tar.bz2

1. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
2. export CC=${CROSS_COMPILE}gcc
3, tar -jxvf iputils-install.tar.bz2
4, cd iputils-s20101006
5, armv7a-mediatek451_001_vfp-linux-gnueabi-gcc -o arping arping.c   // for both 8560&8580

(GPL 2.0) module-init-tools-3.12.tar.bz2
1. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
2. export CC=${CROSS_COMPILE}gcc
3. tar -jxvf module-init-tools-3.12.tar.bz2
4. cd module-init-tools-3.12
5. ./configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=$PWD/install_dir
6. make && make install

(GPL 2.0) udhcp_0.9.8-install.tar.bz2

1. tar -jxvf udhcp_0.9.8-install.tar.bz2
2. cd udhcp
3. make
(if you want to change toolchain, plz open the Makefile and change CROSS_COMPILE)

(GPL 2.0) net-tools-1.60.tar.gz

1. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
2. export CC=${CROSS_COMPILE}gcc
3. tar xvf net-tools-1.60.tar.gz
4. cd net-tools-1.60
5. make
Output what LG used are ifconfig, hostname and route.

(LGPL2.02.1) libdaemon-0.14.tar.b2

1. tar -jxvf libdaemon-0.14.tar.bz2
2. chmod -R 777 libdaemon-0.14
3. cd libdaemon-0.14
4. rm config.cache & export CC=armv7a-mediatek451_001_vfp-linux-gnueabi-gcc && ./configure --prefix=$PWD/install_dir --host=armv7a-mediatek451_001_vfp-linux-gnueabi --disable-option-checking --cache-file=config.cache ac_cv_func_setpgrp_void=yes && make
5. make install
Output will be located iun install_dir in current folder

(GPL 2.0)sed-4.1.5.tar.gz

1. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
2. export CC=${CROSS_COMPILE}gcc
3. tar xzvf sed-4.1.5.tar.gz
4. cd sed-4.1.5
5. ./configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=$PWD/install_dir
6. make && make install
output will be located in install_dir in current folder


(GPL 2.0) msdl-1.1.tar.gz

2. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
3. tar xvf msdl-1.1-install.tar.bz2
4. ./build_a9.sh

(GPL 2.0) mtd-utils
 1. (GPL) zlib-1.2.3
    1. cd source/zlib
    2. tar xvfz zlib-1.2.3.tar.gz
    3. cd zlib-1.2.3/
    4. mkdir out
    5. CC=/mtkoss/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686/bin/armv7a-mediatek451_001_vfp-linux-gnueabi-gcc ./configure --shared --prefix=$PWD/out && make && make install

 2.(GPL)lzo-2.06
    1. cd source/lzo/
    2. tar xvfz lzo-2.06.tar.gz
    3. cd lzo-2.06/
    4. mkdir out
    5. CC=/mtkoss/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686/bin/armv7a-mediatek451_001_vfp-linux-gnueabi-gcc ./configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=$PWD/out && make && make install
 3.(GPL) mtd-utils
     1. cd mtd-utils/
     2. tar xvf mtd-utils-1.2.0.tar.gz
     3. cd mtd-utils-1.2.0/     
     4. Modify makefile, add:
       CPPFLAGS += -I/........./oss/source/lzo/lzo-2.06/out/include
       CPPFLAGS += -I/........./oss/source/zlib/zlib-1.2.3/out/include
       LDFLAGS += -L/........../oss/source/lzo/lzo-2.06/out/lib
       LDFLAGS += -L/........../oss/source/zlib/zlib-1.2.3/out/lib
        >>please change above bold letter path according to your setting
    5. make CROSS=/mtkoss/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686/bin/armv7a-mediatek451_001_vfp-linux-gnueabi- BUILDDIR=/home/kyungmuc.choi/AOT/oss/source/mtd-utils/mtd-utils-1.2.0 DESTDIR=/home/kyungmuc.choi/AOT/oss/source/mtd-utils/mtd-utils-1.2.0/out WITHOUT_XATTR=1        
       make install BUILDDIR=/home/kyungmuc.choi/AOT/oss/source/mtd-utils/mtd-utils-1.2.0 DESTDIR=/home/kyungmuc.choi/AOT/oss/source/mtd-utils/mtd-utils-1.2.0/out    
        >>please change toolchain path above according to where your toolchain v451 installed 
        >>please change BUILDDIR/DESTDIR above according to your setting

(GPL 2.0) tar-1.17.tar.gz

1. tar -zxvf tar-1.17_patch.tar.gz
2. tar xvfz tar-1.17.tar.gz
3. cp -rf tar-1.17_patch/*  ./tar-1.17/
5. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
6. export CC=${CROSS_COMPILE}gcc
7. ./tar-1.17/configure --host=armv7a-mediatek451_001_vfp-linux-gnueabi --prefix=$PWD/install_dir 
8. make
9. make install

(GPL2.0) procps-3.2.8.tar.gz
Dependency 
ncurses-5.7

1. tar xzvf procps-3.2.8.tar.gz
2. cd procps-3.2.8
3. export CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-
4. export  CC="${CROSS_COMPILE}gcc"
5. export  CXX="${CROSS_COMPILE}g++"
6. export  AR="${CROSS_COMPILE}ar"
7. export  RANLIB="${CROSS_COMPILE}ranlib"
8. export  LD="${CROSS_COMPILE}ld"
9. export  STRIP="${CROSS_COMPILE}strip"
10.  make CPPFLAGS="-I/proj/mtk06743/tools/crossbuild/ncurses-5.7/modv7/include/ncurses -I/proj/mtk06743/tools/crossbuild/ncurses-5.7/modv7/include/ -I/mtkoss/gnuarm/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686/sysroot/usr/include"  LDFLAGS="-L/proj/mtk06743/tools/crossbuild/ncurses-5.7/modv7/lib"
    >>please change CPPFLAGS/LDFLAGS above according to your setting


(GPL 2.0)/linux kernel/linux-2.6.35.tar.gz

1.  tar xvf linux-2.6.35.tar.gz
2.  cd kernel
3.  sh patch.sh 
4.  sh cp_driver_bdp.sh
5.  make -j ${JOBS} -C linux-2.6.35 O=$PWD/build_linux-2.6.35 CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-

(LGPL3.0)libzmq
Prerequisities:
- gcc version 4.6.3
- MTK toolchain should be installed. Assuming that MTK toolchain path is "/usr/mtk/i686/bin".
- Assuming that imdb src path is "/root/imdb".


[How to make libzmq]
1. Setup toolchain
    export PATH=$PATH:"/usr/mtk/i686/bin"
    export HOST=armv7a-mediatek451_001_vfp-linux-gnueabi
    export CC=${HOST}-gcc
    export CXX=${HOST}-g++
    export LD=${HOST}-g++
    export AR=${HOST}-ar
    export RANLIB=${HOST}-ranlib
    export STRIP=${HOST}-strip

2. Build & install zmq
    cd /root/imdb/zmq/zeromq-4.0.3
    make clean
    ./configure  --host=armv7a-mediatek451_001_vfp-linux-gnueabi
    make
    make install

In general, a set of zmq libraries will be located in /usr/local/lib

    ls -al /usr/local/lib/ | grep libzmq
    -rw-r--r--  1 root root  5047258 10¿ù  8 10:05 libzmq.a
    -rwxr-xr-x  1 root root     1039 10¿ù  8 10:05 libzmq.la
    lrwxrwxrwx  1 root root       15 10¿ù  8 10:05 libzmq.so -> libzmq.so.3.1.0
    lrwxrwxrwx  1 root root       15 10¿ù  8 10:05 libzmq.so.3 -> libzmq.so.3.1.0
    -rwxr-xr-x  1 root root  2746974 10¿ù  8 10:05 libzmq.so.3.1.0

(GPL2.0)busybox
Prerequisities:
- gcc version 4.6.3
- MTK toolchain should be installed. Assuming that MTK toolchain path is "/usr/mtk/i686/bin".
- Assuming that imdb src path is "/root/imdb".


[How to make busybox 1.22.1]
******************************************************Note*************************************************
* This section describes the way to build busybox-0.60.3, which used in imdb product.                     *
* If you wish to install the latest busybox version, go to the next section [How to make busybox 1.22.1]. *
***********************************************************************************************************

1. Get busybox src

    wget http://busybox.net/downloads/busybox-0.60.3.tar.bz2
    tar xvf busybox-0.60.3.tar.bz2
    cd busybox-0.60.3

2. Edit Makefile
Set static build option. 

    line 36:
    change "DOSTATIC = false" to
           "DOSTATIC = true"

Add a cross compiler. 

    line 86:
    change "CROSS = " to
           "CROSS = armv7a-mediatek451_001_vfp-linux-gnueabi-"

3. Edit ./libbb/syscalls.c
Change a wrapper of syscall. 

    add "#define __ia64__" at fisrt 
    or remove 37,42,43,44,62,67,68 and 69 lines

4. edit gzip.c
Change source code to newer glibc style.
    
    1330 line:
    change     "outFileNum = open(ofname, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW);"  to 
            "outFileNum = open(ofname, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, 644);"

    1332 line:
    change    "outFileNum = open(ofname, O_RDWR | O_CREAT | O_EXCL);" to
            "outFileNum = open(ofname, O_RDWR | O_CREAT | O_EXCL, 644);"

    2176 line:
    change    "static const int build_bl_tree()" to 
            "static int build_bl_tree()"

5. Modify Config.h
Add comments below to disable mkswap
    line 80:
    change "#define BB_MKSWAP" to 
           "//#define BB_MKSWAP" 

Remove comments below to enable busybox-functionalities.

    line 59:
    change "//#define BB_INSMOD" to 
           "#define BB_INSMOD"
    line 91:
    change "//#define BB_PING" to 
           "#define BB_PING"
    line 120:
    chgange "//#define BB_TFTP" to 
            "#define BB_TFTP"
    line 136:
    change     "//#define BB_VI" to 
            "#define BB_VI"
    line 139:
    change    "//#define BB_WGET" to  
            "#define BB_WGET"    

6. make 
Every necessary configurations were set. Now type make to make busybox.

    make

In general, busybox will be located in currenty directory.


[How to make busybox 1.22.1]
prerequisities:
apt-get install libncurses5-dev
apt-get install gawk

1. Get busybox src

    wget http://busybox.net/downloads/busybox-1.22.1.tar.bz2
    
2. Set configuration

    make ARCH=arm CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi- menuconfig

<in GUI style setup menu, please fllow thos steps.>

    #Busybox Settings->Build Options->Build Busybox as a static binary (no shared libs) : type 'y' to set.
    #Busybox Settings->Build Options->Cross compiler prefix : Set "armv7a-mediatek451_001_vfp-linux-gnueabi-"
    #Applets->Networking Utilities->inetd->Support RPC services. : type 'n' to disable
    #Linux Module Utilities->() Default directory containing modules : set value to ''
    #Linux Module Utilities->() Default name of modules.dep : set value to ''
    
Now, exit and save the configuration.

3. Build

    make ARCH=arm CROSS_COMPILE=armv7a-mediatek451_001_vfp-linux-gnueabi-

In general, busybox will be located in currenty directory.

Install-shell

Cod:

#!/bin/sh

if [ -z "$1" -o "help" = "$1" ]; then
    echo " --------- Usage : ----------- "
    echo " source install-shell [TOOLCHAIN_TAR_NAME] [INSTALL_PATH]"
    echo " --------- E.g. -------------: "
    echo " source install-shell /home/user/pkg/gnuarm_4.5.1.20110725.tgz /tools/chain/target/path"
    echo " if the 2nd parameter is empty, default is /mtkoss/gnuarm"
        echo " Please follow the guide to download the version "
    return;    
fi

# Mediatek's tools chain position

if [ -z $2 ]; then
MTK_TOOLS_ROOT=/mtkoss/gnuarm
else
MTK_TOOLS_ROOT=$2
fi
mkdir -p $MTK_TOOLS_ROOT

#keep original toolchain to be the backup
NOW_TIME=`date +%Y%m%d_%H%M%S`
if [ -e $MTK_TOOLS_ROOT/soft_4.5.1_2.6.27_arm11-rhel4 ]; then
    mkdir -p $MTK_TOOLS_ROOT/backup/$NOW_TIME
    mv $MTK_TOOLS_ROOT/soft_4.5.1_2.6.27_arm11-rhel4 $MTK_TOOLS_ROOT/backup/$NOW_TIME
fi

if [ -e $MTK_TOOLS_ROOT/vfp_4.5.1_2.6.27_cortex-a9-rhel4 ]; then
    mkdir -p $MTK_TOOLS_ROOT/backup/$NOW_TIME
    mv $MTK_TOOLS_ROOT/vfp_4.5.1_2.6.27_cortex-a9-rhel4 $MTK_TOOLS_ROOT/backup/$NOW_TIME
fi

if [ -e $MTK_TOOLS_ROOT/vfp_4.5.1_2.6.27_arm11-rhel4 ]; then
    mkdir -p $MTK_TOOLS_ROOT/backup/$NOW_TIME
    mv $MTK_TOOLS_ROOT/vfp_4.5.1_2.6.27_arm11-rhel4 $MTK_TOOLS_ROOT/backup/$NOW_TIME
fi

tar zxvf $1 -C $MTK_TOOLS_ROOT

SOFT_TOOL_CHAIN_ROOT=${MTK_TOOLS_ROOT}/soft_4.5.1_2.6.27_arm11-rhel4/i686
CA9_TOOL_CHAIN_ROOT=${MTK_TOOLS_ROOT}/vfp_4.5.1_2.6.27_cortex-a9-rhel4/i686
VFP_TOOL_CHAIN_ROOT=${MTK_TOOLS_ROOT}/vfp_4.5.1_2.6.27_arm11-rhel4/i686

# Mtk's 2nd 4.5.1 toolchain version, need to do symlink

#configure the shell environment
echo "  " >> ~/.bash_profile
echo "#Confirgure Mediatek Toolchain 4.5.1 --BEGIN" >> ~/.bash_profile
echo "export PATH=\$PATH:$SOFT_TOOL_CHAIN_ROOT/bin:$CA9_TOOL_CHAIN_ROOT/bin:$VFP_TOOL_CHAIN_ROOT/bin" >> ~/.bash_profile
echo "#Confirgure Mediatek Toolchain 4.5.1 --END" >> ~/.bash_profile
echo "  " >> ~/.bash_profile
source  ~/.bash_profile

#Verication Now
# test gcc exist or not

echo "Validation Toolchain Now"
for i in armv6z-mediatek451_001_soft-linux-gnueabi-gcc armv6z-mediatek451_001_vfp-linux-gnueabi-gcc armv7a-mediatek451_001_vfp-linux-gnueabi-gcc; do
    which $i 1>/dev/null 2>&1
    if [ $? -ne 0 ]; then
        echo "Fail test: $i not exist "
        exit 1
    fi
done

echo "Validate gcc location: pass"

for i in armv6z-mediatek451_001_soft-linux-gnueabi-gcc armv6z-mediatek451_001_vfp-linux-gnueabi-gcc armv7a-mediatek451_001_vfp-linux-gnueabi-gcc; do
    VERSION_STRING=`$i --version|head -n 1|awk '{print $3}'`
    if [ "$VERSION_STRING" != '4.5.1' ]; then
        echo "Fail test: $i version is not 4.5.1"
        exit 1
    fi
done
echo "Validate gcc version: pass"

Offline

 

Antet forum

Powered by FluxBB