官方文档:https://github.com/lvc/abi-compliance-checker/blob/master/doc/Xml-Descriptor.html
Primary Sections 初级部分
<version>
/* Version of the library 库的版本 */
</version>
<headers>
/*
The list of paths to header files or/and
directories with header files, one per line
头文件或/和带有头文件的目录的路径列表,每行一个
补充说明:
1)这里的路径一般是绝对路径。如果是相对路径,需要其它标签协助,
目的就是能准确找到相应的头文件。
*/
</headers>
<libs>
/*
The list of paths to shared libraries or/and
directories with shared libraries, one per line
共享库或/和共享库目录的路径列表,每行一个
补充说明:
1)这里的路径一般是绝对路径。如果是相对路径,需要其它标签协助,
目的就是能准确找到相应的库。
*/
</libs>
Optional Sections 可选部分
<include_paths>
/*
The list of paths to be searched for header files
needed for compiling of library headers, one per line.
NOTE: If you define this section then the tool
will not automatically detect include paths
编译库头文件所需的头文件搜索路径列表,每行一个。
注意:如果您定义此部分,则该工具将不会自动检测包含路径
补充说明:
1)该部分定义头文件搜索路径
2)如果不定义该部分,工具将会自动检测headers标签中定义的头文件的路径,
并将检测到的路径加到头文件搜索路径中(通过gcc的-I选项添加)。如果定义该部分,
工具就直接使用该部分定义的路径搜索头文件,不再自动检测。
3)这里的路径一般是绝对路径
*/
</include_paths>
<add_include_paths>
/*
The list of include paths that should be added
to the automatically detected include paths, one per line
应添加到自动检测到的包含路径中的包含路径列表,每行一个
补充说明:
1)该部分定义的包含路径列表,最终会添加到工具自动检测的包含路径中,
即也作为头文件搜索路径,可以作为自动检测的补充
2)这里的路径一般是绝对路径
*/
</add_include_paths>
<skip_include_paths>
/*
The list of include paths that will be removed from
the list of automatically generated include paths, one per line
将从自动生成的包含路径列表中删除的包含路径列表,每行一个
补充说明:
1)工具自动生成的包含路径列表中可能存在一些路径,它们并不需要作为头文件搜索路径,
因为有可能这些路径下的头文件和系统路径的头文件名称相同,当需要使用系统头文件时,
实际可能使用了这些路径下的头文件,这可能导致意想不到的问题,这时候就需要把这些路径去掉,
将需要去掉的路径定义在该部分中即可。
2)这里的路径一般是绝对路径
*/
</skip_include_paths>
<gcc_options>
/* Additional GCC options, one per line 额外的 GCC 选项,每行一个 */
</gcc_options>
<include_preamble>
/*
The list of header files that should be included before other headers,
one per line. For example, it is a tree.h for libxml2 and
ft2build.h for freetype2 library
应该在其他头文件之前包含的头文件列表,每行一个。
例如,libxml2 的 tree.h 和 freetype2 库的 ft2build.h
补充说明:
1)有些头文件包含是有顺序的,
而工具处理的头文件是遍历headers标签中定义的头文件和/或头文件目录中的头文件,
它们的顺序是不确定的,这可能导致编译报错(比如:标识符声明找不到),
这时就需要人工调整头文件顺序,将必要的头文件前置。
2)这里的路径一般是相对路径
*/
</include_preamble>
<defines>
/*
Add defines at the headers compiling stage, one per line:
在头文件编译阶段添加定义,每行一个
#define A B
#define C D
补充说明:
1)有些头文件中是需要不同的条件宏/配置项来做不同的处理,
这些配置可能会定义在用户的config.h文件中,config.h文件往往是开放给用户的,
软件本身不提供config.h文件,这就可能导致编译失败,此时就需要定义相关宏。
*/
</defines>
<add_namespaces>
/*
The list of namespaces that should be added to the alanysis
if the tool cannot find them automatically, one per line
如果工具无法自动找到命名空间,则应添加到分析中的命名空间列表,每行一个
*/
</add_namespaces>
<skip_types>
/*
The list of data types, that should not be checked, one per line
不应该检查的数据类型列表,每行一个
*/
</skip_types>
<skip_symbols>
/*
The list of functions (mangled/symbol names in C++),
that should not be checked, one per line
不应检查的函数列表(C++ 中的错误/符号名称),每行一个
*/
</skip_symbols>
<skip_namespaces>
/*
The list of C++ namespaces, that should not be checked, one per line
不应检查的 C++ 命名空间列表,每行一个
*/
</skip_namespaces>
<skip_constants>
/*
The list of constants that should not be checked, one name per line
不应检查的常量列表,每行一个名称
*/
</skip_constants>
<skip_headers>
/*
The list of header files and/or directories with header files
that should not be checked, one per line
不应该检查的头文件和/或包含头文件的目录列表,每行一个
补充说明:
1)重复包含
有时候头文件没有设计好防重复包含,这些头文件又被本软件其它头文件包含,
这在编译时会报重复定义错误,这时就需要直接跳过被包含的头文件,它们会被间接包含参与编译。
2)重复定义
有时候软件本身在头文件中定义的类型和系统头文件定义的类型重复,如果这两个头文件同时被使用,
编译时将包重复定义错误,这时可能需要跳过本身定义类型所在的头文件。
3)私有头文件
有时候有些头文件是私有头文件,不能直接包含(包含前需要做预处理),
它们往往被本软件的其它开放头文件间接包含,用户使用时,
只能包含这些开放的头文件,此时就需要跳过这些私有头文件。
4)无效头文件
有的头文件里面内容不是有效的c/c++内容,这些头文件不能正常被编译,需要跳过。
5)错误头文件
有的头文件中有语法错误,而这些头文件又没有被软件本身使用,所以没发现编译错误,需要跳过。
6)对应headers标签
*/
</skip_headers>
<skip_libs>
/*
The list of shared libraries and/or directories with shared libraries
that should not be checked, one per line
不应检查的共享库和/或包含共享库的目录列表,每行一个
*/
</skip_libs>
<skip_including>
/*
The list of header files, that cannot be included directly
(or non-self compiled ones), one per line
不能直接包含的头文件列表(或非自编译的),每行一个
补充说明:
1)跳过无法解决的头文件,参考skip_headers中的情况
2)这里的路径一般是相对路径
*/
</skip_including>
<search_headers>
/*
List of directories to be searched for header files
to automatically generate include paths, one per line
要搜索头文件以自动生成包含路径的目录列表,每行一个
*/
</search_headers>
<search_libs>
/*
List of directories to be searched for shared librariess
to resolve dependencies, one per line
要搜索共享库以解决依赖关系的目录列表,每行一个
*/
</search_libs>
<tools>
/*
List of directories with tools used for analysis (GCC toolchain),
one per line
包含用于分析的工具的目录列表(GCC 工具链),每行一个
*/
</tools>
<cross_prefix>
/*
GCC toolchain prefix. GCC 工具链前缀。
Examples:
arm-linux-gnueabi
arm-none-symbianelf
*/
</cross_prefix>