哪位大虾能帮我分析下这个脚本
发表于 : 2008-11-23 15:10
我在安装atk的时候出错,就是cofigure时就出错了
提示是这样的:
checking for GLIB - version >= 2.0.0...
*** 'pkg-config --modversion glib-2.0' returned 2.18.0, but GLIB (2.18.2)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files
。。。。
首先我用的是UBUNTU8.10的,后来发现他内部是装了glib的2.18.2的,但是我又装了一个2.18.0在usr/local/lib下面,也可以从 'pkg-config --modversion glib-2.0' returned 2.18.0这里看出来,说明.pc文件也找到了~~~
然后去看他的configure文件,定为到出错的那部分
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
这应该就是读glib版本号,我的理解,因为pkg_config --modversiong是读版本的命令
后面内嵌C代码的语句:
if ((glib_major_version != $glib_config_major_version) ||
(glib_minor_version != $glib_config_minor_version) ||
(glib_micro_version != $glib_config_micro_version))
{
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
printf ("*** was found! If pkg-config was correct, then it is best\n");
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
printf("*** to point to the correct configuration files\n");
}
应该说是判断到了版本出错了,所以执行后面的printf语句。我对shell语言不是很懂,C语言还算有点了解的,菜鸟一个,我不知道glib_micro_version和$glib_micro_version这2个变量到底有什么区别~~~这里很明显是这2个变量不一致才出错的
提示是这样的:
checking for GLIB - version >= 2.0.0...
*** 'pkg-config --modversion glib-2.0' returned 2.18.0, but GLIB (2.18.2)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files
。。。。
首先我用的是UBUNTU8.10的,后来发现他内部是装了glib的2.18.2的,但是我又装了一个2.18.0在usr/local/lib下面,也可以从 'pkg-config --modversion glib-2.0' returned 2.18.0这里看出来,说明.pc文件也找到了~~~
然后去看他的configure文件,定为到出错的那部分
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
这应该就是读glib版本号,我的理解,因为pkg_config --modversiong是读版本的命令
后面内嵌C代码的语句:
if ((glib_major_version != $glib_config_major_version) ||
(glib_minor_version != $glib_config_minor_version) ||
(glib_micro_version != $glib_config_micro_version))
{
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
printf ("*** was found! If pkg-config was correct, then it is best\n");
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
printf("*** to point to the correct configuration files\n");
}
应该说是判断到了版本出错了,所以执行后面的printf语句。我对shell语言不是很懂,C语言还算有点了解的,菜鸟一个,我不知道glib_micro_version和$glib_micro_version这2个变量到底有什么区别~~~这里很明显是这2个变量不一致才出错的