把SDL开源图形库移植到开发板上

1.我是先把SDL的四个压缩包拷贝到/usr/jing,你可以鼠标右键解压,也可以使用命令解压,我是只解压了SDL-1.2.14 t ar

2.打开终端 键入cd /usr/jing/SDL-1.2.14 ,输入./configure --prefix=/usr/jing/ --disable-video-nanox -disable-video-qtopia --disable-video-photon --disable-video-ggi --disable-video-svga --disable-video-aalib --disable-video-dummy --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-video-x11 --disable-nasm --enable-joystick --enable-input-tslib --enable-video-fbcon --host=arm-linux --build=i386  配置环境变量, 有输入make 命令。最后又输入         make   install .        -I-L指定了头文件以及库文件的路径, -l 指定了库名。   

3.打开计算机—>打开文件系统在etc中找到exptors在里面写入/usr/jing 192.168.1.199(rw,sync)并保存。

 打开终端 输入ifconfig 来查看PC机的IP,在命令行输入 [root@localhost ~]# ping 192.168.1.123

PING 192.168.1.123 (192.168.1.123) 56(84) bytes of data.

64 bytes from 192.168.1.123: icmp_seq=1 ttl=64 time=0.073 ms

64 bytes from 192.168.1.123: icmp_seq=2 ttl=64 time=0.070 ms

[1]+  Stopped                 ping 192.168.1.123

[root@localhost ~]# ping 192.168.1.199

PING 192.168.1.199 (192.168.1.199) 56(84) bytes of data.

64 bytes from 192.168.1.199: icmp_seq=1 ttl=64 time=1.23 ms

64 bytes from 192.168.1.199: icmp_seq=2 ttl=64 time=0.298 ms

64 bytes from 192.168.1.199: icmp_seq=3 ttl=64 time=0.282 ms

[2]+  Stopped                 ping 192.168.1.199

来查看开发板和PC机是否处于同一频段。

4.输入 service nfs start查看服务器是否启动,若没启动输入

则输入 service nfs restart 之后会出现如下:

[root@localhost ~]# service nfs restart

关闭 NFS mountd:                                          [确定]

关闭 NFS 守护进程:                                        [确定]

关闭 NFS quotas:                                          [确定]

关闭 NFS 服务:                                            [确定]

启动 NFS 服务: exportfs: Warning: /root/liu does not exist

                                                           [确定]

关掉 NFS 配额:                                            [确定]

启动 NFS 守护进程:                                        [确定]

启动 NFS mountd:                                          [确定]

如果启动就不用重新启动了。

5.打开开发板 输入minicom -s,选择exit

[root@localhost ~]# minicom -s

Welcome to minicom 2.2

OPTIONS: I18n 

Compiled on Sep 25 2007, 06:13:56.

Port /dev/ttyS0

               Press CTRL-A Z for help on special keys

                                                     

                                                     

[root@UP_6410 yaffs]# AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0

-bash: AT: command not found                         

445                                     

-bash: c1: command not found            

[root@UP_6410 yaffs]# cd ..             

[root@UP_6410 mnt]# ls                             

ide     nfs     sdcard  udisk   yaffs   

[root@UP_6410 mnt]# mountnfs 192.168.1.123:/usr/dong  /mnt/nfs/   进行挂载。                

[root@UP_6410 mnt]# ls                                                          

ide     nfs     sdcard  udisk   yaffs                                           

[root@UP_6410 mnt]# cd nfs                                                      

[root@UP_6410 nfs]# ls                                                          

SDL-1.2.14  bin         include     lib         share     

6.打开终端输入 cd/usr/jing/SDL-1.2.14/test ,再用

[root@localhost ~]# cd /usr/dong/SDL-1.2.14

[root@localhost SDL-1.2.14]# cd test      

[root@localhost test]# ls

12            icon.bmp     testbitmap.c     testjoystick.c  testver.c

13            loopwave.c   testblitspeed.c  testkeys.c      testvidinfo.c

acinclude.m4  Makefile.in  testcdrom.c      testloadso.c    testwin.c

aclocal.m4    mm           testcursor.c     testlock.c      testwm.c

autogen.sh    moose.dat    testdyngl.c      testoverlay2.c  threadwin.c

checkkeys.c   picture.xbm  testerror.c      testoverlay.c   torturethread.c

configure     README       testfile.c       testpalette.c   utf8.txt

configure.in  sail.bmp     testgamma.c      testplatform.c

COPYING       sample.bmp   testgl.c         testsem.c

gcc-fat.sh    sample.wav   testhread.c      testsprite.c

graywin.c     testalpha.c  testiconv.c      testtimer.c

[root@localhost test]# arm-linux-gcc testwin.c -o 16 -I /usr/dong/include/SDL -L/usr/dong/lib  -l SDL         进行arm-linux-gcc 编译。

[root@localhost test]#   代表在另一个arm-linux-gcc 编译器中通过了编译。

7.然后在开发板上输入如下:

[root@UP_6410 nfs]# cd SDL-1.2.14                                               

[root@UP_6410 SDL-1.2.14]# ls                                                   

BUGS                README.OS2          Xcode.tar.gz                            

Borland.html        README.PS3          acinclude                               

Borland.zip         README.PicoGUI      autogen.sh                              

COPYING             README.Porting      build                                   

CREDITS             README.QNX          build-deps                              

CWprojects.sea.bin  README.Qtopia       build-scripts                           

INSTALL             README.RISCOS       config.log                              

MPWmake.sea.bin     README.SVN          config.status                           

Makefile            README.Symbian      configure                               

Makefile.dc         README.Watcom       configure.in                            

Makefile.in         README.WinCE        docs                                    

Makefile.minimal    README.wscons       docs.html                               

README              SDL.qpg             include                                 

README-SDL.txt      SDL.qpg.in          libtool                                 

README.AmigaOS      SDL.spec            sdl-config                              

README.BeOS         SDL.spec.in         sdl-config.in                           

README.CVS          TODO                sdl.m4                                  

README.DC           VisualC.html        sdl.pc                                  

README.MacOS        VisualC.zip         sdl.pc.in                               

README.MacOSX       VisualCE.zip        src                                     

README.MiNT         Watcom-OS2.zip      symbian.zip                             

README.NDS          Watcom-Win32.zip    test                                    

README.NanoX        WhatsNew                                                    

[root@UP_6410 SDL-1.2.14]# cd test                                              

[root@UP_6410 test]# ls                                                         

12               graywin.c        testcursor.c     testoverlay2.c               

13               icon.bmp         testdyngl.c      testpalette.c                

16               loopwave.c       testerror.c      testplatform.c               

COPYING          mm               testfile.c       testsem.c                    

Makefile.in      moose.dat        testgamma.c      testsprite.c                 

README           picture.xbm      testgl.c         testtimer.c                  

acinclude.m4     sail.bmp         testhread.c      testver.c                    

aclocal.m4       sample.bmp       testiconv.c      testvidinfo.c                

autogen.sh       sample.wav       testjoystick.c   testwin.c                    

checkkeys.c      testalpha.c      testkeys.c       testwm.c                     

configure        testbitmap.c     testloadso.c     threadwin.c                  

configure.in     testblitspeed.c  testlock.c       torturethread.c              

gcc-fat.sh       testcdrom.c      testoverlay.c    utf8.txt                     

[root@UP_6410 test]# ./16        在开发板上运行。                                               

Set 640x480x16 mode                                                             

(video surface located in system memory)                                        

Loading picture: sample.bmp                                                     

testwin: setting colors                                                         

(p_w_picpath surface located in system memory)                                        

testwin: moving p_w_picpath                                                           

testwin: fading out...                                                          

testwin: fading in...                                                           

testwin: fading over                                                            

Time: 892 milliseconds                                                          

[root@UP_6410 test]# 

8.最后会在开发板上显示所运行的结果: