编译 stardict源码的时候, configure出错, google了下, 好多 linuxer遇到同样的问题:
dorainm@coffee $ ./configure --prefix=/usr --disable-gnome-support --with-x .........
checking for xgettext... /usr/bin/xgettext checking for catalogs to be installed... cs de el hu hr ku mk nl ru sk tt uk vi zh_CN zh_TW Disable gnome support checking for STARDICT... configure: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config.
Alternatively, you may set the environment variables STARDICT_CFLAGS and STARDICT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>. See `config.log dorainm@coffee $
|
开始 dorainm以为 pkg-config没有装, 或者没有在 $PATH里面, 但是 xterm下直接输入 pkg-config, 可以出来
dorainm@coffee $ pkg-config Must specify package names on command line dorainm@coffee $
|
版本是 0.20的
dorainm@coffee $ pkg-config --version 0.20
dorainm@coffee $
|
而且 PKG_CONFIG_PATH也没有错误啊
dorainm@coffee $ echo $PKG_CONFIG_PATH /usr/X11R6/lib/pkgconfig dorainm@coffee $
|
注意到, 错误提示里面, 后半段是
| set the PKG_CONFIG environment variable to the full path to pkg-config.
|
环境变量 PKG_CONFIG 没有指向 pkg-config的完全路径, 看下 PKG_CONFIG
dorainm@coffee $ echo $PKG_CONFIG
dorainm@coffee $
|
的确是空的, 看下 pkg-config 在哪个目录里面
dorainm@coffee $ find / -type f -name 'pkg-config' /usr/bin/pkg-config
dorainm@coffee $
|
现在设置环境变量, PKG_CONFIG
dorainm@coffee $ PKG_CONFIG=/usr/bin/pkg-config
dorainm@coffee $ echo $PKG_CONFIG
/usr/bin/pkg-config
dorainm@coffee $
|
设置好了, 重新 configure &*%$^@#%*@!)$)^&# 错误依旧...
突然想起来一样事情, expoort!
dorainm@coffee $ export PKG_CONFIG=/usr/bin/pkg-config
dorainm@coffee $ echo $PKG_CONFIG
/usr/bin/pkg-config
dorainm@coffee $
|
OKAY, 重新 configure, PASS!