免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1406 | 回复: 0
打印 上一主题 下一主题

Android笔记之二: 环境设置与编译 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-01-06 16:26 |只看该作者 |倒序浏览

                                                                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
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP