Build an Android compiling environment and build an android compiling environment
I used to configure the server compiling environment when I was developing the Android system in the company. I summarized a document which has been in place for a long time. I will share it with you and avoid loss.
1. JDK environment variable configuration
Upload mtkoss.tar.gz to the/directory and run the command: # tar-xvzf mtkoss.tar.gz.
Modify the/etc/profile file and add environment variables:
JAVA_HOME=/mtkoss/jdk/1.6.0_45-ubuntu-10.04/x86_64JRE_HOME=/mtkoss/jdk/1.6.0_45-ubuntu-10.04/x86_64/jreexport CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/libexport PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
2. Configure the Android compiling environment: (you can directly execute the android_compile_env.sh script)
# sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
3. downgrade the gcc/g ++ version (the default gcc/g ++ version of Ubuntu is a little high)
# sudo apt-get install gcc-4.4
# sudo apt-get install g++-4.4
#sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.4 40
#sudo update-alternatives –install /usr/bin/g++ g++ /usr/bin/g++-4.4 40
#sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.6 30
#sudo update-alternatives –install /usr/bin/g++ g++ /usr/bin/g++-4.6 30
Select the gcc/g ++ version 4.4:
# sudo update-alternatives –config gcc
# sudo update-alternatives –config g++
In addition, the MTK Code contains its own compiling script root directory, ending with. sh, Which is set with the Java JDK compiling path by default. It must be set to its own JDK compiling path before compilation can pass.