3.3. 安装 Mesa

注意:这将为您提供libGLU*libglut*文件,这些文件可能在 XFree86 中缺失。XFree86 过去只附带 OpenGL 核心库,libGL(基于 Mesa)。 这也安装了 Mesa 的libGL,但我们将删除它,因为它将被 Nvidia libGL 替换。

您应该查看/usr/X11R6/lib查看您是否已经拥有 libglut.* 和 libGLU.*。 如果您有,您可以跳过安装 Mesa。 近期发布的 XFree86 已经开始将更多 Mesa 作为标准包含在内。

最好在安装新 Mesa 之前卸载您可能已安装的任何旧 Mesa 版本。 卸载软件可能是一个危险的操作,所以请明白您在做什么! 如果您有软件依赖于您的旧 Mesa,您可能需要保留它并仅安装新的 Mesa 与之并存。

要完全卸载可能随 Slackware 提供的任何 Mesa 库
		removepkg mesa
	
对于基于 rpm 的系统(如 RedHat 和 Mandrake),请尝试
		# see what will be removed first
		rpm -e --test Mesa | less
		# if ok, proceed
		rpm -e Mesa
	
对于 Debian,您可以尝试
		apt-get remove Mesa
	
其他发行版的步骤有所不同。 如果没有明确的方法卸载现有的 Mesa,那么至少确认它的安装位置:通常在/usr/usr/local。 下面的示例假设 Mesa 安装在(或即将安装在)/usr。 覆盖安装旧版本可能是无害的。 查找/usr/lib/libMesa*/usr/local/lib/libMesa*并删除它们,除非您有程序需要它们。

	# IF you are going to use the project GLUT distribution of GLUT, then
        # unpack the Glut-3.7 packages ...
	# Mesa's compile looks for it
	cd /usr/src
	tar -xvzf glut-3.7.tar.gz
	tar -xvzf glut_data-3.7.tar.gz
        # IF you are using this GLUT, use the --with-glut=/usr/src/glut-3.7
        # parameter with Mesa's ./configure below in addition to the --prefix

	cd /usr/src
	tar -xvzf MesaLib-4.0.1.tar.gz
	tar -xvzf MesaDemos-4.0.1.tar.gz
	cd Mesa-4.0.1
	./configure --prefix=/usr
	make
	make install
        ldconfig
	

重要提示:此时,Mesa 安装了它自己的版本glx.h包含文件,覆盖了 XFree86 安装的文件。 这将导致某些程序编译失败,通过将 XFree86 GL 包含文件从 X 源代码复制回您的系统来纠正
	cp /usr/src/release/xc/include/GL/*.h /usr/X11R6/include/GL