http://www.huomo.cn/developer/article-b8f0.html

1. 参考文档
1.1 Obtaining MIPS Android Source Code (http://www.mipsandroid.com/documents/show/1)
1.2 Compiling Android for MIPS (http://www.awakecoding.com/index.php?option=com_content&view=article&id=21:compiling-android-for-mips)
1.3 移植Android到MIPS平台(续) (http://my.unix-center.net/~Simon_fu/?p=557)
2. 环境准备
2.1 安装ubuntu(使用virtulbox)
2.2 安装其他需要工具
sudo apt-get install gcc build-essential git-core libreadline-dev zip curl wget valgrind python eclipse ecj flex bison gperf libsdl-dev libwxgtk2.6-dev libgmp3-dev libsds-dev clearsilver-dev libclearsilver-perl python-clearsilver gcc-multilib g++-multilib
2.3 安装java jdk
sudo apt-get sun-java5-jdk
sudo update-alternatives --config java (选择刚安装完的JDK目录)
sudo update-alternatives --config javac
sudo update-alternatives --config javadoc
2.4 安装mips-4.3 toolchain
此步骤可省略,使用android自带的prebuilt toolchain即可 3. 源码下载
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir mipsandroid
$ cd mipsandroid
$ repo init -u git://public.mipsandroid.com/mips/platform/manifest.git -b mips-eclair
$ repo sync 4. 编译
4.1 准备
在mipsandroid下添加env.sh如下
export TOP='pwd'
export J2RE_HOME=/usr/lib/jvm/java-1.5.0-sun/jre
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
export ANDROID_JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
source build/envsetup.sh
export USE_CCACHE=1
export TARGET_ARCH_VERSION=mips32r2
export TARGET_ARCH=mips
export ANDROID_PRODUCT_OUT=~/android/mipsandroid/out/target/product/generic
export PATH=$PATH:~/android/mipsandroid/out/host/linux-x86/bin/ 4.2 步骤
source env.sh
make
4.3 此时已生成emulator和对应的system.img ramdisk.img userdata.img(kernel-qemu使用prebuilt的) 4.3问题总结
之前由于PRODUCT指定不对,造成编译出的init使用了hard float point的libc,重新make clean;make解决 5.编译SDK
5.1 执行
在4步骤完成后
make sdk 5.2 问题总结
5.2.1 提示crtbegin_so.S找不到
修改bionic/libc/Android.mk如下,注释掉
#ifeq ($(TARGET_ARCH),mips)
# we only need begin_so/end_so for mips, since it needs an appropriate .init
# section in the shared library with a function to call all the entries in
# .ctors section.
#GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o
#$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.S
# @mkdir -p $(dir $@)
# $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
#ALL_GENERATED_SOURCES += $(GEN) #GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o
#$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S
# @mkdir -p $(dir $@)
# $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
#ALL_GENERATED_SOURCES += $(GEN)
#endif # TARGET_ARCH == mips 5.2.2 生成的linux sdk使用不正常,发现kernel-qemu拷贝的是arm的,将其替换即可 6.编译windows SDK
6.1 步骤
1)将mipsandroid拷贝到cygwin里
2)windows安装java jdk
3)修改env.sh
export TOP='pwd'
export J2RE_HOME=/cygdrive/c/Java/jdk1.5.0_20/jre
export JAVA_HOME=/cygdrive/c/Java/jdk1.5.0_20
export ANDROID_JAVA_HOME=/cygdrive/c/Java/jdk1.5.0_20
source build/envsetup.sh
export TARGET_ARCH_VERSION=mips32r2
export TARGET_ARCH=mips
export ANDROID_PRODUCT_OUT=~/android/mipsandroid/out/target/product/generic
export PATH=$PATH:/cygdrive/c/Java/jdk1.5.0_20/bin
4)修改make_windows_sdk.sh,增加acp编译(android 2.2),修改cygwin目录,删除adb/fastboot编译(android 2.2),如下 a) CYG_MGWZ_PATH=/cygdrive/c/cygwin/bin/mgwz.dll -> CYG_MGWZ_PATH=/cygdrive/e/cygwin/bin/mgwz.dll b) SDK_NUMBER=`echo $filename | sed -n 's/^.*_\([^_./]\+\)_[^_.]*\..*$/\1/p'` -> SDK_NUMBER=2.2 c) aapt adb aidl \
etc1tool \
prebuilt \
dexdump dmtracedump \
fastboot \
->
acp aapt aidl \
etc1tool \
prebuilt \
dexdump dmtracedump \ d) cp -v out/host/windows-x86/bin/*.{exe,dll} "$TOOLS"/ -> cp -v out/host/windows-x86/bin/*.exe "$TOOLS"/ e)
[[ -n $NEED_MGWZ ]] && cp -v $CYG_MGWZ_PATH "$TOOLS"/ ->
[[ -n $NEED_MGWZ ]] && cp -v $CYG_MGWZ_PATH "$TOOLS"/
cp -v /cygdrive/e/cygwin/bin/cygz.dll "$TOOLS"/
cp -v /cygdrive/e/cygwin/bin/cygwin1.dll "$TOOLS"/ f)
[[ -n $NEED_MGWZ ]] && cp -v "$TOOLS"/mgwz.dll "$PLATFORM_TOOLS"/
->
[[ -n $NEED_MGWZ ]] && cp -v "$TOOLS"/mgwz.dll "$PLATFORM_TOOLS"/
cp -v "$TOOLS"/cygz.dll "$PLATFORM_TOOLS"/
cp -v "$TOOLS"/cygwin1.dll "$PLATFORM_TOOLS"/ 5)修改external/sqlite/dist/shell.c
#if defined(HAVE_READLINE) && HAVE_READLINE==1 -> #if 0
# include <readline/readline.h>
# include <readline/history.h>
6.2 安装使用
kernel-qemu还是arm的,替换成mips的

更多相关文章

  1. android文件缓存,并SD卡创建目录未能解决和bitmap内存溢出解决
  2. Android基础分析目录
  3. Android SDK中 tools 目录下的工具介绍
  4. 第二讲:Android系统构架分析和应用程序目录结构分析
  5. Ubantu下搭建Android CTS 兼容性测试环境及单项测试操作步骤
  6. android -- 多级目录创建
  7. Android系列教程之四:Android项目的目录结构
  8. Android studio 如何在android选项下生成jniLibs目录
  9. Android实现文件夹目录选择器

随机推荐

  1. Android(安卓)GPS 定位的实现
  2. Android界面编程之实现改变图片透明度并
  3. 【android】Intent 和 Intent Filter
  4. Android 异步加载深入解析
  5. Android 下拉刷新控件SwipeRefreshLayout
  6. 配置adb环境变量及查看sharepreference
  7. Android——ImageSpan图片和文字实现垂直
  8. android app启动动画的实现
  9. 随手记 Android开发者开发iOS初入门感想
  10. 初识ProgressBar