1-解压缩
一定要使用命令解压,而且要分别解压。
tar -zxvf XFree86-4.6.0-src-1.tgz
tar -zxvf XFree86-4.6.0-src-2.tgz
tar -zxvf XFree86-4.6.0-src-3.tgz
tar -zxvf XFree86-4.6.0-src-4.tgz
tar -zxvf XFree86-4.6.0-src-5.tgz
tar -zxvf XFree86-4.6.0-src-6.tgz
tar -zxvf XFree86-4.6.0-src-7.tgz
2-建立一个临时目录
cd xc/config/util/
make lndir
cp lndir /usr/local/bin/
和xc在同一个目录下建立一个文件夹
mkdir armtinyx
cd armtinyx
lndir ../xc/
3-在 armtinyx/config/cf目录下修改cross.def文件并添加host.def文件(详细文件在下边)
4-加入触摸屏支持
(1)在host.def中应加入如下语句:
#define TouchScreen YES
#define HasTsLib YES
(2)并将tslib-1.0/src/tslib.h文件拷入armtinyx/programs/Xserver/hw/tinyX/linux(解决找不到tslib.h错误)
(3)将交叉编译好的tslib的lib文件夹(几个.so文件)拷贝到交叉编辑环境的arm-linux/lib下(解决ld找不到-lts错误)
注意:编译tslib的交叉编译器必须也要和编译tinyx一样是不带软浮点的,不然执行上步会报出浮点不一样的错误
(4)在armtinyx/programs/Xserver/hw/tinyx/tinyx.h文件里添加
#define TOUCHSCREEN
(5)在/armtinyx/programs/Xserver/hw/tinyX/linux/tslib.c中对触摸屏的查找是根据TsNames数组来进行的,如果没有你的开发板上/dev下的触摸屏设备节点的话,将其添加到TsNames数组里。
5-在/armtinyx/lib/X11/Imakefile
#if (BuildServersOnly || !BuildX11Lib) && !XnestServer && !BuildGLXLibrary && !BuildClients && !XdmxServer
修改为
#if (BuildServersOnly || !BuildX11Lib) && !XnestServer && !BuildGLXLibrary && !BuildClients && !XdmxServer && !TinyXServer
6-编译
make World
make install
编译会遇到的错误:
1-error: cannot find "xf86Pci.h" in "xf86str.h"
修改armtinyx/programs/Xserver/hw/xfree86/common/xf86str.h
把#include "xf86Pci.h"修改成#include "bus/xf86Pci.h"
2-armtinyx/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h
#include<linux/config.h> 找不到config.h
解决办法删掉#include<linux/config.h>这一行。
host.def
#define KDriveXServer YES
#define TinyXServer YES
#define XfbdevServer YES
#undef CrossCompiling
#define CrossCompiling YES
#define XF86Server NO
#define XnestServer NO
#define XVirtualFramebufferServer NO
#define XdmxServer NO
#define XprtServer NO
#define BuildFontServer NO
#define BuildFonts YES
#define BuildXF86RushExt NO
#define HasXdmAuth NO
#define BuildDocs NO
#define BuildIPv6 NO
#define HasMTRRSupport NO
#define UseX86Emu NO
#define XF86INT10_BUILD X86INT10_STUB
#define XdecMultiDepthServer NO
#define XsunServer NO
#define Xsun24Server NO
#define XsunMonoServer NO
#define XsunLynxServer NO
#define XSavageServer NO
#define XIgsServer NO
#define XTridentServer NO
#define XchipsServer NO
#define Xmach64Server NO
#define Xi810Server NO
#define XSis530Server NO
#define XTrioServer NO
#define XipaqServer NO
#define XTS300Server NO
#define XItsyServer NO
#define XvesaServer NO
#define XDarwinServer NO
#define XF86CardDrivers fbdev
#define XInputDrivers void
#define XInputDrivers keyboard mouse
#define ProjectRoot /usr/local/arm/X11R6
#define NothingOutsideProjectRoot YES
#define BuildServersOnly YES
#define BuildRender YES
#define UseRgbTxt YES
#define OmitSnfSupport YES
#define HasFreetype2 NO
#define HasFontconfig NO
#define HasLibpng NO
#define HasZlib NO
#define HasExpat NO
#define TouchScreen YES
#define HasTsLib YES
cross.def
#undef Arm32Architecture
#undef i386Architecture
#define Arm32Architecture
#undef OptimizedCDebugFlags
#define OptimizedCDebugFlags -Os
#define ServerCDebugFlags -Os
#undef StandardDefines
#define StandardDefines -Dlinux -D__arm__ -D_POSIX_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE /
-DX_LOCALE -DUSE_DYNAMIC_LC -DUSE_UTF8_LOADER -DUSE_DYNAMIC_LOADER
#define PreIncDir
#undef PostIncDir
#undef CcCmd
#define CcCmd /usr/local/bin/arm-linux-gcc -I/usr/local/arm-linux/include -L/usr/local/arm-linux/lib(编译器路径)
#undef HasCplusplus
#define HasCplusplus NO
#undef CplusplusCmd
#define CplusplusCmd NO
#define DoRanlibCmd YES
#define RanlibCmd /usr/local/bin/arm-linux-ranlib
#undef ExtraLoadFlags
#define ExtraLoadFlags
#define FbNoPixelAddrCode
#undef TermcapLibrary
#define TermcapLibrary -L/usr/lib -lncurses(ncurses路径)
#define NCursesLibName -L/usr/lib -lncurses
#undef LdPostLib
#define LdPostLib -L/usr/local/arm-linux/lib
#undef LdCmd
#define LdCmd /usr/local/bin/arm-linux-ld
#undef ExtensionOSDefines
#define ExtensionOSDefines
#define ServerXdmcpDefines /**/
#define GzipLibrary -L$(ROOTFS_DIR)/usr/lib -lz(zlib路径)
#define HostCcCmd /usr/bin/cc
#include <cross.rules>
交叉编译tinyx4.6 from xfree86
最新推荐文章于 2021-05-13 19:43:37 发布