mesa編譯

0. 準備工作

sudo apt-get install git autoconf libtool dpkg-dev quilt debhelper

1. libdrm編譯

# 下載
git clone http://anongit.freedesktop.org/git/mesa/drm.git
cd drm
git checkout -b libdrm-2.4.60 libdrm-2.4.60

# 依賴
sudo apt-get install libpciaccess-dev
sudo apt-get install xutils-dev

# 編譯
./autogen.sh
./configure
make
make install

1.1 問題處理

autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4 ${ACLOCAL_FLAGS}
configure.ac:33: error: must install xorg-macros 1.12 or later before running autoconf/autogen
configure.ac:33: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: /usr/bin/autom4te failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

解決方法:

sudo apt-get install xutils-dev

2. mesa編譯

# 下載
wget -c https://launchpad.net/ubuntu/+archive/primary/+files/mesa_10.5.9.orig.tar.gz
wget -c https://launchpad.net/ubuntu/+archive/primary/+files/mesa_10.5.9-2ubuntu1~vivid2.diff.gz
tar zxvf mesa_10.5.9.orig.tar.gz
gunzip mesa_10.5.9-2ubuntu1~vivid2.diff.gz
patch -p0 < ./mesa_10.5.9-2ubuntu1~vivid2.diff

# 依賴
sudo apt-get install libudev-dev
sudo apt-get install libexpat1-dev
sudo apt-get install libxcb-xfixes0-dev

# 編譯
debian/rules
debian/rules build
sudo debian/rules install

2.1 問題1 dpkg

問題:

make: dpkg-architecture: Command not found

處理方法:

sudo apt-get install dpkg-dev

2.2 問題2 dri3proto

問題:

checking for DRI3PROTO... no
configure: error: Package requirements (dri3proto >= 1.0) were not met:

No package 'dri3proto' found

臨時處理方法:
修改debian\rules中

  ifeq ($(DEB_HOST_ARCH_OS), linux)
#   confflags_DRI3 = --enable-dri3

2.3 問題3 libdrm

問題:

configure: error: Package requirements (libdrm_intel >= 2.4.60) were not met:

Requested 'libdrm_intel >= 2.4.60' but version of libdrm_intel is 2.4.52

解決辦法(不需要):

export PKG_CONFIG_PATH=/opt/candidates/lib/pkgconfig/

2.4 問題4 vdpau

問題:

checking for VDPAU... no
configure: error: Package requirements (vdpau >= 0.4.1) were not met:

No package 'vdpau' found

處理方法:修改debian\rules中

#   confflags_GALLIUM += --enable-vdpau

2.5 問題5 wayland

問題:

checking for WAYLAND... no
configure: error: Package requirements (wayland-client >= 1.2.0 wayland-server >= 1.2.0) were not met:

No package 'wayland-client' found
No package 'wayland-server' found

處理方法:

sudo apt-get install libwayland-dev-lts-trusty 

2.6 問題6 mir

問題:

checking for MIR... no
configure: error: Package requirements (mir-client-platform-mesa-dev) were not met:

No package 'mir-client-platform-mesa-dev' found

處理方法:修改debian\rules中

# Mir isn't built on AArch64 and PPC
#    ifeq (,$(filter $(DEB_HOST_ARCH),arm64 powerpc ppc64 ppc64el))
#   EGL_DISPLAYS += mir
#    endif

2.7 問題7 llvm 3.6

../../configure: line 23842: llvm-config-3.6: command not found
../../configure: line 23843: llvm-config-3.6: command not found
../../configure: line 23844: llvm-config-3.6: command not found
../../configure: line 23611: llvm-config-3.6: command not found
../../configure: line 23611: llvm-config-3.6: command not found
../../configure: line 23848: llvm-config-3.6: command not found
../../configure: line 23849: llvm-config-3.6: command not found
../../configure: line 23873: test: : integer expression expected
../../configure: line 23878: llvm-config-3.6: command not found

解決方法1:繞過

#  ifeq (,$(filter $(DEB_HOST_ARCH), s390 s390x))
#    DRI_DRIVERS += r200 radeon
#    GALLIUM_DRIVERS += r600 r300
#  endif

#  ifneq (,$(filter $(DEB_HOST_ARCH),amd64 i386 kfreebsd-amd64 kfreebsd-i386 armhf))
#   GALLIUM_DRIVERS += radeonsi
#   confflags_GALLIUM += --enable-gallium-llvm
#   confflags_GALLIUM += ac_cv_path_LLVM_CONFIG=llvm-config-3.6
#  endif

解決方法2 :安裝llvm 3.6

sudo vi /etc/apt/sources.list

# add
deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main
deb-src http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main

# key
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -

再遇到問題(解決方法2):

The following packages have unmet dependencies:
 llvm-3.6 : Depends: llvm-3.6-runtime (= 1:3.6.2~svn240577-1~exp1) but it is not going to be installed
            Depends: libllvm3.6 but it is not going to be installed
            Depends: libstdc++6 (>= 4.9) but 4.6.3-1ubuntu5 is to be installed
            Recommends: llvm-3.6-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

解決辦法:

deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main 
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main 

並且
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F

sudo apt-get install libstdc++-4.9-dev
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章