移植XFree86(Tinyx)到Linux Arm嵌入式系统

1). Get source code from XFree86 repository (www.XFree86.org)

       XFree86-4.8.0-src-1.tgz

XFree86-4.8.0-src-2.tgz

XFree86-4.8.0-src-3.tgz

XFree86-4.8.0-src-4.tgz

XFree86-4.8.0-src-5.tgz

XFree86-4.8.0-src-6.tgz

XFree86-4.8.0-src-7.tgz

 

2).Setup building system

Cross tools like gcc, binutility.

Export your cross tools directory by the command

export CROSSTOOLS=/opt/crosstools/arm

PATH=$PATH:$(CROSSTOOLS)/bin

 


3).Configure Tinyx with XFree86

Extract files from src tgz

      tar xfz XFree86-4.8.0-src-1.tgz

      tar xfz XFree86-4.8.0-src-2.tgz

      tar xfz XFree86-4.8.0-src-3.tgz

          .

         .

      tar xfz XFree86-4.8.0-src-7.tgz

 

Two configuration files of tinyx with XFree86

      config/cf/host.def        tinyx settings

      config/cf/cross.def       cross tools settings

 

The host.def configuration file

        #undef CrossCompiling

        #define CrossCompiling        YES

#define BuildServer              YES

#define BuiltinRGB                YES

#define BuildServerOnly         NO

#define BuildClients            !BuildServerOnly

 

#define BuildLibraries                YES

#define HasSharedLibraries      YES

 

#define TinyXServer              YES

#define XfbdevServer           YES

#define BuildBuiltinFonts        YES

#define BuildFonts                YES    /* 各种点阵和矢量字库需要定制 */

 

#define XF86CardDrivers       fbdev

#define XInputDriver             mouse keyboard

 

The cross.def configuration file

#undef i386Architecture

#define Arm32Architecture

 

#undef OptimizedCDebugFlags

#define OptimizedCDebugFlags     -O2

#define ServerCDebugFlags          -O2

 

#undef StandardDefines

#define StandardDefines        -Dlinux -D__arm__ -D_POSIX_SOURCE \

                                     -D_BSD_SOURCE -D_GNU_SOURCE -DX_LOCALE

#undef StdIncDir

#define StdIncDir /opt/crosstools/arm/eldk/armVFP/usr/include  /* C 库头文件目录 */

#define PostIncDir

/opt/crosstools/arm/eldk/armVFP/usr/lib/gcc/arm-linux-gnueabi/4.2.2/include

             #define CppCmd arm-linux-cpp        /* 各种编译器 */

             #define CplusplusCmd arm-linux-g++

             #define HostCcCmd gcc -m32 -O2

 

#include <cross.rules>

 

4). Build XFree86

              cd xc

make World  /* 若有类似 "Unsupported size of `int' type!" 的错误,查看系统 limits.h 包含关系;出现编译错误,一定是编译环境出问题 */

              make install  /* 会生成 bin , lib , include 相关目标对象 */

 

5).Startup Tinyx

        Xfbdev ?  /* help */

        Xfbdev :0 -nolisten tcp -mouse /dev/input/mice,5 -br >/dev/null 2>&1

         xinit /usr/bin/xclock -geometry 80x66+0+0 -- /usr/bin/Xfbdev :0 -br -nolisten tcp