1、把下载的最新源码spice-gtk-0.31.tar.bz2解压缩到/usr/local/src目录下,解压缩成功会在/usr/local/src目录下产生一个spice-gtk-0.31目录
2、进入spice-0.13.1目录,会看到源码和configure等文件;
3、首先执行一下configure脚本,
./configure --prefix=/usr/local/spice (要确保存在/usr/local/spice目录)会提示:
./configure: line 13056: intltool-update: command not found
checking for intltool >= 0.40.0... found
configure: error: Your intltool is too old. You need intltool 0.40.0 or later.
解决方法:首先查看一下intltool的包名,然后查看是否安装,最后安装或者更新intltool。
[root@localhost spice]# yum list|grep intltool
intltool.noarch 0.50.2-6.el7 base
[root@localhost spice]# rpm -qi intltool.noarch
package intltool.noarch is not installed
[root@localhost spice]# yum install intltool.noarch
4、再次执行./configure --prefix=/usr/local/spice,出现下面错误提示:
checking which gtk+ version to compile against... checking for GTK... no
configure: error: Package requirements (gtk+-3.0 >= 2.91.3) were not met:
No package 'gtk+-3.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
通过系统中查找gtk3,发现系统中已经安装,如下:
[root@localhost spice]# rpm -qi gtk3
Name : gtk3
Version : 3.14.13
Release : 16.el7
Architecture: x86_64
Install Date: Wed 25 May 2016 10:34:24 AM CST
Group : System Environment/Libraries
Size : 15972385
License : LGPLv2+
Signature : RSA/SHA256, Wed 25 Nov 2015 10:39:59 PM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : gtk3-3.14.13-16.el7.src.rpm
Build Date : Sat 21 Nov 2015 01:36:11 AM CST
Build Host : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://www.gtk.org
Summary : The GIMP ToolKit (GTK+), a library for creating GUIs for X
Description :
GTK+ is a multi-platform toolkit for creating graphical user
interfaces. Offering a complete set of widgets, GTK+ is suitable for
projects ranging from small one-off tools to complete application
suites.
因此我们可以知道是需要安装gtk3的开发包的,相信系统中没有安装,
[root@localhost spice]# rpm -qi gtk3-devel.x86_64
package gtk3-devel.x86_64 is not installed
[root@localhost spice]# yum install gtk3-devel.x86_64
5、再次执行./configure --prefix=/usr/local/spice,结果正确了,不过有警告,想要去除警告,就需要自己去添加这些需要的开源库了:
configure: creating ./config.status
config.status: creating Makefile
config.status: creating common/Makefile
config.status: creating python_modules/Makefile
config.status: creating tests/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure:
Spice-Gtk 0.31
==============
prefix: /usr/local/spice
c compiler: gcc -std=gnu99
Target: Unix
Gtk: 3.0
Coroutine: ucontext
PulseAudio: no
GStreamer Audio: no
SASL support: no
Smartcard support: no
USB redirection support: no
DBus: yes
WebDAV support: no
LZ4 support: auto
epoxy: no
Now type 'make' to build spice-gtk
configure: WARNING: No PulseAudio or GStreamer 1.0 audio decoder, audio will not be streamed
6、现在可以执行make命令,但是最好先执行make clean,然后在执行make:
7,最后一步:make install