Sei sulla pagina 1di 4

Compiling Qt and tslib for mini2440 and run a demo app

We will create a Qt app that is compatible on mini2440 on our host computer then we will copy the libraries and binary of the app to mini2440 and will run the app. So first we need to set up the Qt environment that we have in our mini2440(Qtopia) to our host computer hese are the steps we must follow 1. tslib compilation 2. Qt4.6.2 compilation 3. Copy library of tslib and Qt4.6.2 into mini2440 board. 4. Configure the environment in mini2440 board. 5. un Qt e!ample program 1. tslib compilation slib is an abstraction layer for touchscreen panel events! as well as a filter stac" for the manipulation of those events. #t was created by $ussell %in&! of arm.linu'.or&.u". slib is &enerally used on embedded devices to provide a common user space interface to touchscreen functionality.
$sudo apt-get install git-core $cd /usr/local $git clone http://github.com/kergoth/tslib.git (s dng ti khon root) $export !"#$/usr/local/arm/%.&.'/bin:$ !"# $export ()*++,(*- ./0$arm-none-linux-gnueabi$export (($$1()*++,(*- ./02gcc $export (3/!4+$-march$arm5%t $export (66$$1()*++,(*- ./027g887 $export !)$$1()*++,(*- ./027ar7 $export !+$$1()*++,(*- ./027as7 $export )!9/.:$$1()*++,(*- ./027ranlib7 $export /;$$1()*++,(*- ./027ld7 $export +"). $$1()*++,(*- ./027strip7 $export ac,c5,<unc,malloc,=,nonnull$>es $cd /usr/local/tslib $./autogen-clean.sh $./autogen.sh $./con<igure --host$arm-linux --pre<ix$/opt/tslib --enable-shared$>es --enablestatic$>es $make $make install

#f everythin& went o" you will see tslib in you "ill see tsblib in #opt#tslib 2.Qt Compilation
$?get http://get.@t.nokia.com/@t/source/@t-e5er>?here-opensource-src%.A.&.tar.gB $m5 @t-e5er>?here-opensource-src-%.A.&.tar.gB /usr/local $cd /usr/local $tar -Bx5< @t-e5er>?here-opensource-src-%.A.&.tar.gB $cd @t-e5er>?here-opensource-src-%.A.&

$cd mkspecs/common/ $gedit g88.con<

(dit that file change into Q)*%(+,-.*/S+$(.(*S( Q)*%(+,-.*/S+$(.(*S( 01 230 01 232

$hen save the file


$cd /usr/local/@t-e5er>?here-opensource-src-%.A.&/mkspecs/@?s/linux-arm-g88/ $gedit @make.con<

(dit the file.,opy paste the below content ! note that! the path 4usr4local4arm44.5.24 is the path which you installed tool chain.$emember that the 6* 7 variable should have the location of arm2none2 linu'2&nueabi2&cc
C C @make con<iguration <or building ?ith arm-linux-g88 C include(../../common/g88.con<) include(../../common/linux.con<) include(../../common/@?s.con<) C modi<ications to g88.con< D-!E0,(( $ /usr/local/arm/%.&.'/bin/arm-none-linux-gnueabi-gcc -mso<t-<loat -;,,4((,3/*!",9*",900;0; -march$arm5%t -mtune$armF'=t -*= -lts D-!E0,(66 $ /usr/local/arm/%.&.'/bin/arm-none-linux-gnueabi-g88 -mso<t-<loat -;,,4((,3/*!",9*",900;0; -march$arm5%t -mtune$armF'=t -*= -lts D-!E0,/.9E $ /usr/local/arm/%.&.'/bin/arm-none-linux-gnueabi-g88 -mso<t-<loat -;,,4((,3/*!",9*",900;0; -march$arm5%t -mtune$armF'=t -*= -lts D-!E0,/.9E,+#/.: $ /usr/local/arm/%.&.'/bin/arm-none-linux-gnueabi-g88 -mso<t<loat -;,,4((,3/*!",9*",900;0; -march$arm5%t -mtune$armF'=t -*= -lts C modi<ications to linux.con< D-!E0,!) $ /usr/local/arm/%.&.'/bin/arm-none-linux-gnueabi-ar c@s D-!E0,*:G(* H $ /usr/local/arm/%.&.'/bin/arm-none-linux-gnueabi-obIcop> D-!E0,+"). $ /usr/local/arm/%.&.'/bin/arm-none-linux-gnueabi-strip D-!E0,.9(;.) 8$ /opt/tslib/include/ D-!E0,/.:;.) 8$ /opt/tslib/lib/ D-!E0,(3/!4+,)0/0!+0 8$ -march$arm5% -mtune$armF'=t D-!E0,(3/!4+,;0:J4 8$ -march$arm5%t -mtune$armF'=t D-!E0,(3/!4+,-" 8$ -march$arm5%t -mtune$armF'=t D-!E0,(3/!4+,-",;:4 8$ -march$arm5%t -mtune$armF'=t D-!E0,(3/!4+,-",;// 8$ -march$arm5%t -mtune$armF'=t D-!E0,(3/!4+,-",;//;:4 8$ -march$arm5%t -mtune$armF'=t D-!E0,(3/!4+,+#/.: 8$ -march$arm5%t -mtune$armF'=t D-!E0,(3/!4+,"#)0!; 8$ -march$arm5%t -mtune$armF'=t D-!E0,(3/!4+,K!)9,*33 8$ -march$arm5%t -mtune$armF'=t D-!E0,(3/!4+,K!)9,*9 8$ -march$arm5%t -mtune$armF'=t D-!E0,(663/!4+,;0:J4 8$ -march$arm5%t -mtune$armF'=t D-!E0,(663/!4+,-" 8$ -march$arm5%t -mtune$armF'=t D-!E0,(663/!4+,-",;:4 8$ -march$arm5%t -mtune$armF'=t D-!E0,(663/!4+,-",;// 8$ -march$arm5%t -mtune$armF'=t D-!E0,(663/!4+,-",;//;:4 8$ -march$arm5%t -mtune$armF'=t D-!E0,(663/!4+,)0/0!+0 8$ -march$arm5%t -mtune$armF'=t D-!E0,(663/!4+,+#/.: 8$ -march$arm5%t -mtune$armF'=t D-!E0,(663/!4+,"#)0!; 8$ -march$arm5%t -mtune$armF'=t

D-!E0,(663/!4+,K!)9,*33 8$ -march$arm5%t -mtune$armF'=t D-!E0,(663/!4+,K!)9,*9 8$ -march$arm5%t -mtune$armF'=t load(@t,con<ig)

Save the file


$mkdir /usr/local/Dt $cd /usr/local/@t-e5er>?here-opensource-src-%.A.&

hen issue this command


$./con<igure -embedded arm -xplat<orm @?s/linux-arm-g88 -pre<ix /usr/local/Dt -@t-mouse-tslib -little-endian -no-?ebkit -no-@t&support -no-cups -no-large<ile -optimiBed-@make -no-openssl -nomake tools -@t-s@l-s@lite -no-&dno? -s>stem-Blib -@t-gi< -@t-libti<< -@t-libpng -@t-libmng -@t-libIpeg -no-opengl -gtkst>le -noopen5g -no-xshape -no-xs>nc -no-xrandr -@t-<reet>pe -@t-g<x-linux<b -@t-kbd-tt> -@t-kbd-linuxinput -@t-mouse-tslib -@t-mouse-linuxinput

chose 8o9 3pen Source (dition chose 8yes9 to accept license offer
$make $make install

:ow the compilation is done! you will see the result files in 4usr4local4Qt. -i' l;i thi<u th= vi>n "hi ma"e? install 2 &@i libgcr>ptLL-de5 and BlibLg-de5. 3 .Copy library of tslib and Qt4.6.3 into mini2440 board Ase sd card!pendrive or you can copy throu&h networ" copy library and example program of Qt to pendrive
$cd $cp $cp $cd $cp /usr/local/Dt/lib M%.A.& /media/ endri5e/ -r <onts/ /media/ endri5e/ /usr/local/Dt -r demos/ /media/ endri5e/

copy tslib into pendrive


$mkdir /media/ endri5e/tslib/lib/ $cd /opt/tslib/lib/ $cp -r M /media/ endri5e/tslib/lib/ $cp M /media/ endri5e/tslib/lib/

:ow connect the pendrive to the usb port of )ini2440 and in mini2440Bs console
$mkdir /usr/local/Dt/lib/ $cp /sdcard/M%.A.& /usr/local/Dt/lib/ rename all *.4.6.3 in /usr/local/Qt/lib into *.4, for example $m5 libDt(ore.so.%.A.& libDt(ore.so.% $cp -r /udisk/<onts/ /usr/local/Dt/lib/ $cp -r /udisk/demos/ /mnt/ $cp -r /udisk/tslib/ /usr/local/

3n mini2440 the pendrive will appear as 4udis" instead of 4media46endrive 4. Configure the environment in mini2440 board. Celow instructions will ma"e mini2440 board not load its des"top so that our e'ample Qt pro&rams not conflict screen with the des"top
$cd /etc/init.d/ $5i rc+ comment last three lines: #bin/qtopia& #echo" "> /dev/tty1 #ehco"Starting Qtopia, please waiting..." > /dev/tty1

Configure the environment in mini2440


$cd /etc/ $5i pro<ile

add those lines at the end of file


export export export export export export export export export export export /;,/.:)!)H, !"#$/usr/local/tslib/lib D";.)$/usr/local/Dt DK+,-*J+0, )*"*$tslib:/de5/input/e5ent= "+/.:,(!/.:3./0$/etc/pointercal "+/.:,(*933./0$/usr/local/etc/ts.con< "+/.:,(*9+*/0;0N.(0$none "+/.:,3:;0N.(0$/de5/<b= "+/.:, /J4.9;.)$/usr/local/tslib/lib/ts "+/.:,"+;0N.(0$/usr/local/tslib/lib/ts "+/.:,"+0N09""H 0$.9 J" DK+,;.+ /!H$/inux3::mmKidth$L=O:mm#eight$L%=

Save it !. "un Qt example program :ow we can test Qt e'ample pro&rams


$cd /mnt/demos/embedded/<luidlauncher/ $./<luidlauncher -@?s

Potrebbero piacerti anche