|
|
发表于 2005-2-25 20:24:33
|
显示全部楼层
请参考pkg-config manpage中的一段话:
The pkg-config program is used to retrieve information about installed libraries in the system. It is typically used to compile and link against one or more libraries. Here is a typical usage scenario in a Makefile:
program: program.c
cc program.c `pkg-config --cflags --libs gnomeui`
pkg-config retrieves information about packages from special metadata files. These files are named after the package, with the extension .pc. By default, pkg-config looks in the directory prefix/lib/pkgconfig for these files; it will also look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.
The package name specified on the pkg-config command line is defined to be the name of the metadata file, minus the .pc extension. If a library can install multiple versions simultaneously, it must give each version its own name (for example, GTK 1.2 might have the package name "gtk+" while GTK 2.0 has "gtk+-2.0").
pkg-config用来获取系统所安装的库文件信息,通常用来编译、链接库文件。下面是在一份Makefile文件中的典型用法:
program: program.c
cc program.c `pkg-config --cflags --libs gnomeui`
pkg-config从特定的元数据文件获取包信息。这些文件按包命名,以.pc扩展结束。默认情况下,pkg-config在目录 prefix/lib/pkg-config下寻找这些文件;它也读取PKG_CONFIG_PATH 环境变量指定的、以冒号分隔(在windows下,以分号分隔)的目录列表。
在pkg-config命令行指定的包名称定义为元数据文件的名称减去.pc扩展。如果一个库可以同时安装多个版本,每个版本必须有自己的名称(例如,GTK 1.2可能用包名称“gtk+”,而GTK 2.0为”gtk+-2.0”)。 |
|