Build an Android compiling environment and build an android compiling environment

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.