Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9151973
  • 博文数量: 1727
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 19860
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1727)

文章存档

2024年(3)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: LINUX

2009-02-06 15:13:35

#!/bin/sh

#--enable-malloc0returnsnull 加了此项就不用去改configure, 相当于
#vi configure to find "cannot run test program while cross compiling"
#modify { (exit 1); exit 1; }; } to }

#编译环境: ubuntu 8.04 LTS / cross compile=arm-linux-3.4.2
#/xroot  /xroot/build

#部分源码下载位置
#
#ftp://ftp.tw.freebsd.org/pub/ FreeBSD/distfiles/xorg/
#git clone git://git.freedesktop.org/git/xorg/proto/calibrateproto.git
#git clone git://git.freedesktop.org/git/xorg/lib/libXCalibrate.git
#

#补丁下载至 download pinky-3.1.1
#在pinky-3.1.1/meta/packages patch可用
#svn co poky 其中也有部分的patch可用

#step 1: Cross环境设定
export XROOT=/xroot
export PREFIX=$XROOT
#export LD_LIBRARY_PATH=$PREFIX/lib
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
export HOST=arm-linux
export BUILD=i686-linux

export CC=arm-linux-gcc
export CXX=arm-linux-g++
export AR=arm-linux-ar
export RANLIB=arm-linux-ranlib
export NM=arm-linux-nm
export AS=arm-linux-as
export LD=arm-linux-ld
export STRIP=arm-linux-strip
export READELF=arm-linux-readelf
export STRINGS=arm-linux-strings
export SIZE=arm-linux-size
export ADDR2LINE=arm-linux-addr2line

1.    libxml2-2.6.32
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 all; make -j 2 install;
   
2.    inputproto-1.4.2.1
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
3.    kbproto-1.0.3   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
4.    bigreqsproto-1.0.2   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
5. xproto-7.0.10   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
6.    xextproto-7.0.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
7. xcmiscproto-1.1.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
8.    xf86bigfontproto-1.1.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
9.    xtrans-X11R7.2-1.0.3
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-lib/xtrans/fix-missing-includepath.patch
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
10.libXau-1.0.3   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull
    make -j 2 install;
   
11.libXdmcp-1.0.2   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull
    make -j 2 install;

12.util-macros-1.1.5
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-util/files/unbreak_cross_compile.patch
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
13.libX11-1.1.2   
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-lib/libx11/include_fix.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-lib/libx11/x11_disable_makekeys.patch
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull --without-xcb --with-keysymdef=$PREFIX/include/X11/keysymdef.h

    #vi ./src/Makefile
    #编辑ks_tables.h的依赖关系:要注释的内容如下。
    #    ks_tables.h: $(KEYSYMDEF) $(top_builddir)/src/util/makekeys$(EXEEXT)
    #        # $(top_builddir)/src/util/makekeys < $(KEYSYMDEF) > ks_tables_h
    #        # mv ks_tables_h $@

    #把  src/util/makekeys 文件用gcc编译, 执行 makekeys <> ks_tables_h, 把生成的 ks_tables_h 文件放在 src 目录下
    #cd src/util
    #make clean; gcc -o makekeys makekeys.c
    #./makekeys <$PREFIX/include/X11/keysymdef.h> ks_tables_h
    #mv ks_tables_h ../ks_tables.h
    make -j 2 install;
   
#/**************************** Xserver (Kdrive)移植******************/
14.zlib-1.2.3 //对于交叉编译已有此libz.so.1.2.3的,此步无须编译。
    patch -Np1 -i ../pinky-3.1.1/meta/packages/zlib/files/visibility.patch
    ./configure --prefix=$PREFIX --shared
    make -j 2 install;
   
15.tslib-1.0   
    patch -Np1 -i ../pinky-3.1.1/meta/packages/tslib/tslib/fix_version.patch
    ./autogen.sh
    #修改./etc/ts.conf 开放 module_raw input

    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull --enable-ucb1x00=no --enable-corgi=no --enable-collie=no --enable-h3600=no --enable-mk712=no --enable-arctic2=no --enable-input

    #修改 在config.h里加上#undef rpl_malloc, 同时封掉  /* #define malloc rpl_malloc */
    make -j 2 install;
   
16.freetype-2.3.5
    patch -Np1 -i ../pinky-3.1.1/meta/packages/freetype/freetype-2.3.5/fix-x86_64-build.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/freetype/files/no-hardcode.patch   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull   
    make -j 2 install;   
   
17.compositeproto-0.4   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
18.damageproto-1.1.0       
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
19.fixesproto-4.0   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
   
20.recordproto-1.13.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
21.resourceproto-1.0.2   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
22.scrnsaverproto-1.1.0
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
23.xineramaproto-1.1.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
24.videoproto-2.2.2   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
25.calibrateproto
    ./autogen.sh
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
26.fontsproto-2.0.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
27.fontcacheproto-0.1.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
28.randrproto-1.2.1
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
29.renderproto-X11R7.0-0.9.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
30.xf86miscproto 0.9.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
31.xf86vidmodeproto 2.2.2
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
32.xf86dgaproto 2.0.3   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX
    make -j 2 install;
       
33.libxkbfile-1.0.4   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull
    make -j 2 install;        
   
34.libXext-1.0.3   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull
    make -j 2 install;    
   
35.libXCalibrate
    ./autogen.sh
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull
    make -j 2 install;
       
36.libXrender-0.9.2   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull
    make -j 2 install;
   
37. libXrandr-1.2.1
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull
    make -j 2 install;
   
38.libfontenc-1.0.4
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull
    #vi src/Makefile 修改 DEFAULT_INCLUDES += -I$(PREFIX)/include
    make -j 2 install;
   
39.libXfont-1.3.1   
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull
    make -j 2 install;
   
40.xorg-server-1.3.0.0

[
官方kdrive不支持240*320, 并且触摸屏默认也没有编译进去(虽然你选择了tslib)。
所以应用xorg-server-add240x320.patch,以支持240*320。
然后export CFLAGS="$CFLAGS -DTOUCHSCREEN"

配置参数:

编 译/安装/运行就可以了。"--enable-tslib --enable-kdrive --disable-dri --disable-xprint --disable-tcp-transport --disable-ipv6 --disable-xdm-auth-1 --disable-composite --disable-xorg --disable-xorgcfg --disable-dmx --disable-xnest --disable-xvfb --disable-xwin --disable-xprint --disable-xephyr"
]
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/*.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/disable-apm.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/enable-tslib.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/fbdev_use_current.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/no-serial-probing.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/disable-xf86-dga-xorgcfg.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/enable-xcalibrate.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/hide-cursor-and-ppm-root.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/optional-xkb.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/enable-builtin-fonts.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/extra-kmodes.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-evdev.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/scheduler.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/enable-epson.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/kdrive-use-evdev.patch
    patch -Np1 -i ../pinky-3.1.1/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch


    #修改configure 尋找cannot check for file existence when cross compiling  把{ (exit 1); exit 1; };} 改exit 为 echo
    #把configure文件中最后一个 ac_config_files= 的地方后加入 LDFLAGS="-L${PREFIX}/lib -lfreetype -lts -lz -lXfont"
    #并把所有的tslib-0.0 改成 tslib-1.0
   
    ac_cv_file__usr_share_X11_sgml_defs_ent=no
#    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull --enable-composite --enable-kdrive --disable-dga --disable-dri --disable-xinerama --disable-xf86misc --disable-xf86vidmode --disable-xorg --disable-xorgcfg --disable-xkb --disable-xnest --disable-xvfb --disable-xevie --disable-xprint --disable-xtrap --disable-dmx --enable-tslib --enable-xcalibrate  --with-freetype-config=${PREFIX}/bin/freetype-config --with-default-font-path=built-ins

    #或者指定寻找字体的目录
    ./configure --host=$HOST --build=$BUILD --prefix=$PREFIX --enable-static=yes --enable-shared=yes --enable-malloc0returnsnull --enable-kdrive --disable-dri --disable-xprint --disable-tcp-transport --disable-ipv6 --disable-xdm-auth-1 --disable-composite --disable-xorg --disable-xorgcfg --disable-dmx --disable-xnest --disable-xvfb --disable-xwin --disable-xprint --disable-xephyr --with-freetype-config=${PREFIX}/bin/freetype-config --with-fontdir=${PREFIX}/lib/X11/fonts
   
    make -j 2 install;   
   
41. 安装字体
    tar zxf Xfnts.tgz -C $PREFIX   
   
   
可到开发版上测试 X11 的可用性, 执行 Xfbdev & (后台执行)。 看看XServer的画面(点阵画面)是否出现。mouse(X图形)是否可以使用
在linux内核上加入HID支持, insmod usbcore hcid等模块后,插入USB鼠标,看X鼠标能否移动

如何在xfbdev上使用触摸屏

编译的时候加上enable-tslib,然后调用xfbdev的时候使用参数: Xfbdev -mouse tslib,,device=xxxx
   
   
Xfbdev [:display] [option...]
Options
the TinyX servers accept the following options:

-card pcmcia
    Use pcmcia card as additional screen.
-dumb
    Disable hardware acceleration.
-origin X,Y
    Locates the next screen in the Xinerama virtual screen.
-screen widthxheight[xdepth[xfreq]][@rotation]
    Use a screen of the specified width, height, screen depth, frequency, and rotation (0, 90, 180 and 270 are legal values).
-softCursor
    Disable the hardware cursor.
-videoTest
    Start the server, pause momentarily, and exit.
-zaphod
    Disable switching screens by moving the pointer across a screen boundary.
-2button
    Enable emulation of a middle mouse button by chording.
-3button
    Disable emulation of a middle mouse button by chording.
-noserialmouse
    Do not probe for a serial mouse.    
阅读(3637) | 评论(2) | 转发(0) |
0

上一篇:tinyX + GTK+2.0 for arm

下一篇:GTK + 2.12 porting

给主人留下些什么吧!~~

iibull2011-08-22 10:21:56

zlib is required
提示说zlib 找不到, 可以在configure --help 查看下库和头文件的宏是哪个,然后在configure 的时候带上去就OK。

zlib 库是常用的库,很多第三方软件或库需要他,建议直接把编译好的库和头文件放在交叉编译器里边,这样就不用每次都用环境变量来连接了。

chinaunix网友2011-02-28 17:21:36

LT2440 ARM9 S3C2440开发板 4.3`TFT LCD,丰富资料,上手简单,极速入门,价格仅449RMB,我们论坛:www.lt-net.cn,QQ:624304841