ubuntu编译环境配置

STEP1. update & install pkg
sudo apt-get update
sudo apt-get install git-core
sudo apt-get install gnupg
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install gperf
sudo apt-get install build-essential
sudo apt-get install zip
sudo apt-get install zlib1g-dev
sudo apt-get install libc6-dev
sudo apt-get install libc6-i386
sudo apt-get install libc6-dev-i386
sudo apt-get install lib32ncurses5-dev
sudo apt-get install ia32-libs
sudo apt-get install x11proto-core-dev
sudo apt-get install libx11-dev
sudo apt-get install lib32readline-gplv2-dev
sudo apt-get install lib32z-dev
sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
sudo apt-get install g++-4.4-multilib
sudo apt-get install gcc-multilib
sudo apt-get install g++-multilib
sudo apt-get install xsltproc
sudo apt-get install libxml2
sudo apt-get install libxml2-utils
[or sudo apt-get install 'NAME LIST OF TOTAL ABOVE']


STEP1.0 downgrade gcc g++
cd /usr/bin;sudo mv gcc gcc.bak;sudo mv g++ g++.bak;sudo ln -s gcc-4.4 gcc;sudo ln -s g++-4.4 g++


[!!!OPTIONAL!!!DO this step ONLY if the Ubuntu you used lower than ver 11.10
STEP1.0.1 install arm gcc
#recommand install into /home/$(USER_NAME)/bin
#create bin folder under /home/$(USER_NAME)/
#copy arm_201103_gcc4.5.2.tgz file to /home/$(USER_NAME)/bin
#extract to /home/$(USER_NAME)/bin
cd ~
#edit ~/.bashrc
#append lines below at end of file, save it
export PATH=/home/$(USER_NAME)/bin/arm_201103_gcc4.5.2/mybin:$PATH
alias arm_1103_le-as='arm_1103_le-as -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp'
alias arm_1103_le-c++='arm_1103_le-c++ -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp'
alias arm_1103_le-cpp='arm_1103_le-cpp -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp'
alias arm_1103_le-g++='arm_1103_le-g++ -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp'
alias arm_1103_le-gcc='arm_1103_le-gcc -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp'
alias arm_1103_le-gcc-4.5.2='arm_1103_le-gcc-4.5.2 -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp'
]


STEP1.1. install JDK
#recommand install into /home/$(USER_NAME)/bin
#create bin folder under /home/$(USER_NAME)/ if bin folder not exist
#copy jdk bin file to /home/$(USER_NAME)/bin
cd ~/bin
chmod +x $(JDK_BIN)
./$(JDK_BIN)


cd ~
#edit ~/.bashrc
#append lines below at end of file, save it
export JAVA_HOME=/home/$(USER_NAME)/bin/$(JDK_INSTALLED_FOLDER)
export JRE_HOME=/home/$(USER_NAME)/bin/$(JDK_INSTALLED_FOLDER)/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=/home/$(USER_NAME)/bin:$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export ANDROID_JAVA_HOME=$JAVA_HOME
#reload & apply new .bashrc
source ./.bashrc


STEP1.2. Eclipse IDE (optional) or install form Ubuntu Software Center, then ignore this step
#recommand install into /home/$(USER_NAME)/bin
#copy Eclipse tar.gz file to /home/$(USER_NAME)/bin
#extract to /home/$(USER_NAME)/bin
cd ~/bin/$(ECLIPSE_INSTALLED_FOLDER)


#edit eclipse.ini
#add line below in eclipse.ini, save it
-vm
/home/$(USER_NAME)/bin/$(JDK_INSTALLED_FOLDER)/bin


#create file[Eclipse.desktop] and type lines below, then save it
[Desktop Entry]
Name=Eclipse
Comment=Eclipse IDE
Exec=/home/$(USER_NAME)/bin/$(ECLIPSE_INSTALLED_FOLDER)/eclipse
Icon=/home/$(USER_NAME)/bin/$(ECLIPSE_INSTALLED_FOLDER)/$(ICON_FILE).xpm
Terminal=false
Type=Application
Categories=Application;Development
#move Eclipse.desktop to /usr/share/application
sudo mv ./Eclipse.desktop /usr/share/application


STEP2. download repo from https://dl-ssl.google.com/dl/googlesource/git-repo/repo use browser(firefox would be fine)
#copy repo file to /home/$(USER_NAME)/bin
cd ~/bin
#edit repo file REPO_URL = 'https://gerrit.googlesource.com/git-repo', modify to REPO_URL = 'http://gerrit.googlesource.com/git-repo', save it
chmod +x ./repo


##FOR NOW, THE BUILD ENVIRONMENT HAS BEEN SET
##NEXT WILL BE FETCH SOURCE CODE


# assume code review server ip: 172.29.0.76; port : 8443
# & sourcecode repertories server ip: 172.29.0.76; port : 29418
STEP3. SSH certification.
cd ~
ssh-keygen -C $(YOUR_EMAIL_ADDRESS)
#your id_rsa pub key would generate in ~/.ssh/id_rsa.pub file
#submit your pub key to your account of code review site(http://172.29.0.76:8443)
cd .ssh
#create config file(config) and type lines below, save it
host 172.29.0.76
hostname 172.29.0.76
user $(YOUR_USERNAME_OF_CODEVIEW_SITE)
port 29418
identityfile ~/.ssh/id_rsa


STEP4. fetch project sourcecode to local
#create sourcecode folder SOURCE_FOLDER
cd $(SOURCE_FOLDER)
repo init -u ssh://172.29.0.76/$(SERVER_SOURCE_FOLDER)/manifests.git -b $(BRANCH_TO_FETCH)
#after repo init done, sync code
repo sync


STEP_END
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值