Chinaunix

±êÌâ: Android±Ê¼ÇÖ®¶þ£º »·¾³ÉèÖÃÓë±àÒë [´òÓ¡±¾Ò³]

×÷Õß: xd_zxw    ʱ¼ä: 2009-01-06 16:26
±êÌâ: Android±Ê¼ÇÖ®¶þ£º »·¾³ÉèÖÃÓë±àÒë

                                                                1. Ö÷»ú£¨Host£©
    Dell Optiplex 745, Pentium D Processor, Ubuntu 7.10
    # uname -a
    Linux souken-i2 2.6.22-14-generic #1 SMP Tue Dec 18 08:02:57 UTC 2007 i686 GNU/Linux
    # cat /proc/version
    Linux version 2.6.22-14-generic (buildd@terranova) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 SMP Tue Dec 18 08:02:57 UTC 2007
2. Android °²×°±Ê¼Ç £À 2009/01/05
About Android
==============
  *
http://code.google.com/android/index.html
Development Resources
======================
  * App SDK
   
http://code.google.com/android/download.html
  
  * Sources
   
http://source.android.com/
   
http://source.android.com/download
Install SDK
============

  * Downloaded package: android-sdk-linux_x86-1.0_r2.zip
   
  * Install guide:
   
http://code.google.com/android/intro/installing.html
  * steps
    # cd ~
    # mkdir -p android/SDK
    # cd android/SDK
    # cp ~/Download/android-sdk-linux_x86-1.0_r2.zip .
    # unzip android-sdk-linux_x86-1.0_r2.zip
   
    # vi /home/souken-i/.bashrc (Add this line:)
    ------
    export PATH=${PATH}:/home/souken-i/android/SDK/android-sdk-linux_x86-1.0_r2/tools
    ------
    Now the SDK is OK. Run "# emulator" to test.
  * Update Eclipse:
    * Remove current eclipse if have:
      # sudo apt-get remove eclipse   
    * Download latest elipse from:
http://www.eclipse.org/downloads/
    * I choose "Eclipse IDE for Java EE Developers (162 MB)" and
      download file: eclipse-jee-ganymede-SR1-linux-gtk.tar.gz
    * Unpack it and add its path to PATH.
    * Version: 3.4.1 Build id: M20080911-1700
  * Install Eclipse plugin for Android: ADT
    * Download latest ADT(I choose ADT-0.8.0.zip) from:
      
http://code.google.com/android/adt_download.html
    * Following the installing guide to install ADT:
      
http://code.google.com/android/intro/installing.html
Build Enviroment
================
  * Guide:
http://source.android.com/download
  * Install Java:
    # sudo apt-get install sun-java6-jdk
  * Install Other library
    # sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
  * Install SDL
    # sudo apt-get install libsdl-dev
   
    SDL fails to install on my Host. It gives me this message:
    -----------------------
    libsdl1.2-dev:
      ÒÀ´æ: libx11-dev ¤·¤«¤·¤½¤ì¤Ï¥¤¥ó¥¹¥È©`¥ë¤µ¤ì¤Þ¤»¤ó
      ÒÀ´æ: libglu1-xorg-dev ¤·¤«¤·¤½¤ì¤Ï¥¤¥ó¥¹¥È©`¥ë¤µ¤ì¤Þ¤»¤ó ¤Þ¤¿¤Ï
        libglu-dev
    -----------------------
    So I tried to install libx11-dev, this time it gives me another
    error message:  
    -----------------------
    libx11-dev: ÒÀ´æ: libx11-6 (= 2:1.1.1-1ubuntu4) ¤·¤«¤·¡¢2:1.1.1-1ubuntu4ja1 ¤Ï¥¤¥ó¥¹¥È©`¥ë¤µ¤ì¤è¤¦¤È¤·¤Æ¤¤¤Þ¤¹
    -----------------------
    But in fact, 2:1.1.1-1ubuntu4ja1 is installed in my host.
    * I skip this package, and to see when and where this package will
      be used.
  * Update git version
    On Ubuntu 7.10, if I use command apt-get command to install git tools,
    the version is 1.5.2. But repo requests that git version is 1.5.4 or
    larger. So, I have to compile it from source code.
      See guide on:
http://git.or.cz/
   
    # git clone git://git.kernel.org/pub/scm/git/git.git
    # cd git
    # make prefix=/usr; make install
    # make prefix=/usr all doc info
    # sudo make prefix=/usr install install-doc install-html install-info
    To compile git, install the packages below on Ubuntu for missing header
    files:
      # sudo apt-get install libc6-dev libssl-dev zlib1g-dev libcurl4-openssl-dev libexpat1-dev asciidoc  xmlto texinfo
    * For missing header file, go to web
http://packages.ubuntu.com/
      and search which package which includes this file.
Get repo tools
==============
   
  * repo is not a new tools. It is just a wrap for git command.
    # mkdir ~/bin
    # curl http://android.git.kernel.org/repo > ~/bin/repo
    # chmod a+x ~/bin/repo
    Add ~/bin to PATH.
Get Android Source
==================
    # cd ~/android/source
    # repo init -u git://android.git.kernel.org/platform/manifest.git
    # repo sync
Build Android
=============
   
   # cd ~/android/source
   # make
   * compile error:
     prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:75: error: syntax error before '}' token
   
     * possibly because of missing package: libsdl-dev
     * I selected package "libx11-6" and did "¥Ñ¥Ã¥±©`¥¸" ¡ú "¥Ñ¥Ã¥±©`¥¸¤Î¹Ì¶¨"
       from Synaptic menu, then I can install libsdl-dev successfully.
  * recompile and wait for the result. (How long will it cost to compile all the source???)
    * It takes about 1 hour to compile all the source. And at last it shows:
      -----------------------------------
      ......
      Generated: (out/target/product/generic/android-info.txt)
      Target system fs image:
      out/target/product/generic/obj/PACKAGING/systemimage_unopt_intermediates/system.img
      Install system fs image: out/target/product/generic/system.img
      Target ram disk: out/target/product/generic/ramdisk.img
      Target userdata fs image: out/target/product/generic/userdata.img
      -----------------------------------
     * These images are for target:
       system.img ramdisk.img userdata.img
       Copy them to the SDK diretory and it works:
      
       # cp out/target/product/generic/*.img
              ~/android/SDK/android-sdk-linux_x86-1.0_r2/tools/lib/images/
       # emulator &
     * But where is the kernel image? (kernel-qemu)
               
               
               
               
               
               
               
               
               
               
               

±¾ÎÄÀ´×ÔChinaUnix²©¿Í£¬Èç¹û²é¿´Ô­ÎÄÇëµã£ºhttp://blog.chinaunix.net/u1/52480/showart_1777698.html




»¶Ó­¹âÁÙ Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2