编译Xfree86 TinyX

arm 编译 XFree86 tinyx 2008-03-18 15:38:32

分类: LINUX


1,编译过程:

#工作目录 /home/armenv

#解压缩 XFree86-4.5.0-src-1.tgz

# XFree86-4.5.0-src-2.tgz

# XFree86-4.5.0-src-3.tgz

# ....

# XFree86-4.5.0-src-7.tgz



ROOTFS_DIR=/home/armenv/rootfs/
PATH=/opt/gcc-4.1.1-glibc-2.4/arm-926-linux/bin/:$PATH

PKG_CONFIG_PATH=$ROOTFS_DIR/usr/local/lib/pkgconfig
PKG_CONFIG_PATH=$ROOTFS_DIR/usr/lib/pkgconfig:$PKG_CONFIG_PATH
PKG_CONFIG_PATH=$ROOTFS_DIR/usr/X11R6/lib/pkgconfig:$PKG_CONFIG_PATH

export ARCH=arm
export $PATH $ROOTFS_DIR $PKG_CONFIG_PATH

export ARMTINYX_DIR=/home/armenv/armtinyx
export XC_DIR=/home/armenv/xc
 
 

cd $XC_DIR


patch -p0 < tinyx_for_arm.patch
cd $XC_DIR/config/util && make lndir

mkdir $ARMTINYX_DIR

cd $ARMTINYX_DIR && $XC_DIR/config/util/lndir $XC_DIR
make World DESTDIR=$ROOTFS_DIR


出现下列错误:
    arm-linux-gcc: os/tiny/lbxio.o: No such file or directory
    
cd $XC_DIR/programs/Xserver/os/tiny
make lbxio.o
cd $ARMTINYX_DIR
make
make DESTDIR=$ROOTFS_DIR install
    
    

编译成功!

运行xserver时的问题;
1,需要配置XF86Config ,
2. 没有字体文件,需要从pc机复制 字体文件到 X11R6/lib/X11/fonts 里。    
    



tinyx_for_arm.patch:


--- programs/Xserver/hw/xfree86/common/compiler.h    2004-04-04 06:26:23.000000000 +0800
+++ compiler.h    2008-01-10 18:33:58.000000000 +0800
@@ -184,6 +184,7 @@
 /* *before* any inx/outx is done. */
 
 extern void (*_alpha_outb)(char val, unsigned long port);
+/*ZZJ
 static __inline__ void
 outb(unsigned long port, unsigned char val)
 {
@@ -225,6 +226,7 @@
   return _alpha_inl(port);
 }
 
+*/
 # endif /* linux */

 
 # if (defined(__FreeBSD__) || defined(__OpenBSD__)) \

@@ -530,6 +532,7 @@
        __asm__ __volatile__ ("": : :"memory")
 
 
+/*ZZJ
 static __inline__ void
 outb(unsigned short port, unsigned char val)
 {
@@ -579,6 +582,7 @@
    return ret;
 }
 
+*/
 # elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__)

 
 # if !defined(Lynx)

@@ -588,6 +592,7 @@
 
 # define barrier() __asm__ __volatile__(".word 0x8143e00a": : :"memory")

 
+/*ZZJ
 static __inline__ void
 outb(unsigned long port, unsigned char val)
 {
@@ -644,6 +649,7 @@
              : "r" (port), "i" (ASI_PL));
     return ret;
 }
+*/
 
 static __inline__ unsigned char
 xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
@@ -922,6 +928,7 @@
 
 unsigned int IOPortBase; /* Memory mapped I/O port area */
 
+/*ZZJ
 static __inline__ void
 outb(unsigned PORT_SIZE port, unsigned char val)
 {
@@ -958,6 +965,7 @@
     return *(volatile unsigned int*)(((unsigned PORT_SIZE)(port))+IOPortBase);
 }
 
+*/
 
 # if defined(__mips__)

 static __inline__ unsigned long ldq_u(unsigned long * r11)
@@ -1248,6 +1256,7 @@
 }
 
 
+/*ZZJ
 static __inline__ void
 outb(unsigned short port, unsigned char value)
 {
@@ -1290,6 +1299,7 @@
         return xf86ReadMmio32Le((void *)ioBase, port);
 }
 
+*/
 # define ldq_u(p)    ldl_u(p)

 # define ldl_u(p)    ((*(unsigned char *)(p))    | \

             (*((unsigned char *)(p)+1)<<8)    | \
@@ -1329,6 +1339,7 @@
  * inlines has to be different.        DHD
  */
 
+/*ZZJ
 static __inline__ void
 outb(unsigned short port, unsigned char val)
 {
@@ -1378,8 +1389,10 @@
    return ret;
 }
 
+*/
 # else    /* GCCUSESGAS */

 
+/*ZZJ
 static __inline__ void
 outb(unsigned short port, unsigned char val)
 {
@@ -1428,10 +1441,12 @@
   return ret;
 }
 
+*/
 # endif /* GCCUSESGAS */

 
 # else /* !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)*/

 
+/*ZZJ
 static __inline__ void
 outb(unsigned short port, unsigned char val)
 {
@@ -1465,6 +1480,8 @@
   return 0;
 }
 
+*/
+
 # endif /* FAKEIT */

 # endif /* __SUNPRO_C */

 
--- programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c    2003-09-24 10:43:35.000000000 +0800
+++ lnx_video.c    2008-01-11 10:03:10.000000000 +0800
@@ -417,7 +417,8 @@
      Base,realBase,alignOff);
 #endif

     
-#if defined(__ia64__)

+/* ZZJ */
+#if defined(__ia64__) || defined(__arm__) || defined(__s390__)

 #ifndef MAP_WRITECOMBINED

 #define MAP_WRITECOMBINED 0x00010000

 #endif

@@ -519,7 +520,9 @@
 #endif

     }
     close(fd);
-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__)

+/* ZZJ */
+#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)

+
     if (ioperm(0, 1024, 1) || iopl(3))
         FatalError("xf86EnableIOPorts: Failed to set IOPL for I/O\n");
 # if !defined(__alpha__)

@@ -540,7 +543,9 @@
 #if defined(__powerpc__)

     munmap(ioBase, 0x20000);
     ioBase = NULL;
-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__)

+/* ZZJ */
+#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)

+
     iopl(0);
     ioperm(0, 1024, 0);
 #endif

@@ -559,12 +564,15 @@
 Bool
 xf86DisableInterrupts()
 {
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__)

+/* ZZJ */
+#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)

+
     if (!ExtendedEnabled)
      if (iopl(3) || ioperm(0, 1024, 1))
             return (FALSE);
 #endif

-#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__)

+#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__)

+
 #else

 # ifdef __GNUC__

 # if defined(__ia64__)

@@ -578,7 +586,8 @@
     asm("cli");
 # endif

 #endif

-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__)

+/* ZZJ */
+#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)

     if (!ExtendedEnabled) {
      iopl(0);
      ioperm(0, 1024, 0);
@@ -591,12 +600,15 @@
 void
 xf86EnableInterrupts()
 {
-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__)

+/* ZZJ */
+#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)

+
     if (!ExtendedEnabled)
      if (iopl(3) || ioperm(0, 1024, 1))
             return;
 #endif

-#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__)

+#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__)

+
 #else

 # ifdef __GNUC__

 # if defined(__ia64__)

@@ -610,7 +622,9 @@
     asm("sti");
 # endif

 #endif

-#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__)

+/* ZZJ */
+#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)

+
     if (!ExtendedEnabled) {
      iopl(0);
      ioperm(0, 1024, 0);
--- programs/Xserver/hw/xfree86/vgahw/vgaHW.h    2004-10-27 06:26:38.000000000 +0800
+++ vgaHW.h    2008-01-11 10:03:19.000000000 +0800
@@ -229,7 +229,9 @@
 #define BITS_PER_GUN 6

 #define COLORMAP_SIZE 256

 
-#if defined(__powerpc__)

+/* ZZJ */
+#if defined(__powerpc__) || defined(__arm__) || defined(__s390__)

+
 #define DACDelay(hw) /* No legacy VGA support */

 #else

 #define DACDelay(hw)                             \

--- programs/Xserver/hw/xfree86/common/xf86Bus.c    2005-02-18 09:52:59.000000000 +0800
+++ xf86Bus.c    2008-01-11 10:03:31.000000000 +0800
@@ -3000,7 +3000,8 @@
 CheckGenericGA()
 {
 /* This needs to be changed for multiple domains */
-#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)

+/* ZZJ */
+#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__arm__) && !defined(__s390__)

     IOADDRESS GenericIOBase = VGAHW_GET_IOBASE();
     CARD8 CurrentValue, TestValue;
 
--- config/cf/cross.def.old    2002-04-04 22:05:33.000000000 +0800
+++ config/cf/cross.def        2007-12-21 15:56:54.000000000 +0800
@@ -1,45 +1,83 @@
-/* $XFree86: xc/config/cf/cross.def,v 1.3 2002/04/04 14:05:33 eich Exp $ */
-/*
- * This file contains redefinitions of some symbols to enable
- * cross compilation: e.g. paths for include files and paths to
- * compiler images. It will have to be edited to reflect these
- * given your local configuration.
- */
-#if 0

+#undef Arm32Architecture

+
 #undef i386Architecture

+
+#undef Arm32Architecture

+
+#undef Arm32Architecture

+
+
+
 #define Arm32Architecture

 
+
+
 #undef OptimizedCDebugFlags

-#define OptimizedCDebugFlags     -O2

-#define ServerCDebugFlags    -O2

+
+
+
+#define OptimizedCDebugFlags -Os

+
+#define ServerCDebugFlags -Os

+
 #undef StandardDefines

-#define StandardDefines     -Dlinux -D__arm__ -D_POSIX_SOURCE \

-                -D_BSD_SOURCE -D_GNU_SOURCE -DX_LOCALE
-#undef CcCmd

-#define StdIncDir /skiff/local/arm-linux/include

-#define PreIncDir

+#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 \

+-I$(ROOTFS_DIR)/usr/include/ncurses -I$(ROOTFS_DIR)/usr/include -DTOUCHSCREEN
+
+
+#define PreIncDir

+
 #undef PostIncDir

-#define PostIncDir /skiff/local/lib/gcc-lib/arm-linux/2.95.2/include

-#define CcCmd /skiff/local/bin/arm-linux-gcc

+
+#undef CcCmd

+
+#define CcCmd arm-926-linux-gcc

+
+
+#undef HasCplusplus

+
+#define HasCplusplus NO

+
 #undef CplusplusCmd

-#define HasCplusplus YES

-#define CplusplusCmd /skiff/local/bin/arm-linux-g++

+
+#define CplusplusCmd NO

+
 #define DoRanlibCmd YES

-#define RanlibCmd /skiff/local/bin/arm-linux-ranlib

+
+#define RanlibCmd arm-926-linux-ranlib

+
 #undef ExtraLoadFlags

+
 #define ExtraLoadFlags

+
 #define FbNoPixelAddrCode

+
 #undef TermcapLibrary

-#define TermcapLibrary -ltermcap

+
+#define TermcapLibrary -L$(ROOTFS_DIR)/usr/lib -lncurses

+
+#define NCursesLibName -L$(ROOTFS_DIR)/usr/lib -lncurses

 
 #undef LdPostLib

-#define LdPostLib    -L/skiff/local/arm-linux/lib

+
+#undef LdCmd

+
+#define LdCmd arm-926-linux-ld

+
+
 
 #undef ExtensionOSDefines

+
 #define ExtensionOSDefines

 
-#define ServerXdmcpDefines    /**/

+
+
+#define ServerXdmcpDefines

+
+
+
+#define GzipLibrary -L$(ROOTFS_DIR)/usr/local/lib -lz

+
+
 
-#define HostCcCmd cc

-#endif

 #include <cross.rules>

--- config/cf/host.def.old    1970-01-01 08:00:00.000000000 +0800
+++ config/cf/host.def        2008-01-11 10:14:37.000000000 +0800
@@ -0,0 +1,144 @@
+#define TinyXServer YES

+#define XfbdevServer YES

+#define CrossCompiling YES

+#define ProjectRoot /usr/X11R6

+
+#define NothingOutsideProjectRoot YES

+
+
+
+#define HasFreetype2 NO

+
+#define HasFontconfig NO

+
+#define HasLibpng NO

+
+#define HasZlib NO

+
+
+
+#define HasExpat NO

+
+#define BuildXprintClients NO

+
+#define TouchScreen YES

+
+#define HasTsLib YES

+
+#define BuildDocs NO

+
+#define BuildXF86DRI NO

+
+#define BuildGlxExt NO

+
+#define BuildOSMesaLib NO

+
+#define BuildLowMem NO

+
+#define BuildIPv6 NO

+
+
+
+#define HasMTRRSupport NO

+
+#define UseX86Emu NO

+
+#define XF86INT10_BUILD X86INT10_STUB

+
+#define BuildAppgroup NO

+
+#define BuildDBE NO

+
+#define BuildLBX NO

+
+#define HasMTRRSupport NO

+
+#define UseX86Emu NO

+
+#define XF86INT10_BUILD X86INT10_STUB

+
+#define BuildAppgroup NO

+
+#define BuildDBE NO

+
+#define BuildLBX NO

+
+
+
+#define BuildFonts YES

+
+#undef BuildXF86RushExt

+
+#define BuildXF86RushExt NO

+
+#undef BuildRender

+
+#define BuildRender YES

+
+#define UseRgbTxt YES

+
+#define BuildFontServer NO

+
+#define BuildClients NO

+
+#define BuildFonts YES

+
+#undef BuildXF86RushExt

+
+#define BuildXF86RushExt NO

+
+#undef BuildRender

+
+#define BuildRender YES

+
+#define UseRgbTxt YES

+
+#define BuildFontServer NO

+
+#define OmitSnfSupport YES

+
+#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 mouse keyboard



      

XF86Config:

Section "Module"
    Load "freetype"
    # Load "xtt"

    Load "extmod"
    #Load "glx"

    #Load "dri"

    Load "dbe"
    Load "record"
    Load "xtrap"
    Load "type1"
    Load "speedo"
    Load "fbdevhw"
EndSection
Section "Files"
        RgbPath "/usr/X11R6/lib/X11/rgb"
        ModulePath "/usr/X11R6/lib/modules"
        FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
        FontPath "/usr/X11R6/lib/X11/fonts/misc/"
        FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
        FontPath "/usr/X11R6/lib/X11/fonts/util/"
        FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/"
        FontPath "/usr/X11R6/lib/X11/fonts/local/"
EndSection


    Section "Monitor"
        Identifier    "Builtin Default Monitor"
        Option    "TargetRefresh"    "75.0"
    EndSection
    Section "Device"
        Identifier    "Builtin Default fbdev Device 0"
        Driver    "fbdev"
    EndSection
    Section "Screen"
        Identifier    "Builtin Default fbdev Screen 0"
        Device    "Builtin Default fbdev Device 0"
        Monitor    "Builtin Default Monitor"
    EndSection
    Section "Device"
        Identifier    "Builtin Default vesa Device 0"
        Driver    "vesa"
    EndSection
    Section "Screen"
        Identifier    "Builtin Default vesa Screen 0"
        Device    "Builtin Default vesa Device 0"
        Monitor    "Builtin Default Monitor"
    EndSection
    Section "Device"
        Identifier    "Builtin Default vga Device 0"
        Driver    "vga"
    EndSection
    Section "Screen"
        Identifier    "Builtin Default vga Screen 0"
        Device    "Builtin Default vga Device 0"
        Monitor    "Builtin Default Monitor"
    EndSection
    Section "ServerLayout"
        Identifier    "Builtin Default Layout"
        Screen    "Builtin Default fbdev Screen 0"
        Screen    "Builtin Default vesa Screen 0"
        Screen    "Builtin Default vga Screen 0"
    EndSection

Section "Pointer"
    #Protocol "Auto"

    Device "/dev/input/event0"
EndSection
Section "Keyboard"
    XkbDisable
EndSection


你可能感兴趣的:(编译Xfree86 TinyX)