This chapter describes how to use kdevelop 2.1 with integrated cross compiling features. The first version is already available on http://www.kdevelop.org. Follow the instructions at the download page.
Attention !!!
The CVS-Server is not any more cvs.kde.org. I used cvsup.kde.org, since a few days
the server is documented as anoncvs.kde.org.
!!! Hint !!!
Since ipaqhelp 0.2.5 kdevelop is handled different. I had many problems to get kdevelop to
crosscompile correctly. So I decided to go a more manual way. I changed the
/etc/ld.so.conf (removed all cross related entries) and all .goqtxxrc files (see above).
Since then I start kdevelop from the shell switching to e.g. qtopie before. This
allows me to use e.g. $EXTRALIB entries in the kdevelop configuration and add
remove special libs via this way.
Just switch to qtemb environment and start kdevelop from the shell.
The menu options->kdevelop-setup->Compiler allows the user to define the cross compililation tools.
Assuming you have a i386, you can choose the build system as i386, linux and the target compile
system as an arm, linux. Fill in the fields you have your cross-gcc installed.
attention
Dont use special characters to name your target system (e.g. blanks, ... ), because kdevelop
works, but destroys the *.kdevses file. I did not do this my own, but got an email
from a user who went into this trap. I will inform ralf nolden about that to get it fixed.
Now create your first example program. Name it e.g. kdev21test and choose the qt2 SDI template.
To prepare for emb crosscompiling, follow the steps below.
project->options and choose compiler setup.(Standard) in the "Configuration" combo box and e.g.
write emb instead. Press the Add button right of that. This
will enable the build-dir field. You can chage it or let as it is. Kdevelop chooses
the dir ../emb to store the result.Flags and Warnings. Choose Wall as compiler warnings and
enter $OPTIONS $EXTRA_INC_PATH into the CPPFLAGS field.Linker Flags. Enter $EXTRA_LIB_PATH
Additional Flags field.Configure. Enter /usr/lib/qt2emb into the
--with-qt-dir field, --enable-embedded --enable-qtopia into the
Additional Options field.options/linker-options. Enter $(LIB_QPE) -lyourExtra
additional library field, where yourExtra is an extra lib (e.g. -luvqtutil). Multiple libraries
have to use the same syntax (-la, -lb, lc, ...).make distclean;make autoconf;./configuremake distclean in the standard configuration.
Change to emb and do a make autoconf;./configure.project/kdev21test/emb/kdev21test, enter
export QTDIR=/usr/lib/qt2e and start your qfvb. After that is done a simple ./kdev21test should
launch your application.
To go to arm from here is easy.
project->options and choose compiler setup.(Standard) in the "Configuration" combo box and e.g.
write arm instead. Press the Add button right of that. This
will enable the build-dir field. You can chage it or let as it is. Kdevelop chooses
the dir ../arm to store the result.arm as the architecture to work for by selecting from the CompilerSettings
tab page.Flags and Warnings. Choose Wall as compiler warnings and
enter $OPTIONS $EXTRA_INC_PATH into the CPPFLAGS field.Linker Flags. Enter $EXTRA_LIB_PATH
Additional Flags field.Configure. Enter /usr/lib/qt2arm into the
--with-qt-dir field, --enable-embedded --enable-qtopia into the
Additional Options field.options/linker-options. Enter $(LIB_QPE) -lyourExtra
additional library field, where yourExtra is an extra lib (e.g. -luvqtutil). Multiple libraries
have to use the same syntax (-la, -lb, lc, ...).arm configuration and do a make autoconf;./configure.The additional libraries have to be cleared, if you want to go back to X11 mode. This is a kdevelop bug.
Also you should start kdevelop from qtarm environment from the terminal entering
qtarm && kdevelop &
to compile for arm.
To go to opie from here is easy.
project->options and choose compiler setup.(Standard) in the "Configuration" combo box and e.g.
write opie instead. Press the Add button right of that. This
will enable the build-dir field. You can chage it or let as it is. Kdevelop chooses
the dir ../opie to store the result.arm as the architecture to work for by selecting from the CompilerSettings
tab page.Flags and Warnings. Choose Wall as compiler warnings and
enter $OPTIONS -I$EXTRA_INC_PATH into the CPPFLAGS field.Linker Flags. Enter -I$EXTRA_LIB_PATH
Additional Flags field.Configure. Enter /usr/lib/qt2opie into the
--with-qt-dir field, --enable-embedded --enable-qtopia into the
Additional Options field.options/linker-options. Enter $(LIB_QPE) -lyourExtra -lopie
additional library field, where yourExtra is an extra lib (e.g. -luvqtutil). Multiple libraries
have to use the same syntax (-la, -lb, lc, ...).opie configuration and do a make autoconf;./configure.The additional libraries have to be cleared, if you want to go back to X11 mode. This is a kdevelop bug.
Also you should start kdevelop from qtopie environment from the terminal entering
qtopie;kdevelop &
to compile for arm/opie.
This section describes the tools I prepared to create automated ipkgs out of kdevelop arm projects.
Some shell- and perlscripts copied into the admin dir of your project and adopted to you needs will allow you to create an ipkg mostly automated.
The following scriptfiles are used
qtarm environment.cpipk.rc copies non specific files and executes a project specific shellscript
called _xtrarx located in your project dir (not in admin).qpe_ipk.pl.
It creates the ipk, which finally can be found in the destination dir.
qpe_ipk_xxx.pl (xxx is either qtopia or opie) is a helpfull script to automize the ipkbuild process and all
related stuff using kdevelop. Grab the download archiv scripts.tgz (
see download section),
unpack it and copy the resulted content of subdir ipkg_kdev into your project directory (cd ipkg_dev;cp -r * /where/your/project/is).
The result are the scripts located into the ipkg dir and the two scripts _xtrarc and _postinst
in your project dir. Edit that both files to your needs.
The non project specific files require some special data structure and files.
To build the ipkg just cd to your project dir and enter the following line (assuming that the kdevelop arm build process is finished).
qtarm;ipkg/qpe_ipk.pl ipaq arm YourProjectName $PWD
This will create everything you need assuming, that ipaq is the destination dir and arm the kdevelop build dir. The result can be found in $PWD/ipaq.
The perl script of me also copies the result to my local ipk-dir, which at the moment is /home/sc1/project/scipkgs. The path to there is actually defined in the script qpe_ipk.pl ( variable is $ipk_destipk ). It also manipulates the Package file there to be able to install the ipk via ipkg install qtravel on the handheld.
This section prints the perl scripts main calls to show how it works.
getArgs(); # get the program arguments and check whether OK
startPrepScript(); # starts prepipk.rc with appropriate parameters
startCpScript(); # starts cpipk.rc with appropriate parameters
grabPrjFile(); # grabs all necessary information from the project file
createControlFile(); # creates the ipk CONTROL file
createPackageFile(); # creates the package file
prepQpeApp(); # creates the QTopia desktop file
startBuildScript(); # starts the ipk build strip buildipk.rc
copyToDest(); # copies the result into the local ipkgs dir
# and manipulates the Packages file.
This chapter describes the known bugs in relation to the crosscompiling feature. The version is kdevelop 2.1beta2 (kdevelop 2.2.2).
/usr/lib/libjpeg.so link to your arm-libjpeg when using libjpeg in your programs.