我用的系統是Fedora髮型版的Linux系統,對其他版本的linux系統可能有一些地方有點差異。
下面就以Fedora系統為例:
1、安裝libtool輸入命令:yum install libtool2、安裝glproto:http://ftp.de.debian.org/debian/pool/main/x/x11proto-gl/x11proto-gl_1.4.15.orig.tar.gz解壓命令:tar -xvf x11proto-gl_1.4.15.orig.tar.gz進入:cd glproto-1.4.15./config --build=mips64el-unknown-linux-gnu --prefix=/usr/不用make直接:make install3、安裝dri2proto:http://xorg.freedesktop.org/archive/individual/proto/dri2proto-2.8.tar.bz2解壓命令:tar -xvf dri2proto-2.8.tar.bz2進入:cd dri2proto-2.8./config --build=mips64el-unknown-linux-gnu --prefix=/usr/不用make直接:make install4、安裝libdrm:http://dri.freedesktop.org/libdrm/libdrm-2.4.40.tar.bz2解壓命令:tar -xvf libdrm-2.4.40.tar.bz2進入:cd libdrm-2.4.40./config --build=mips64el-unknown-linux-gnu --prefix=/usr/makemake install5、安裝xcb-proto:http://ftp.de.debian.org/debian/pool/main/x/xcb-proto/xcb-proto_1.7.1.orig.tar.xz解壓命令:tar -xvf xcb-proto_1.7.1.orig.tar.xz進入:cd xcb-proto_1.7.1./autogen.sh./config --build=mips64el-unknown-linux-gnu --prefix=/usr/makemake install6、安裝xcb-glx:http://ftp.de.debian.org/debian/pool/main/libx/libxcb/libxcb_1.8.1.orig.tar.gz解壓命令:tar -xvf libxcb_1.8.1.ori.tar.gz進入:cd libxcb_1.8.1./config --build=mips64el-unknown-linux-gnu --prefix=/usr/makemake install7、安裝xproto:http://xorg.freedesktop.org/archive/individual/proto/xproto-7.0.23.tar.gz解壓命令:tar -xvf xproto-7.0.23.tar.gz進入:cd xproto-7.0.23./config --build=mips64el-unknown-linux-gnu --prefix=/usr/makemake install8、安裝x11-xcb:http://ftp.de.debian.org/debian/pool/main/libx/libx11/libx11_1.5.0.orig.tar.gz解壓命令:tar -xvf libx11_1.5.0.orig.tar.gz進入:cd libx11_1.5.0./config --build=mips64el-unknown-linux-gnu --prefix=/usr/makemake install以上都是mesa9.0的依賴庫,所以要先裝,不然mesa在configure時會出錯。在安裝以上一些依賴庫是會出現一些缺少另一些庫的錯誤:如:上面的錯誤就是缺少了xtrans這樣的庫你可以用命令:yum search xtrans來搜這樣的庫,然後用:yum install xxx 來安裝搜到的。或者到網站:http://ftp.de.debian.org/debian/pool/main或者:http://xorg.freedesktop.org/中去找缺的庫,下載下來,解壓在安裝上,安裝步驟如上面庫的安裝。9、安裝mesa9.0:ftp://freedesktop.org/pub/mesa/9.0/MesaLib-9.0.tar.bz2解壓命令:tar -xvf MesaLib-9.0.tar.bz2進入:cd Mesa-9.0./autogen.sh修改configure檔案,檔案內容如下:
# default drivers if test "x$DRI_DIRS" = "xyes"; then DRI_DIRS="i915 i965 nouveau r200 radeon swrast" fi修改為:# default drivers if test "x$DRI_DIRS" = "xyes"; then DRI_DIRS=" nouveau r200 radeon swrast" fi
去掉預設的驅動配置,因為我的顯卡是用的整合了ati的3200hd顯卡,所以只需要與我配套的選項。否則configure無法通過。
./config --build=mips64el-unknown-linux-gnu --prefix=/usr/ --enable-gles1 --enable-gles2後面的配置參數是開啟OpenGL ESmake -j4make install
安裝成功後,可以用linux中內建的齒輪例子測試一下:glxgears -info可以看到以下內容:
- GL_RENDERER = Gallium 0.4 on AMD RS780
- GL_VERSION = 2.1 Mesa 9.0
- GL_VENDOR = X.Org
搞定收工!