|
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://carltao.blog.iyunv.com/856514/479777
时间有限,格式未调整,见谅。
编译的问题主要参考
http://hi.baidu.com/kellyvivian/blog/item/96eb45d45997fc9da1ec9c1c.html
谢谢原作者。


展开源码,用AOSP的bionic目录替换(gingerbread)的bionic
删除bootable/diskinstaller,拷贝froyo-x86的newinstaller到bootable目录下;拷贝gingerbread的bootable/diskinstaller/libdiskconfig目录到bootable/newinstaller目录下
修改build/core/Makefile,注释掉bootable/diskinstaller/config.mk的引用
链接froyo-x86的kernel;cd /work/gb; ln -sf /work/x86/kernel/ .
将x86/build/core/kernel.mk拷贝过来,并include在build/core/Makefile中
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES)
$(call pretty,”Target boot image: $@”)
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) –output $@
$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
endif # TARGET_BOOTIMAGE_USE_EXT2
include $(BUILD_SYSTEM)/kernel.mk
else # TARGET_NO_KERNEL
# HACK: The top-level targets depend on the bootimage. Not all targets
# can produce a bootimage, though, and emulator targets need the ramdisk
# instead. Fake it out by calling the ramdisk the bootimage.
# TODO: make the emulator use bootimages, and make mkbootimg accept
# kernel-less inputs.
INSTALLED_BOOTIMAGE_TARGET := $(INSTALLED_RAMDISK_TARGET)
endif
将froyo_x86的device/vm拷贝到device目录下,在AndroidBoard.mk中注释掉TARGET_PREBUILT_APPS
将build/core/target/board/generic_x86下面的buildspec*拷贝到根目录的buildspec.mk并修改BUILD_ENV_SEQUENCE_NUMBER为10
编译环境设置(每次编译前不要忘记lunch vm-eng以防止编译错误目标)
carl@carl-amd64:/work/gb$ . build/envsetup.sh
including device/htc/passion/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh
including device/vm/vm/vendorsetup.sh
carl@carl-amd64:/work/gb$ lunch vm-eng
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.1
TARGET_PRODUCT=vm
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=x86
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
将下面两行加入build/target/product/generic_x86.mk末尾
GENERIC_X86_CONFIG_MK := $(SRC_TARGET_DIR)/board/generic_x86/BoardConfig.mk
GENERIC_X86_ANDROID_MK := $(SRC_TARGET_DIR)/board/generic_x86/AndroidBoard.mk
开始编译内核
carl@carl-amd64:/work/gb$ m -j3 kernel
消除LOCAL_MODULE_TAGS的问题(external/grub),设置LOCAL_MODULE_TAGS := optional
build/core/base_rules.mk:74: *** Module name: grub_stage1
build/core/base_rules.mk:75: *** Makefile location: external/grub
build/core/base_rules.mk:76: *
build/core/base_rules.mk:77: * Each module must use a LOCAL_MODULE_TAGS in its
build/core/base_rules.mk:78: * Android.mk. Possible tags declared by a module:
build/core/base_rules.mk:79: *
build/core/base_rules.mk:80: * optional, debug, eng, tests, samples
build/core/base_rules.mk:81: *
build/core/base_rules.mk:82: * If the module is expected to be in all builds
build/core/base_rules.mk:83: * of a product, then it should use the
build/core/base_rules.mk:84: * “optional” tag:
build/core/base_rules.mk:85: *
build/core/base_rules.mk:86: * Add “LOCAL_MODULE_TAGS := optional” in the
build/core/base_rules.mk:87: * Android.mk for the affected module, and add
build/core/base_rules.mk:88: * the LOCAL_MODULE value for that component
build/core/base_rules.mk:89: * into the PRODUCT_PACKAGES section of product
build/core/base_rules.mk:90: * makefile(s) where it’s necessary, if
build/core/base_rules.mk:91: * appropriate.
build/core/base_rules.mk:92: *
build/core/base_rules.mk:93: * If the component should be in EVERY build of ALL
build/core/base_rules.mk:94: * products, then add its LOCAL_MODULE value to the
build/core/base_rules.mk:95: * PRODUCT_PACKAGES section of
build/core/base_rules.mk:96: * build/target/product/core.mk
build/core/base_rules.mk:97: *
build/core/base_rules.mk:98: *** user tag detected on new module – user tags are only supported on legacy modules. Stop.
make: Leaving directory `/work/gb’
去掉多余的libdiskconfig目标
build/core/base_rules.mk:158: *** bootable/newinstaller/libdiskconfig: MODULE.TARGET.SHARED_LIBRARIES.libdiskconfig already defined by system/core/libdiskconfig. Stop.
注释掉bootable/newinstaller/libdiskconfig/Android.mk中libdiskconfig相关代码
###########################
# shared library for target
#include $(CLEAR_VARS)
#LOCAL_SRC_FILES := $(commonSources)
#LOCAL_CFLAGS := -O2 -g -W -Wall -Werror
#LOCAL_MODULE := libdiskconfig
#LOCAL_MODULE_TAGS := system_builder
#LOCAL_SYSTEM_SHARED_LIBRARIES := libcutils liblog libc
#include $(BUILD_SHARED_LIBRARY)
将编译好的kernel拷贝到prebuilt下相应目录
carl@carl-amd64:/work/gb$ cp device/vm/vm/vm_defconfig prebuilt/android-x86/kernel/kernel_config_VirtualBox
carl@carl-amd64:/work/gb$ cp out/target/product/vm/kernel /work/gb/prebuilt/android-x86/kernel/kernel
开始全编译
carl@carl-amd64:/work/gb$ m -j3
stlport的问题解决
external/stlport/src/num_put_float.cpp: In function ‘bool std::priv::_Stl_is_nan_or_inf(double)’:
external/stlport/src/num_put_float.cpp:143: error: ‘IsNANorINF’ was not declared in this scope
external/stlport/src/num_put_float.cpp: In function ‘bool std::priv::_Stl_is_inf(double)’:
external/stlport/src/num_put_float.cpp:144: error: ‘IsNANorINF’ was not declared in this scope
external/stlport/src/num_put_float.cpp:144: error: ‘IsINF’ was not declared in this scope
external/stlport/src/num_put_float.cpp: In function ‘bool std::priv::_Stl_is_neg_inf(double)’:
external/stlport/src/num_put_float.cpp:145: error: ‘IsINF’ was not declared in this scope
external/stlport/src/num_put_float.cpp: In function ‘bool std::priv::_Stl_is_neg_nan(double)’:
external/stlport/src/num_put_float.cpp:146: error: ‘IsNegNAN’ was not declared in this scope
external/stlport/src/num_put_float.cpp: In function ‘char* std::priv::_Stl_ecvtR(double, int, int*, int*, char*)’:
external/stlport/src/num_put_float.cpp:280: error: ‘ecvt_r’ was not declared in this scope
external/stlport/src/num_put_float.cpp: In function ‘char* std::priv::_Stl_fcvtR(double, int, int*, int*, char*)’:
external/stlport/src/num_put_float.cpp:282: error: ‘fcvt_r’ was not declared in this scope
external/stlport/src/num_put_float.cpp: In function ‘char* std::priv::_Stl_ecvtR(long double, int, int*, int*, char*)’:
external/stlport/src/num_put_float.cpp:285: error: ‘qecvt_r’ was not declared in this scope
external/stlport/src/num_put_float.cpp: In function ‘char* std::priv::_Stl_fcvtR(long double, int, int*, int*, char*)’:
external/stlport/src/num_put_float.cpp:287: error: ‘qfcvt_r’ was not declared in this scope
target thumb C++: libstlport |
|