https://smart888.taobao.com/ 立观智能监控
分类: LINUX
2009-03-18 15:51:01
由于需要,前面一段时间搜索了一下网上关于tinyX编译的文章,国内网站没有什么有用的文章(也可能是我没有看懂)。想下载tinyX的代码,结果只下载了X的代码。后面经过一番折腾,终于交叉编译tinyx成功,过程简单,特写出来共享一下。当然在freedesktop.org上你可以找到更详细的指导!
1\代码:您可以在下载到tinyX的代码,由于我的linux机器无法连接到internet,所以在window下手动下载了代码,这里可能需要你一个个文件下载,我没有发现已经打包好的。要不你在仔细找找!
2\编译:在下载了你想要的库后,你会发现它里面有个编译脚本,这个只是普通编译的脚本,如果想要交叉编译,需要修改一下。
1)编译之前请检查一下你的工具配置情况(这一点很重要):
autoconf --version must report 2.59 or later
automake --version must report 1.9.x
libtool --version must report 1.5 (available from if your distribution doesn't have it)
pkg-config --version must report 0.9.0 or later
2)问题:
如果遇到这种问题:
checking for pkg-config... /opt/gnome2/bin/pkg-configchecking pkg-config is at least version 0.9.0... yeschecking for XDMCP... yeschecking for XdmcpWrap in -lXdmcp... yeschecking for XEPHYR... yeschecking for XSERVER... configure: error: Package requirements (randrproto renderproto fixesproto damageproto xextproto xfont xproto xtrans xau compositeproto resourceproto recordproto xdmcp xdmcp) were not met.Consider adjusting the PKG_CONFIG_PATH environment variable if youinstalled software in a non-standard prefix. Alternatively you may set the XSERVER_CFLAGS and XSERVER_LIBS environment variablesto avoid the need to call pkg-config. See the pkg-config man page formore details.*** error during stage configure of xserver: could not configure module *** [32/38] 这可能是.pc文件问题,请做以下链接:
cd /opt/fdo/lib/pkgconfigln -s randr.pc randrproto.pcln -s render.pc renderproto.pcln -s fixesext.pc fixesproto.pcln -s damageext.pc damageproto.pcln -s xext.pc xextproto.pcln -s compositeext.pc compositeproto.pcln -s resourceext.pc resourceproto.pcln -s recordext.pc recordproto.pc
3)编译脚本:这是它的编译脚本,有个问题,每次运行它都要重头开始。有时间哪位兄弟修改一下,
免得每次编译都要花很长时间,特别是在虚拟机上。编译脚本如下:
cvs login is no longer required when using cvs.freedesktop.org.if [ -z "$PKG_CONFIG_PATH" ]; thenexport PKG_CONFIG_PATH=/opt/fdo/lib/pkgconfigelseexport PKG_CONFIG_PATH="/opt/fdo/lib/pkgconfig:$PKG_CONFIG_PATH"ficvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xprotopushd Xproto./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xdmcppushd Xdmcp./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co XExtensionspushd XExtensions./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co xtranspushd xtrans./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xaupushd Xau./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co X11pushd X11./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xextpushd Xext./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Randrpushd Randr./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Renderpushd Render./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xrenderpushd Xrender./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xrandrpushd Xrandr./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co FixesExtpushd FixesExt./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co DamageExtpushd DamageExt./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xfontpushd Xfont./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co ResourceExtpushd ResourceExt./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co RecordExtpushd RecordExt./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co CompositeExtpushd CompositeExt./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co xkbfilepushd xkbfile./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xserver co xserverpushd xserver./autogen.sh --prefix=/opt/fdo --enable-compositemakesudo install -d /opt/fdo/binsudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xfixespushd Xfixes./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xcompositepushd Xcomposite./autogen.sh --prefix=/opt/fdomakesudo make installpopdcvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xlibs co Xdamagepushd Xdamage./autogen.sh --prefix=/opt/fdomakesudo make installpopd# zxf xcompmgr-1.1.tar.gzpushd xcompmgr-1.1./autogen.sh --prefix=/opt/fdomakesudo make installpopd# to start server, try something like...sudo /opt/fdo/bin/Xvesa :1 & xterm -display :1# in xterm...export LD_LIBRARY_PATH="/opt/fdo/lib:$LD_LIBRARY_PATH"/opt/fdo/bin/xcompmgr
如果你想交叉编译,请修改一下./autogen.sh --prefix=/opt/fdo--》./autogen.sh --prefix=/opt/fdo --host=arm-linux --build=i386-linux
当然后面加的需要根据你的实际情况,如果你的交叉编译器是arm-unknown-linux-gnu-*(gcc),你可以改为--host=arm-unknown-linux-gnu.
运行脚本即可。
3\运行
在您的调试板上,运行一下试试看,别忘了:export DISPLAY=:0
如果出现了一个带光标的窗口,恭喜,成功!