Android2.3编译小记

Android2.3编译小记--backAndroid2.3编译小记一下,留待后用

1:装VMWARE和ubuntu10.10 并能上网和共享文件。

2:将下载下来的JDK1.6,TCC88xx/89xx及相关资料放于共享文件夹里面。

3:以ROOT用户登录,输入$apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev

4:再输入: $ apt-get install lib64z1-dev libc6-dev-amd64 g++-multilib lib64stdc++6 

5:安装JDK1.6

     5.1将jdk-6u24-linux-i586.bin复制到home/james目录下,输入$ ./jkd-6u24-linux-i586.bin解压JDK

     5.2终端输入$ gedit gedit /etc/bash.bashrc

     5.3在bash.bashrc里面新增

          export JAVA_HOME=/home/james/jdk1.6.0_24

  export ANDROID_JAVA_HOME=$JAVA_HOME

  export PATH=$JAVA_HOME/bin:$PATH

     5.4再输入$source /etc/bash.bashrc使环境变量生效

     5.5再输入$ java -version查看JAVA版本,此步如果不能完成需要仔细检查,直到能正常查看JAVA版本

6:安装ARM-GCC编译器

     6.1将arm-none-linux-guneabi-4.3.2.tar.bz2复制到/home/james目录

     6.2输入$ tar –jvxf arm-none-linux-guneabi-4.3.2.tar.bz2

     6.3编辑/etc/profile,增加

       PATH=/home/james/arm-2008q3/bin:$PATH 

export PATH

     6.4source /etc/profile

     6.5然后用arm-none-linux-gnueabi-gcc -v和arm-linux-gcc -v分别查看GCC版本,如出现以下信息就OK,否则重装。

Configured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2008q3-72' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) 

7:解压源码

    将源码复制到home/james目录下,输入$ tar –jvxf gingerbread_0408.tar.bz2

8:. build/envsetup.sh

9:lunch后选10

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=2.3.1

TARGET_PRODUCT=full_tcc8800_evm

TARGET_BUILD_VARIANT=eng

TARGET_SIMULATOR=false

TARGET_BUILD_TYPE=release

TARGET_BUILD_APPS=

TARGET_ARCH=arm

HOST_ARCH=x86

HOST_OS=linux

HOST_BUILD_TYPE=release

BUILD_ID=GRH78

============================================

h10:配置内核为/home/james/gingerbread_0408/kernel# make tcc88xx_defconfig
11:编译内核 /home/james/gingerbread_0408/kernel# make
12:编译bootloader@ubuntu:/home/james/gingerbread_0408/bootable/bootloader/lk# make tcc8800_evm
13:屏蔽64位编译
13.1
build/core/main.mk
……
#mask by james
#ifneq (64,$(findstring 64,$(build_arch)))
#$(warning ************************************************************)
#$(warning You are attempting to build on a 32-bit system.)
#$(warning Only 64-bit build environments are supported beyond froyo/2.2.)
#$(warning ************************************************************)
#$(error stop)
#endif
……
13.2
/home/james/gingerbread_0408/external/clearsilver/cgi/Android.mk
/home/james/gingerbread_0408/external/clearsilver/java-jni/Android.mk

/home/james/gingerbread_0408external/clearsilver/util/Android.mk

/home/james/gingerbread_0408external/clearsilver/cs/Android.mk

找到以下文件改成,把64改成32

# This forces a 64-bit build for Java6 
#mask by james
# LOCAL_CFLAGS += -m64
# LOCAL_LDFLAGS += -m64
#add by james
LOCAL_CFLAGS += -m32
LOCAL_LDFLAGS += -m32
14:编译ANDROID
  root@ubuntu:/home/james/gingerbread_0408# make -j4
15: 生成img
 mkmtdimg --boot out/target/product/tcc8800/boot.img --system out/target/product/tcc8800/system.img --recovery out/target/product/tcc8800/recovery.img --output tcc8800_mtd.img

你可能感兴趣的:(Android2.3编译小记)