system/core/下面的lib*库分析
编者:厦门大学信息学院通信工程系2015级研究生 史星辉, 电子工程系2015级研究生龙志军、江志明
1、lib*库分支
2、 libbacktrace库目录分析
2.1 libbacktrace/Android.mk
LOCAL_PATH := $(call my‐dir) Android.mk 开始必须定义变量LOCAL PATH _PATH,它用来指定源文件的位置。 my‐dir: 编译系统提供的'my‐dir'宏函数,被用来获取当前的目录 The libbacktrace library. libbacktrace_src_files := \ Backtrace.cpp \ BacktraceCurrent.cpp \ BacktraceMap.cpp \ BacktracePtrace.cpp \ thread_utils.c \ ThreadEntry.cpp \ UnwindCurrent.cpp \ UnwindMap.cpp \ UnwindPtrace.cpp \ 定义变量LOCAL PATH _PATH,它用来指定源文件的位置 include $(LOCAL_PATH)/Android.build.mk build_type := host libbacktrace_multilib := both include $(LOCAL_PATH)/Android.build.mk Special truncated libbacktrace library for mac. ifeq ($(HOST_OS),darwin) include $(CLEAR_VARS) LOCAL_MODULE := libbacktrace LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := \ BacktraceMap.cpp \ LOCAL_MULTILIB := both include $(BUILD_HOST_SHARED_LIBRARY) 编译当前目录子目录下的,以及子目录的libc目录下的Android.mk文件。
2.2 libbinderwrapper/Android.mk
LOCAL_PATH := $(call my-dir) binderwrapperCommonCFlags := -Wall -Werror -Wno-unused-parameter binderwrapperCommonCFlags += -Wno-sign-promo # for libchrome binderwrapperCommonExportCIncludeDirs := $(LOCAL_PATH)/../include binderwrapperCommonCIncludes := $(LOCAL_PATH)/../include binderwrapperCommonSharedLibraries := \ libbinder \ libchrome \ libutils \ libbinderwrapper shared library include $(CLEAR_VARS) LOCAL_MODULE := libbinderwrapper LOCAL_CPP_EXTENSION := .cc LOCAL_CFLAGS := $(binderwrapperCommonCFlags) LOCAL_EXPORT_C_INCLUDE_DIRS := $(binderwrapperCommonExportCIncludeDirs) LOCAL_C_INCLUDES := $(binderwrapperCommonCIncludes) LOCAL_SHARED_LIBRARIES := $(binderwrapperCommonSharedLibraries) LOCAL_SRC_FILES := \ binder_wrapper.cc \ real_binder_wrapper.cc \ include $(BUILD_SHARED_LIBRARY) libbinderwrapper_test_support shared library include $(CLEAR_VARS) LOCAL_MODULE := libbinderwrapper_test_support LOCAL_CPP_EXTENSION := .cc LOCAL_CFLAGS := $(binderwrapperCommonCFlags) LOCAL_EXPORT_C_INCLUDE_DIRS := $(binderwrapperCommonExportCIncludeDirs) LOCAL_C_INCLUDES := $(binderwrapperCommonCIncludes) LOCAL_STATIC_LIBRARIES := libgtest LOCAL_SHARED_LIBRARIES := \ $(binderwrapperCommonSharedLibraries) \ libbinderwrapper \ LOCAL_SRC_FILES := \ binder_test_base.cc \ stub_binder_wrapper.cc \ include $(BUILD_SHARED_LIBRARY)
3、参考链接
http://wiki.qemu.org/Documentation/Networking https://en.wikibooks.org/wiki/QEMU/Networking https://wiki.debian.org/QEMU https://wiki.archlinux.org/index.php/QEMU#Networking https://www.brobwind.com/archives/102 http://www.cnblogs.com/leaven/archive/2011/01/25/1944688.html