Chinaunix首页 | 论坛 | 博客
  • 博客访问: 74181
  • 博文数量: 23
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 250
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-10 15:21
文章分类

全部博文(23)

文章存档

2010年(9)

2009年(4)

2008年(10)

我的朋友

分类: LINUX

2008-04-10 15:26:33

 

pkg-config

pkg-config is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler options on the command line so an application can use  gcc -o test test.c `pkg-config --libs --cflags glib-2.0`  for instance, rather than hard-coding values on where to find glib (or other libraries). It is language-agnostic, so it can be used for defining the location of documentation tools, for instance.

The program is free software and licensed under the version 2 or any later version (at your option).

pkg-config works on multiple platforms: Linux and other UNIX-like operating systems, Mac OS X and Windows. It does not require anything but a reasonably well working C compiler and a C library, but can use an installed glib if that is present. (A copy of glib 1.2.8 is shipped together with pkg-config and this is sufficient for pkg-config to compile and work properly.)

 

 

转载
pkg-config --list-all
列出所有可使用的包,位置在/usr/lib/pkgconfig , /usr/local/lib/pkgconfig下面的libname.pc文件,新软件一般都会安装.pc文件,没有可以自己创建,并且设置环境变量PKG_CONFIG_PATH寻找.pc文件路径。

得到一些参数,例如
#pkg-config --cflags libpcsclite
-lpthread -I/usr/local/include/PCSC
#pkg-config --libs libname
-L/usr/local/lib -lpcsclite

其他的config
ls /usr/bin/*config
 
阅读(4813) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:交叉编译-configure

给主人留下些什么吧!~~