User Tools

Site Tools


tutorials:cb1:development:installing_the_build_environment_on_ubuntu_12.04

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tutorials:cb1:development:installing_the_build_environment_on_ubuntu_12.04 [2013/10/12 19:02]
parker [Start]
tutorials:cb1:development:installing_the_build_environment_on_ubuntu_12.04 [2014/06/12 11:17] (current)
parker parker
Line 1: Line 1:
-====== ​Start ======+====== ​Installing the Build Environment on Ubuntu 12.04 ======
  
 <WRAP noprint><​WRAP left box 60%> <WRAP noprint><​WRAP left box 60%>
Line 10: Line 10:
  
  
-===== Requirements ===== +<WRAP left round box 60%> 
-=== Hardware ​=== +__** PC requirements **__ 
-1.1.1 CPU: Intel 2.5G I5 x64+  * ** Hardware ​** 
 +    ​* ​CPU: Intel 2.5G I5 x64 
 +    * Memory: 16G DDR3 
 +    * Disk: 30GB 
 +    * Internet connected 
 +  * ** Software ** 
 +    * OS: Ubuntu 12.04(64 bit) 
 +    * Java JDK 6 
 +    * Eclipse 
 +    * ADT 
 +    * CDT 
 +    * Android SDK 
 +    * Android NDK 
 +    * Linux Source 
 +    * Android Source 
 +</​WRAP>​
  
-1.1.2 Memory: 16G DDR3+===== Initializing a Build Environment =====
  
-1.1.3 Disk: 30GB+**Attention**:​ Demon stration is in Ubuntu 12.04(32bit).
  
-1.1.4 Internet connected+==== Installing the JDK ==== 
 +The Sun JDK is no longer in Ubuntu'​s mainpackage repository 
 +In order to download it, you need to add the appropriate repository and indicate to the system which JDK should be used.
  
-=== Software === +Download the jdk1.6:
-1.2.1OSUbuntu 12.04(64 bit)+
  
-1.2.2Java JDK 6+  $ dl.cubieboard.org/​software/​tools/​android/​jdk1.6.0_33.tar.gz
  
-1.2.3Eclipse+Input in terminal:
  
-1.2.4ADT+  $ sudo vim etc/profile
  
-1.2.5CDT+Add :
  
-1.2.6Android SDK+  JAVA_HOME=/​work/​tools/​jdk1.6.0_33 
 +  export JRE_HOME=/​work/​tools/​jdk1.6.0_33/​jre 
 +  export CLASSPATH=.:​$JAVA_HOME/​lib:​$JRE_HOME/​lib:​$CLASSPATH 
 +  export PATH=$JAVA_HOME/​bin:​$JRE_HOME/​bin:​$PATH 
 +   
 +Then save and input :
  
-1.2.7Android NDK+  $souurce etc/​profile 
 +==== Installing the Android SDK ====
  
-1.2.8Linux Source+Download the SDK from Web Browser: ​ http://​developer.android.com/​sdk/​index.html
  
-1.2.9Android Source+Choose the ''​adt-bundle-linux-x86-20130219.zip''​.
  
-===== Initializinga Build Environment ===== +Input in the terminal: ​
-Attention: Demonstration is in Ubuntu 12.04(32bit).+
  
-=== Installingthe JDK === +  $ sudo mkdir ~/sdk
-The Sun JDK is no longer in Ubuntu'​s mainpackage repository. In order to download it, you need to add the appropriaterepository and indicate to the system which JDK should be used.+
  
-Inputthe following command in the Terminal:+Copy the ''​adt-bundle-linux-x86-20130219.zip''​ to the /root/sdk and extract the zip.
  
-       $ sudo gedit /etc/apt/sources.list+Enter the folder ''​/root/sdk/adt-bundle-linux-x86-20130219/​sdk/​tools''​.
  
- Add:+Double click the script file android.
  
-       $ deb http://us.archive.ubuntu.com/​ubuntu/​ hardy multiverse+It will show the Android SDK ManagerChoose the package with ticks.
  
-Inputin terminal:+Then click the Install ''​XX''​ packages buttonon the right. It will start download the required packages.
  
-       $ sudo add-apt-repository "​debhttp://​archive.canonical.com/​ lucid partner"​ +After the installation, ​add the SDK tools to PATH Environment Variable.
-       $ sudo apt-get update +
-       $ sudo apt-get install sun-java6-jdk+
  
-=== Installingthe Android SDK ===+Input in the terminal:
  
-Downloadthe SDK from Web Browser:+  $ gedit /​etc/​profile
  
-http://​developer.android.com/​sdk/​index.html+Input in the “profile”
  
-Choosethe ​adt-bundle-linux-x86-20130219.zip.+  $ export ANDROID_SDK_PATH=/​root/​sdk/​adt-bundle-linux-x86-20130219/sdk 
 +  $ export PATH=.:​$ANDROID_SDK_PATH/​platform-tools:​$PATH
  
-Inputin ​the terminal: ​+Save and close the profile.
  
-       $ sudo mkdir ~/sdk+Input in the terminal:
  
-Copythe adt-bundle-linux-x86-20130219.zipto the /root/sdk and extract the zip.+  $ source ​/etc/profile
  
-Enterthe folder /​root/​sdk/​adt-bundle-linux-x86-20130219/​sdk/​tools.+==== Installing the Eclipse ====
  
-Doubleclick ​the script file android.+With the download of ''​adt-bundle-linux-x86-20130219.zip'',​ we can find the Eclipse in the  
 +''/​root/​sdk/​adt-bundle-linux-x86-20130219/​eclipse''​.
  
-It willshow ​the Android SDK Manager. Choosethe package with ticks.+Double click the eclipse can run it.
  
-Thenclick ​the Install XX packages buttonon the right. It will start download the required packages.+==== Installing ​the ADT online ====
  
-Afterthe installation, add the SDK tools to PATHEnvironment Variable.+Android Development Tools (ADT) is a plugin for the Eclipse IDE, that is designed to give you a powerful, integrated environment in which to build Android applications.  
 +        
 +ADT extends the capabilities of Eclipse to let you quickly set up new Android projects, create an application UI, add packages based on the Android Framework API, debug your applications using the Android ​SDK tools, and even export signed (or unsigned). 
 +**apk** files in order to distribute your application.
  
-Inputin ​the terminal:+Run the eclipse and click the help>​Install New Software.
  
-       $ gedit/​etc/​profile+Then click the Add button.
  
-Inputin ​the “profile”+Input the Location https://​dl-ssl.google.com/​android/​eclipse.
  
-       $ exportANDROID_SDK_PATH=/​root/​sdk/​adt-bundle-linux-x86-20130219/​sdk +Click OK. Then it will show the choice for installation.
-       $ export PATH=.:​$ANDROID_SDK_PATH/​platform-tools:​$PATH+
  
-Saveand close the profile.+Click Select All and Next.
  
-Inputin ​the terminal:+==== Installing ​the NDK ====
  
-       $ source/​etc/​profile+The NDK is a toolset that allows you to implement parts of your app using native-codelanguages such as C and C++. 
 +For certain types of apps, this can be helpful so you can reuse existing code libraries written in these languages, but most apps do not need the Android NDK.
  
-=== Installingthe Eclipse ===+Download the NDK from Web Browser: http://​developer.android.com/​sdk/​ndk/​index.html
  
-Withthe download of adt-bundle-linux-x86-20130219.zip,we can find the Eclipse in the /​root/​sdk/​adt-bundle-linux-x86-20130219/​eclipse.+Choose the ''​android-ndk-r8e-linux-x86.tar.bz2''​.
  
-Doubleclick ​the eclipse can run it.+Input in the terminal: ​
  
-=== Installing the ADT online ===+  $ sudo mkdir ~/ndk
  
-AndroidDevelopment Tools (ADT) is a plugin for the Eclipse IDEthat is designed to give you a powerful, integrated environment in which tobuild Android applications +Copy the ''​android-ndk-r8e-linux-x86.tar.bz2'' ​to the ''/​root/​sdk''​ and extract ​the zip.
-        +
-ADTextends the capabilities of Eclipse ​to let you quickly set up new Androidprojects,​ create an application UI, add packages based on the Android Framework API, debug yourapplications using the Android SDK tools, and even export signed (or unsigned). +
-apk files in order to distribute your application.+
  
-Run theeclipse and click the help>​Install NewSoftware.+Input in the terminal: ​
  
-Then clickthe Add button.+  $tar –xvf android-ndk-r8e-linux-x86.tar.bz2
  
-Input the Location https://​dl-ssl.google.com/​android/​eclipse.+Finally, add the NDK folder to PATH Environment Variable.
  
-Click OK. Then it will show the choice for installation.+==== Installing ​the CDT ====
  
-Click Select All and Next. +The CDT Project provides ​fully functional ​C and C++ Integrated Development Environment based on the Eclipse platform.
- +
-=== Installing the NDK === +
-The NDKis toolset that allows you to implement parts of your app using native-codelanguages such as C and C+++
-For certain types of apps, this can be helpful soyou can reuse existing code libraries written in these languages, but most appsdo not need the Android NDK. +
- +
-Downloadthe NDK from Web Browser: +
- +
-http://​developer.android.com/​sdk/​ndk/​index.html +
- +
-Choosethe android-ndk-r8e-linux-x86.tar.bz2. +
- +
-Inputin the terminal:  +
-       $ sudo mkdir ~/ndk +
-Copythe android-ndk-r8e-linux-x86.tar.bz2to the /root/sdk and extract ​the zip.+
  
-Inputin the terminal:  +Features include: support forproject creation and managed build for various toolchains, standard make build, source navigation, various source knowledge tools, such as type hierarchy, callgraph, include browser, macro definition browser, code editor with syntaxhighlighting,​ folding and hyperlink navigation, source code refactoring andcode generation, visual debugging tools, including memory, registers, anddisassembly viewers.
-       $tar –xvf android-ndk-r8e-linux-x86.tar.bz2 +
-Finally,add the NDK folder to PATH EnvironmentVariable. +
-=== Installing the CDT === +
-The CDT Project provides a fully functional C and C++ Integrated DevelopmentEnvironment based on the Eclipse platform. +
-Features include: support forproject creation and managed build for various toolchains, standard make build,​source navigation, various source knowledge tools, such as type hierarchy, callgraph, include browser, macro definition browser, code editor with syntaxhighlighting,​ folding and hyperlink navigation, source code refactoring andcode generation, visual debugging tools, including memory, registers, anddisassembly viewers.+
  
-Theinstallation ​of CDT is the same as ADT.+The installation ​of CDT is the same as ADT.
  
-But theLocation ​of CDT is:+But the Location ​of CDT is: http://​download.eclipse.org/​tools/​cdt/​releases/​indigo
  
-http://​download.eclipse.org/​tools/​cdt/​releases/​indigo +==== Installing the Cross Compiling Environment ​====
-=== Installing the Cross Compiling Environment ===+
  
-TheCPU ​X86 is using the CISC, while the ARM processor is RISO. Therefore, ​thecross ​compiling environment should be installed. +The CPU X86 is using the CISC, while the ARM processor is RISO. Therefore, ​the cross compiling environment should be installed. 
-TheCodeSourcery ​is an good choice for the cross compiling. It can be download ​fromthe ​following website.+The CodeSourcery ​is an good choice for the cross compiling. It can be download ​from the following website:
  
 http://​www.mentor.com/​embedded-software/​sourcery-tools/​sourcery-codebench/​editions/​lite-edition/​ http://​www.mentor.com/​embedded-software/​sourcery-tools/​sourcery-codebench/​editions/​lite-edition/​
  
-Choosethe ​ARM Processor GNU/Linux release.+Choose the ARM Processor GNU/Linux release.
  
-It willneed ​your personal information. Finally, system will send you an Email with thedownload ​URL.+It will need your personal information. Finally, system will send you an Email with the download ​URL.
  
 Click the Download Sourcery CodeBench Lite 2012.09-64. Click the Download Sourcery CodeBench Lite 2012.09-64.
Line 162: Line 162:
 Choose the IA32 GNU/Linux Installer. Choose the IA32 GNU/Linux Installer.
  
-Afterdownload, enter the folder in terminal and use the following command: +After download, enter the folder in terminal and use the following command: 
-       ​$ ln –s/​lib/​i386-linux-gnu/​libc.so.6 /lib + 
-       ​$ dpkg-reconfigure dash+  ​$ ln –s /​lib/​i386-linux-gnu/​libc.so.6 /lib 
 +  $ dpkg-reconfigure dash
  
 Choose NO. Choose NO.
  
-       $ sh arm-2012.09-64-arm-none-linux-gnueabi.bin+  ​$ sh arm-2012.09-64-arm-none-linux-gnueabi.bin
  
-Add theCodeSourvery ​to PATH.+Add the CodeSourvery ​to PATH.
  
-Inputin ​the terminal: +Input in the terminal:
-       $ gedit/​etc/​profile+
  
-Inputin the profile. +  ​gedit/etc/profile
-       ​$export PATH=.:$/root/CodeSourcery/​Sourcery_CodeBench_Lite_for_ARM_GNU_LIinux/​bin:​$PATH+
  
-Saveand close the profile.+Input in the profile.
  
-Inputin the terminal: +  $ export PATH=.:$/root/CodeSourcery/​Sourcery_CodeBench_Lite_for_ARM_GNU_LIinux/​bin:​$PATH
-       source/etc/profile +
-===== Test thefirst cross compiling environment =====+
  
-Programa simple first.c file.+Save and close the profile.
  
-             #​include<​stdio.h>​ +Input in the terminal:
-             int main() +
-            { +
-              printf(“Hello world\n”);​ +
-              return 0; +
-            }+
  
-Inputin the terminal: +  ​source/etc/profile
-       arm-none-linux-gnueabi-gcc–static –o first first.c +
-       $ adb push first /data/​local +
-       $ adb shell +
-       $ cd /​data/​local +
-       $ ./first+
  
 +===== Test the first cross compiling environment =====
  
-  +Program a simple ''​first.c''​ file.
  
 +<code c>
 +#​include<​stdio.h>​
 +int main()
 +{
 +    printf(“Hello world\n”);​
 +    return 0;
 +}
 +</​code>​
  
 +Input in the terminal:
  
 +  $ arm-none-linux-gnueabi-gcc–static –o first first.c
 +  $ adb push first /data/local
 +  $ adb shell
 +  $ cd /data/local
 +  $ ./first
  
  
 + 
 <WRAP noprint> <WRAP noprint>
-{{tag>Cubieboard Cubietruck}}+{{tag>development environment ubuntu_12.04}}
 </​WRAP>​ </​WRAP>​
tutorials/cb1/development/installing_the_build_environment_on_ubuntu_12.04.1381575746.txt.gz · Last modified: 2013/12/23 14:50 (external edit)