N=1

主にコンピュータ技術関連のことを投稿。 / 投稿は個人の意見であり所属団体の立場を代表するものではありません。

X11R7.1 ビルドに挑戦

http://wiki.x.org/wiki/ModularDevelopersGuide
http://tdiary.flowernet.gr.jp/masm/?date=20060617
http://minabe.dip.jp/d/20060529.html
の三つを参考にさせていただきました

男らしくいきなり /usr に入れます。さらに /usr/X11R6 は削除してしまっった

ModularDeveloperGuide に大体のことは書いてた
R6.9 までと違ってmake world; make install で全部入るわけじゃなく、個々のモジュールがバラバラに tarball のパッケージになっている。一個一個手で make していくのにはつらい量。
X11R7.0 と X11R7.1 のパッケージを全部とってくる。ftp クライアントとか wget で工夫しないといけない。ミラーサイトの、X11R7.[01]/src/everything にある
libdrm とかを先にいれておかないといけない。MesaDemo MesaGLUT MesaLib のソースをてきとうに展開しておく
大量のパッケージのインストールを自動化するスクリプトが MolularDevelopersGuide にあるからもらってくる(build-from-tarballs.sh)
スクリプトを編集する。最適化オプションとか、PKG_CONFIG_PATH を最初の方で書いておく
必要ないモジュールもあるのでそいういうのはコメントアウトした。コメントにちゃんと依存関係が書いてあるので注意。各パッケージの内容が http://lists.x.org/archives/xorg-modular/2005-November/000801.html で解説されてた。フォントとかドライバ関係は不要なのがわかりやすいんだけどライブラリは分からなかったからいじらなかった。xlogo とか xeyss 要らないなぁ
パッケージのアーカイブ全部と、build-from-tarball.sh を一緒のディレクトリに入れて実行!

$ CACHE=/home/ishn/src/xorg/config.cache ./build-from-tarballs.sh -m /home/ishn/src/xorg/Mesa-6.5.1 -e /usr -s sudo 2>&1 | tee build.log
checking for library containing glXGetProcAddressARB... no
configure: error: cannot find GL library - make sure Mesa or other OpenGL package is installed
See `config.log' for more details.

Mesa はソースを指定するだけじゃなくてインストールしなきゃ駄目なのかぁ。ということで Mesa-6.5.1 入れる(configs/linuxを編集してから make linux-x86 ; make install)。そして再挑戦

Checking that the source files exist for mesa module ...
   error:   /home/ishn/src/xorg/Mesa-6.5.1/src/mesa/shader/slang/library/slang_version_syn.h not found
configure: error: Failed to link Mesa source tree.  Please specify a proper path to Mesa sources, or disable GLX.

ぐぐってみたら、xorg-server-X11R7.1-1.1.0 は Mesa-6.5 のあたりで作られたらしくて、6.5.1 だとファイル構成が変わっていて失敗してしまうらしい。Mesa 6.5 いれなおして、build-from-tarballs.sh の -m のパスを変えて再開

 gcc -DHAVE_CONFIG_H -I. -I. -I../../../../include -I../../../../include -I../../../../include -I../../../../include -I../../../../include -I../../../../include -I../../../../include -I../../../../include -I../../../../hw/xfree86 -I../../../../hw/xfree86/include -I../../../../hw/xfree86/common -I../../../../hw/xfree86/os-support -I../../../../hw/xfree86/os-support/bus -I../../../../os -I/usr/include/drm -DUSESTDRES -DHAVE_SYSV_IPC -DHAVE_XORG_CONFIG_H -DXF86PM -DHAVE_ACPI -DHAVE_APM -DXFree86Server -DXFree86LOADER -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I../../../../include -I../../../../include -I../../../../Xext -I../../../../composite -I../../../../damageext -I../../../../xfixes -I../../../../Xi -I../../../../mi -I../../../../miext/shadow -I../../../../miext/damage -I../../../../render -I../../../../randr -I../../../../fb -O2 -fforce-addr -fomit-frame-pointer -funroll-loops -march=athlon -c lnx_agp.c  -fPIC -DPIC -o .libs/lnx_agp.o
In file included from lnx_agp.c:24:
/usr/include/linux/agpgart.h:55: error: parse error before "__u16"
/usr/include/linux/agpgart.h:60: error: field `version' has incomplete type
/usr/include/linux/agpgart.h:61: error: parse error before "__u32"
/usr/include/linux/agpgart.h:68: error: parse error before '}' token
/usr/include/linux/agpgart.h:71: error: parse error before "__u32"
/usr/include/linux/agpgart.h:92: error: parse error before "__u32"
/usr/include/linux/agpgart.h:106: error: parse error before "__u32"
lnx_agp.c: In function `GARTInit':
lnx_agp.c:65: error: storage size of 'agpinf' isn't known
lnx_agp.c:65: warning: unused variable `agpinf'
lnx_agp.c: In function `xf86GetAGPInfo':
lnx_agp.c:129: error: storage size of 'agpinf' isn't known
lnx_agp.c:129: warning: unused variable `agpinf'
lnx_agp.c: In function `xf86AllocateGARTMemory':
lnx_agp.c:221: error: storage size of 'alloc' isn't known
lnx_agp.c:221: warning: unused variable `alloc'
lnx_agp.c: In function `xf86UnbindGARTMemory':
lnx_agp.c:324: error: storage size of 'unbind' isn't known
lnx_agp.c:324: warning: unused variable `unbind'
lnx_agp.c: In function `xf86EnableAGP':
lnx_agp.c:356: error: parse error before "setup"
lnx_agp.c:361: error: `setup' undeclared (first use in this function)
lnx_agp.c:361: error: (Each undeclared identifier is reported only once
lnx_agp.c:361: error: for each function it appears in.)
make[5]: *** [lnx_agp.lo] Error 1
make[5]: Leaving directory `/home/ishn/src/xorg/xorg-server-X11R7.1-1.1.0/hw/xfree86/os-support/linux'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/ishn/src/xorg/xorg-server-X11R7.1-1.1.0/hw/xfree86/os-support'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/ishn/src/xorg/xorg-server-X11R7.1-1.1.0/hw/xfree86'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/ishn/src/xorg/xorg-server-X11R7.1-1.1.0/hw/xfree86'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ishn/src/xorg/xorg-server-X11R7.1-1.1.0/hw'
make: *** [all-recursive] Error 1

またぐぐってみると、kernel header のバグかなんか。他のパッケージでも問題がでているらしい(dosemuとか)。LFS からパッチがでている( http://www.linuxfromscratch.org/patches/downloads/glibc/glibc-2.3.6-linux_types-1.patch )のでDLして /usr/include/sys にあてる
デキタ───(・3・)───!

あとは /etc/X11 を一応リネームしておいて、/usr/lib/X11/xorg.conf を編集して動いた。nvidia 謹製ドライバは後から入れ直したら/usr/X11R6 じゃなく、ちゃんと /usr/lib 等、適切な位置に入った。

後からわかったこと: serverは Mesa に依存、Mesa は libs, utils に依存。libs > utils > Mesa > server の順にすればいい

次回まとめます