确定了我们sep0611的基线版本之后,接下来就是在北大小本上移植android 2.3.1
移植过程可以划分为几个阶段:
步骤:
新建一个公司相关目录:mkdir seuic
新建一个产品目录:mkdir sep0611 @device/seuic/
产品相关的编译配置文件:
Android.mk:总编译文件
BoardConfig.mk:板级产品编译配置文件
device.mk:
setup-makefiles.sh
AndroidProducts.mk:包含full_sep0611.mk
CleanSpec.mk
full_sep0611.mk: 设备级产品配置文件
vendorsetup.sh: lunch 配置脚本
编译系统:
1) 在build/core/combo/arch:mkdir unicore32
新建一个sep0611.mk声明处理器架构相关配置
例如: #ARCH_ARM_HAVE_THUMB_SUPPORT := true #ARCH_ARM_HAVE_FAST_INTERWORKING := true #ARCH_ARM_HAVE_64BIT_DATA := true #ARCH_ARM_HAVE_HALFWORD_MULTIPLY := true #ARCH_ARM_HAVE_CLZ := true #ARCH_ARM_HAVE_FFS := true
这个文件主要申明了编译器目录,编译选项,头文件等
不使用prelink和strip(暂时没做好)
ifeq ($(TARGET_ARCH),unicore32) LOCAL_PRELINK_MODULE := false endif ifeq ($(TARGET_ARCH),unicore32) LOCAL_STRIP_MODULE := false endif
声明编译静态可执行文件所需要的启动相关的lib库目录
ifeq ($(TARGET_ARCH),unicore32) ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true) $(linked_module): $(TARGET_CRTBEGIN_STATIC_O) $(all_objects)$(all_libraries)$(TARGET_CRTEND_COM_O)$(TARGET_CRTEND_EXECUTABLE_O)$(transform-o-to-static-executable) 29 else 30 $(linked_module): $(TARGET_CRTBEGIN_EXECUTABLE_O) $(all_objects) $(all_libraries) $(T ARGET_CRTEND_COM_O) $(TARGET_CRTEND_EXECUTABLE_O) 31 $(transform-o-to-executable) 32 endif 33 else # !unicore32 34 ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true) 35 $(linked_module): $(TARGET_CRTBEGIN_STATIC_O) $(all_objects) $(all_libraries) $(TARGE T_CRTEND_O) 36 $(transform-o-to-static-executable) 37 else 38 $(linked_module): $(TARGET_CRTBEGIN_DYNAMIC_O) $(all_objects) $(all_libraries) $(TARG ET_CRTEND_O) 39 $(transform-o-to-executable) 40 endif 41 endif # unicore32
主要由以下几个启动相关调用库:
crtbegin_com.o crtbegin_executable.o crtend_com.o crtend_executable.o
我们主要实现了两个:crtend_com.o crtend_executable.o
53 ifeq ($(TARGET_ARCH),unicore32) 54 $(linked_module): $(all_objects) $(all_libraries) / 55 $(LOCAL_ADDITIONAL_DEPENDENCIES) / 56 $(TARGET_CRTBEGIN_COM_O) $(TARGET_CRTEND_COM_O) 57 $(transform-o-to-shared-lib) 58 else 59 $(linked_module): $(all_objects) $(all_libraries) / 60 $(LOCAL_ADDITIONAL_DEPENDENCIES) / 61 $(my_target_crtbegin_so_o) $(my_target_crtend_so_o) 62 $(transform-o-to-shared-lib) 63 endif