I've spent a good part of this weekend playing around with my shiny new Sharp Zaurus SL-C3200. I'm not going to give it any more of an introduction, because it would be impossible to top what
this guy has written.
Instead, what I'm going to focus on is cross-compiling one of the apps I consider quite useful --
pwsafe. Pwsafe is a password manager (originally for Windows) which has clones for Linux, which is great for me, since I use Windows at work, and Linux at home. It stores passwords in an encrypted database which you can take with you wherever you go.
So, to put this thing onto a Zaurus, you need a couple of things to start with:
- Embedix SDK (Embedix-sdk.tgz) for cross-compiler, libraries, etc.
- OpenSSL source (openssl-0.9.7d.tar.gz) -- libssl and libcrypto are pre-requisites for pwsafe. Get 0.9.7 because that still has configure targets for ARM (newer versions seem not to have this).
- Pwsafe source (pwsafe-2.0.0)
- Standard Linux build tools (autoconf, make, etc).
Build and install the Embedix SDK. By default, it will go into /opt/QtPalmtop.
Now, you will need to build and install OpenSSL. I used
these instructions to guide me. I couldn't really follow them to the letter, though -- something seems fishy with their patch file.
Anyway, configure the library for ARM, specifying the preferred install directory. Use the ARM cross-compiler:
CODE:
export PATH=/opt/Embedix/tools/arm-linux/bin:$PATH
./Configure linux-elf-arm --prefix=/home/misha/zaurus/arm
You'll need to hand edit the Makefile (or, if you're feeling lucky, try and patch it). All I had to change was add -ldl to the list of libraries to use.
CODE:
EX_LIBS= -ldl
All should be good to make and install the OpenSLL library now.
Now, it's time for pwsafe.
- Open acinclude.m4 and surround jm_CHECK_TYPE_STRUCT_UTIMBUF with the M4 quotation marks (`[' and `]'). My aclocal bitched about this and led to a malformed makefile being generated at the end.
- Open configure.ac and replace AM_SYS_POSIX_TERMIOS (apparently, this is obsolete) with AC_SYS_POSIX_TERMIOS. Without this, the configure script had problems with detecting some glibc stuff for me.
- Configure
CODE:
CXXFLAGS=-fpermissive ./configure --host=arm \
--with-openssl-dir=/home/misha/src/zaurus/openssl-0.9.7d/dist --with-readline=no --with-x=no
- You need -fpermissive because otherwise the compiler bitches
- You need --with-readline=no if you're like me and can't be bothered building readline
- You need --with-x=no if you're building this for QTopia, which doesn't have an X server
At this point, all you have left to do is make and deploy to the Zaurus. Libs (libssl and libcrypto) go in /opt/QtPalmtop/lib and the binary (pwsafe) goes into /opt/QtPalmtop/bin.
I'll wrap this up in an ipk a bit later to make deployment easier.