
opie-login for x86 because of this libpam problem.If you are not a Debian user, you won't have access to the useful apt-get command, during the x86 libraries installation, but you should be able to get them anyhow with more or less help from your distribution.
But most of the parts should still be useful for you, even the ARM libraries installation from Debian feeds: once you have installed Alien package converter, you can extract libraries and headers from .deb packages. Here are the exact commands you'll have to type for that!
-gif option to the ./configure part of Building Qt paragraph, since the corresponding patent has expired. Thanks for pointing that out, Lewis Jardine!DEBUG options must be the same in your build environment and in the packages you are using.dpkg-cross and toolchain-source in my Todo list, since they are great tools available to ease crosscompiling stuff for Debian developers./arm/ path missing in the right column). Thanks, Ralf Staudemeyer!alien and tar based ARM libraries extraction part: the wrong libpng version was written, so my one-line extracting command would not work.qt/ directory, whose application is simpler than the Qt2.3.5 previous patch. Simplified the patching part of Qt installation then. By the way, Opie 1.0 and 1.0.1 still have Qt2.3.5 in their feeds, so in some circumstances you may prefer to configure your dev. environment with Qt2.3.5 rather than with Qt2.3.7. More details soon..3 version of their 2.95 compiler to its .4 version, which was moved recently in an unsupported subdirectory. Altough I use the .4 version without any problem, I've prefered to put the .3 version in the cross-compiler installation part.libpng version 1.2 (aka libpng3) instead of libpng version 1.0 (aka libpng2) to compile Qt and Opie. Indeed, Opie 1.0 and newer depend (through libqte2) on libpng3, and only libpng3. x86 libraries installation and ARM libraries installation parts have therefore been updated.qmake, qvfb and more generally how to develop Opie applications).opie-login can be compiled again! I took the files from libpam0g-dev we need from my qt/include and qt/lib, put them into a tar.gz with the same architecture as the original Debian package, and put the archive on my servers (see at the end of the ARM packages URL list below).opie-login since the appropriate debian package for libpam0g, which was the testing one until recently, has been upgraded to GLIBC2.3 (more details below).libpam because of this bug) the ARM pre-compiled packages we take from the debian pool below are now packages from the stable version of Debian (aka 'woody'), so we are sure they were built against the 2.2 version of the GLIBC.| Todo list for x86 target | Todo list for ARM target |
|---|---|
Downloading Opie latest sources through CVSNote: we will explain how to install Qt and Opie in your
/opt directory, but this is an unimportant choice, and you may as well choose a path like ~/dev/opie-and-qt or anything else.% cd /opt
/opt% touch ~/.cvspass
If you are connecting to Opie CVS for the first time, you must log in as an anonymous user (and give 'anoncvs' as the password).
/opt% cvs -d:pserver:anoncvs@cvs.handhelds.org:/cvs login
Then you can checkout the Opie code:
/opt% cvs -d:pserver:anoncvs@cvs.handhelds.org:/cvs -z6 checkout opie
And repeat this in the directory you will use for cross-compilation:
/opt% mkdir arm; cd arm/
/opt/arm% cvs -d:pserver:anoncvs@cvs.handhelds.org:/cvs -z6 checkout opie
Note: you can put
-r BRANCH_1_0 between checkout and opie, in the previous lines, to checkout the stable branch of Opie, Opie 1.0, instead of the development version. |
|
Installing UIC binary and downloading Qt/Embedded sourcesYou can install the UIC through a Debian package:
/opt# apt-get install libqte2-dev || apt-get install uic
But if you are not using Debian, you can simply download a (big)
uic binary statically linked:/opt# wget http://www.vanille.de/tools/uic-qt2 -O /usr/local/bin/uic then make it executable of course: chmod +x /usr/local/bin/uic
You can then download and extract the latest Qt/Embedded 2 sources:
/opt% wget ftp://ftp.trolltech.com/qt/source/qt-embedded-2.3.8.tar.bz2
Decompress the sources in two directories (one for each architecture):
/opt% tar xvjf qt-embedded-2.3.8.tar.bz2
/opt% cp -a qt-2.3.8 arm/
|
|
Installing the cross-compiler (GCC2.95-based, from Open Zaurus team)% cd /tmp
First we download and extract the latest GCC2.95-based toolchain (definition of a toolchain):
/tmp% wget http://www.openzaurus.org/official/toolchain/cross-2.95.3.tar.bz2
If the link above is still broken (it was around Sep 29, 2004), you can try this one from handhelds.org archive.
/tmp% tar xvjf cross-2.95.3.tar.bz2
Then we install it into
/usr/local/arm directory, and we tell our environment to look here for binaries:/tmp# mkdir /usr/local/arm; cp -a 2.95.3 /usr/local/arm
/tmp% export PATH=/usr/local/arm/2.95.3/bin:$PATH
|
|
Installing x86 libraries needed by Qt and Opie# apt-get install libfreetype6-dev libjpeg62-dev libpam0g-dev libpng12-dev zlib1g-dev libbluetooth1-dev libpcsclite-dev pkg-config
You can also install libpcap-dev (useful if you want to build libopie2net)
|
Installing ARM libraries needed by Qt and OpieDownloading ARM headers and libraries from Debian package pool/tmp% wget -N
http://http.us.debian.org/debian/pool/main/libj/libjpeg6b/{libjpeg62,libjpeg62-dev}_6b-5_arm.deb http://http.us.debian.org/debian/pool/main/f/freetype/{libfreetype6,libfreetype6-dev}_2.0.9-1_arm.deb http://http.us.debian.org/debian/pool/main/z/zlib/{zlib1g,zlib1g-dev}_1.1.4-1.0woody0_arm.deb http://http.us.debian.org/debian/pool/main/libp/libpcap/{libpcap0.7,libpcap0.7-dev}_0.7.2-7_arm.deb http://http.us.debian.org/debian/pool/main/libp/libpng3/{libpng3,libpng-dev}_1.2.1-1.1.woody.9_arm.deb http://http.us.debian.org/debian/pool/main/b/bluez-libs/{libbluetooth1,libbluetooth1-dev}_2.11-1_arm.deb http://http.us.debian.org/debian/pool/main/g/gcc-3.0/libgcc1_3.0.4-7_arm.deb http://http.us.debian.org/debian/pool/main/p/pcsc-lite/{libpcsclite1,libpcsclite-dev}_1.2.9-beta6-1_arm.deb http://http.us.debian.org/debian/pool/main/f/flex/flex_2.5.4a-24_arm.deb
http://people.via.ecp.fr/~clem/nist/libpam0g-dev_0.76-9_arm_for_Opie.tgz technical note about these packages
Extracting these packages, Debian way/tmp%
mkdir libjpeg62 && dpkg-deb -x libjpeg62_6b-5_arm.deb libjpeg62 && dpkg-deb -x libjpeg62-dev_6b-5_arm.deb libjpeg62 && mkdir libfreetype6 && dpkg-deb -x libfreetype6_2.0.9-1_arm.deb libfreetype6 && dpkg-deb -x libfreetype6-dev_2.0.9-1_arm.deb libfreetype6 && mkdir zlib1g && dpkg-deb -x zlib1g_1.1.4-1.0woody0_arm.deb zlib1g && dpkg-deb -x zlib1g-dev_1.1.4-1.0woody0_arm.deb zlib1g && mkdir libpcap0.7 && dpkg-deb -x libpcap0.7_0.7.2-7_arm.deb libpcap0.7 && dpkg-deb -x libpcap0.7-dev_0.7.2-7_arm.deb libpcap0.7 && mkdir libpng3 && dpkg-deb -x libpng3_1.2.1-1.1.woody.9_arm.deb libpng3 && dpkg-deb -x libpng-dev_1.2.1-1.1.woody.9_arm.deb libpng3 && mkdir libbluetooth1 && dpkg-deb -x libbluetooth1_2.11-1_arm.deb libbluetooth1 && dpkg-deb -x libbluetooth1-dev_2.11-1_arm.deb libbluetooth1 && mkdir libgcc1 && dpkg-deb -x libgcc1_3.0.4-7_arm.deb libgcc1 && mkdir libpcsclite1 && dpkg-deb -x libpcsclite1_1.2.9-beta6-1_arm.deb libpcsclite1 && dpkg-deb -x libpcsclite-dev_1.2.9-beta6-1_arm.deb libpcsclite1 && mkdir flex && dpkg-deb -x flex_2.5.4a-24_arm.deb flex && tar xzf libpam0g-dev_0.76-9_arm_for_Opie.tgz
Alternative to last paragraph: Extracting these packages, Alien way (if you are using another Linux distribution)Since we run the following command as a normal user,
alien will complain the permissions won't be right. Don't pay attention to this message, since the permissions will be right enough to compile Opie :-)/tmp% alien --to-tgz *.deb
Now we have
.tgz packages, which we can extract with tar:/tmp%
mkdir libjpeg62 && tar Cxzf libjpeg62 libjpeg62-6b.tgz && tar Cxzf libjpeg62 libjpeg62-dev-6b.tgz && mkdir libfreetype6 && tar Cxzf libfreetype6 libfreetype6-2.0.9.tgz && tar Cxzf libfreetype6 libfreetype6-dev-2.0.9.tgz && mkdir zlib1g && tar Cxzf zlib1g zlib1g-1.1.4.tgz && tar Cxzf zlib1g zlib1g-dev-1.1.4.tgz && mkdir libpcap0.7 && tar Cxzf libpcap0.7 libpcap0.7-0.7.2.tgz && tar Cxzf libpcap0.7 libpcap0.7-dev-0.7.2.tgz && mkdir libpng3 && tar Cxzf libpng3 libpng3-1.2.1.tgz && tar Cxzf libpng3 libpng-dev-1.2.1.tgz && mkdir libbluetooth1 && tar Cxzf libbluetooth1 libbluetooth1-2.11.tgz && tar Cxzf libbluetooth1 libbluetooth1-dev-2.11.tgz && mkdir libgcc1 && tar Cxzf libgcc1 libgcc1-3.0.4.tgz && mkdir libpcsclite1 && tar Cxzf libpcsclite1 libpcsclite1-1.2.9-beta6.tgz && tar Cxzf libpcsclite1 libpcsclite-dev-1.2.9-beta6.tgz && mkdir flex && tar Cxzf flex flex-2.5.4a.tgz && tar xzf libpam0g-dev_0.76-9_arm_for_Opie.tgz
Installing headers and libraries into the right directories/tmp# find
libjpeg62 libfreetype6 zlib1g libpcap0.7 libpng3 libbluetooth1 libgcc1 libpcsclite1 flex -path '*/include/*' -maxdepth 3 -exec cp -R {} /usr/local/arm/2.95.3/arm-linux/include \;
/tmp# find
libjpeg62 libfreetype6 zlib1g libpcap0.7 libpng3 libbluetooth1 libgcc1 libpcsclite1 flex -path '*/lib/*' -maxdepth 3 -exec cp -R --no-dereference {} /usr/local/arm/2.95.3/arm-linux/lib \;
|
Setting up the environment and patching Qt (x86 target)% export QTDIR=/opt/qt-2.3.8
% cd $QTDIR/
/opt/qt-2.3.8% export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
/opt/qt-2.3.8% mkdir -p bin
|
Setting up the environment and patching Qt (ARM target)% export QTDIR=/opt/arm/qt-2.3.8
% cd $QTDIR/
/opt/arm/qt-2.3.8% mkdir -p bin
|
|
In the following line, we link to the Qt2 version of the UIC to compile Qt/Embedded. Depending on the option you've chosen in the UIC installation step, its binary name is
/usr/share/qte2/bin/uic on Debian unstable and testing, uic on Debian stable, uic2 on Redhat, or uic if you prefered to install a statically linked uic in /usr/local/bin! So adapt the path in the following line, and link your binary to $QTDIR/bin like this: |
|
|
/opt/qt-2.3.8% ln -s /path/to/your/qt2/uic bin/uic
/opt/qt-2.3.8% export OPIEDIR=/opt/opie
/opt/qt-2.3.8% ln -s $OPIEDIR/qt/qconfig*.h src/tools/
/opt/qt-2.3.8% ls $OPIEDIR/qt
Try to guess which patches concern you amongst the output files; but if you are compiling for iPAQ and with qt-2.3.8, you'll probably have to apply only one patch (add
-macosx after -all if you are using MacOS X):/opt/qt-2.3.8% patch -p1 < $OPIEDIR/qt/qt-2.3.8.patch/qte238-all.patch patch command output
|
/opt/qt-2.3.8% ln -s /path/to/your/qt2/uic bin/uic
/opt/arm/qt-2.3.8% export OPIEDIR=/opt/arm/opie
/opt/arm/qt-2.3.8% ln -s $OPIEDIR/qt/qconfig*.h src/tools/
/opt/arm/qt-2.3.8% ls $OPIEDIR/qt
Try to guess which patches concern you amongst the output files; but if you are compiling for iPAQ and with qt-2.3.8, you'll probably have to apply only one patch (add
-macosx after -all if you are using MacOS X):/opt/arm/qt-2.3.8% patch -p1 < $OPIEDIR/qt/qt-2.3.8.patch/qte238-all.patch patch command output
|
Building Qt for Opie (x86 target)/opt/qt-2.3.8% ./configure -qconfig qpe -depths 4,16,24,32 -system-jpeg -system-libpng -system-zlib -gif -no-xft -qvfb configure command output
/opt/qt-2.3.8% make make command output
|
Building Qt for Opie (ARM target)/opt/arm/qt-2.3.8% ./configure -qconfig qpe -depths 4,16,24 -xplatform linux-ipaq-g++ -no-qvfb -system-jpeg -system-libpng -gif -system-zlib -vnc -no-xft configure command output
Note: if you are crosscompiling for a Sharp Zaurus and not an iPAQ, replace
linux-ipaq-g++ in the previous line by linux-sharp-g++. You will also need to extract this Sharp kernel headers RPM package (or its .tar.gz counterpart here) somewhere on your disk (by default /opt/Embedix/tools/arm-linux), set $KERNEL_PATH to point to it, and append -I$KERNEL_PATH/include to the ./configure line above./opt/arm/qt-2.3.8% make make command output
|
Building Opie (x86 target)% cd $OPIEDIR
|
Building Opie (ARM target)% cd $OPIEDIR
|
Notes on tools to speed up compilation:
|
|
|
/opt/opie% make menuconfig resulting .config file ; note: you may have to install
flex if it fails. |
/opt/arm/opie% make menuconfig resulting .config file ; note: you may have to install
flex if it fails. |
Notes on setting options in the menuconfig build interface:
|
|
|
Before quitting, check that
Intel x86 is selected in Build Parameters / Target Machine.Then you can run:
/opt/opie% make oldconfig
and finally:
/opt/opie% make make output
|
Before quitting, check that
iPAQ (or the appropriate Zaurus, Simpad, Yopy... target if your target device is not exactly an iPAQ) is selected in Build Parameters / Target Machine.To speed up application launching times, you may want to select, in the same menu, Enable Quick Launch.
Then you can run:
/opt/arm/opie% make oldconfig
and finally:
/opt/arm/opie% make make output
|
qmake!qmake binary, for x86 (don't forget you develop on x86, whether you develop for x86 or ARM), at this address: $OPIEDIR/qmake/qmake. This tool, included and used by Opie, is in fact a backport from Trolltech's useful tool from Qt3, and is designed to create Makefiles easily, from .pro files, whatever your target architecture is. Trolltech has a good qmake manual here.qvfb (how to getqvfb), or on you iPAQ. For example, you can now read the Hello, World! wiki page on opie.handhelds.org! Among other things, it will teach you to write a .pro file and to build the corresponding Makefile, or to let Opie know there's a new .pro file, so its main Makefile will call qmake for all the applications you decided to compile, including yours.qvfb (here is a qvfb short description by Qt)qt3-dev-tools-embedded package under Debian unstable or testing, libqt3-dev under Debian stable, or compile a recent Qt for X11 (qvfb runs on X, not on iPAQs Qt/Embedded) like this one: ftp://ftp.trolltech.com/qt/source/qt-x11-free-3.2.0.tar.gz. There should be RPM or other binaries packages availabe for your linux distribution to avoid the compilation step (see for example this Qtopia FTP directory to get an RPM that should contain qvfb).GCC3.3, unlike the ARM part (right column) where the cross-compiler is based on GCC2.95. But don't worry, Qt and Opie are compileable with both.libpam0g-dev, whose files needed to compile Opie are available on this server in a tar.gz file (see libpam0g-dev_0.76-9_arm_for_Opie.tgz address above). That's because of the following bug in the Debian stable libpam: it cannot be statically linked, and that's precisely what opie-login compilation needs to do. Until recently, the Debian testing version, 0.76-9, was available without this bug, and was appropriate to cross-compile opie-login. Unfortunately, this package has recently upgraded to version 0.76-13, which relies eventually on GLIBC2.3 (see the libc6 > 2.3 requirement here), which is too recent for our crosscompiler (which is based on GLIBC2.2). But that's OK since this server offers a back-up of the files we need, from version 0.76-9 :-)dpkg-cross, a tool for installing libraries and headers for cross-compiling under Debian, which can be a sleek alternative to my seemingly hairy ARM libraries installation method (even it dpkg-cross will only work for the happy Debian folks, especially Debian testing and unstable users. Note: it can also be used to cross-compile any Debian package (then about any opensource application ;) if you can manage the very few tweaks sometimes needed (like adding a lib path in a debian/rules file). Here is a really quick guide to use dpkg-cross and Philip Blundell packages to set up a crosscompiling environment, for example.dpkg-cross road and talk about the toolchain-source tool, which can be used quite simply with dpkg-cross to build and set up a cross development environment on Debian, as explained in this great how-to./opt/arm/openssl will be your local OpenSSL dir, its includes will be in include and its libs in lib):