编译过程:
(在Ubuntu 11.04
初始化完成,显示如下
including device/samsung/maguro/vendorsetup.sh
including device/samsung/tuna/vendorsetup.sh
including device/ti/panda/vendorsetup.sh
including sdk/bash_completion/adb.bash
2. lunch full-eng //选择的目标
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ITL41D
============================================
//建立与一切使。GNU的make -JN参数可以并行处理任务,它是共同使用的任务数,
//N的1倍和2倍之间是被用于建立计算机硬件线程数量。例如在E5520双机(2个CPU,
//每个CPU 4核,每核心2线程),最快的构建与命令之间的J16和 -J32。
3. make -j4
编译完成
Target system fs image: out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img
Install system fs image: out/target/product/generic/system.img
编译sdk
1.source build/envsetup.sh 初始化构建环境
2.lunch sdk-eng 选择目标
3.make sdk
编译成功,在out/host/linux-x86/sdk/下生成文件
Package SDK: out/host/linux-x86/sdk/android-sdk_eng.root_linux-x86.zip
如果木有权限查看该目录,那么目录下面为显示为空,但通过root终端可以看到得。
out/host/linux-x86/sdk/ 添加如下权限,就可以看到编译完成得sdk了。
chmod 777 * -R
常见错误:
1./bin/bash: bison: 未找到命令
解决方法:sudo apt-get install bison
2. /bin/bash: flex: 未找到命令
解决方法:sudo apt-get install bison flex
3.
system/core/gpttool/gpttool.c:24:18: fatal error: zlib.h: 没有那个文件或目录
compilation terminated.
make: *** [out/host/linux-x86/obj/EXECUTABLES/gpttool_intermediates/gpttool.o] 错误 1
make: *** 正在等待未完成的任务....
解决方法: sudo apt-get install zlib-devel
4.host Executable: bb2sym (out/host/linux-x86/obj/EXECUTABLES/bb2sym_intermediates/bb2sym)
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] 错误 1
解决方法:sudo apt-get install libncurses5-dev
5.
development/tools/emulator/opengl/host/libs/Translator/GLcommon/../include/EGL/eglplatform.h:85:22: fatal error: X11/Xlib.h: 没有那个文件或目录
compilation terminated.
make: *** [out/host/linux-x86/obj/EXECUTABLES/triangleCM_intermediates/triangleCM.o] 错误 1
解决方法:sudo apt-get install libx11-dev
6.fatal error: GL/glx.h: 没有那个文件或目录
解决方法:sudo apt-get install libgl1-mesa-dev
7. gperf: not found
解决方法:sudo apt-get install gperf
(下载源码最好睡觉前下载,4M宽带,早上起来下载完成。编译根据电脑配置,大概需要2个小时以上)