The Haus

Setting Up the PRC Tools in Linux

May 30, 2001 -- by A.T. Hun

Last updated: December 8, 2001

Please note: Most of this information is getting long in the tooth. There is a new page with instructions for installing the PRC tools in Linux, written by the very people who are designing said tools. I suggest you check it out. Someday I might come back and update this . . .

Write Programs for Your PalmOS Device in Linux!

Palm has gone to great lengths to provide the community with programming tools. There is no greater evidence of this than the fact that the 10,000th program has been released for the PalmOS! Unfortunately I had a hard time finding a decent HOWTO for getting the PRC Tools and the PalmOS SDK set up in Linux. Here is how I did it in my Red Hat Linux 7.1 installation. Other Linux distributions should be relatively similar.

Please note: You don't need to be root to compile anything, but you do need to be root to install RPMs or to issue the make install command. All commands should be issued from the directory you downloaded all the files into, unless otherwise noted.

Files You Will Need

Please note: these files are all the most recent versions as of this writing. It is generally best to get the newest versions available. (Update! There is one exception to thisrule. As of the 3.3 version of the Palm emulator, the emulator will not compile with a 1.1.x version of the Fast Light Tool Kit. It still requires 1.0.x)

From the PRC Tools page:

From the PalmOS SDK 4.0 page:

From the PalmOS Emulator (POSE) page:

From the Red Hat 7.1 Disc 2 (assuming this isn't already installed):

From the Red Hat 7.1 Powertools Disc:

From the Fast Light Tool Kit page:

* These files are not required, but highly recommended.

Installing the PRC Tools

The PRC Tools require the ncurses4 libraries, so mount Red Hat 7.1 Disc 2, and type (assuming you have the CD-ROM drive mounted at /mnt/cdrom):
rpm -ivh /mnt/cdrom/RedHat/RPMS/ncurses4-5.0-2.i386.rpm

I used the -i switch (install) instead of the -U switch (upgrade) to make sure that it didn't overwrite the default Red Hat ncurses installation. Once that is done, type the following commands to install the PRC Tools and supporting documentation:
rpm -Uvh prc-tools-2.0-1.Linux-i386.rpm
rpm -Uvh prc-tools-htmldocs-2.0-1.Linux-i386.rpm
tar xfvz prc-tools-samples.tar.gz -C /usr/local/palmdev

Installing the PalmOS 4.0 SDK

To install the PalmOS 4.0 SDK, issue the following commands in order:
tar xfvz sdk40.tar.gz
rpm -ivh palmos-sdk-4.0-1.noarch.rpm

By default, the PalmOS 4.0 SDK installs itself into /opt/palmdev/sdk-4. Unfortunately, version 2.0 of the PRC Tools assumes that the current SDK will be installed in /usr/local/palmdev/sdk. This is easily remedied with our good friend, the symbolic link! Just issue this command:
ln -s /opt/palmdev/sdk-4 /usr/local/palmdev/sdk

According to what I've read, version 2.1 of the PRC Tools will assume that the SDK is in /opt/palmdev/sdk.

You can put the 4.0 SDK documentation and examples anywhere. For the sake of simplicity, I put them in the sdk-4 subdirectory. Issue the following commands:
tar xfvz sdk40-examples.tar.gz -C /opt/palmdev/sdk-4
tar xfvz sdk40-docs.tar.gz -C /opt/palmdev/sdk-4

The examples will be in /opt/palmdev/sdk-4/Examples and the documentation will be in /opt/palmdev/sdk-4/Documentation.

Installing the PalmOS Emulator (POSE)

POSE requires the Fltk to be installed. Use the following commands to install it:
tar xfvz fltk-1.0.11-source.tar.gz
cd fltk-1.0.11
./configure
make
make install

Once that's all done, you can compile and install POSE itself. Unfortunately, the POSE code doesn't like the gcc compiler that ships with Red Hat 7.1. If you compile it normally, POSE will drop core when it tries to load a ROM. The switch for the configure command prevents this from happening. (Update! I am pleased to report that the --enable-debug switch is not necessary with the gcc compiler that comes with Red Hat 7.2 and the Palm emulator version 3.3.) Issue the following commands:
tar xfvz emulator_src_31.tar.gz
cd Emulator_Src_3.1/BuildUnix
./configure --enable-debug
make
make install

The emulator needs the skins to run. The skins allow the emulator to look just like the device it is emulating (Handspring Visor, Palm IIIxe, etc.). Following the advice in the README, I installed them in /usr/share/pose. This command should do the trick:
tar xfvz emulator_skins_16.tar.gz -C /usr/share/pose

After that, rename the Skins_v1.6 directory to Skins with the following command: mv Skins_v1.6 Skins That way the emulator will know where to look. Or you could create a symbolic link: ln -s Skins_v1.6 Skins

To get POSE to work you will need to get a ROM from a PalmOS device. The easiest way to do that is to transfer it from your device. Check the POSE docs on how to do that. If you have a Handspring Visor or Visor Deluxe, check out my HOWTO to transfer your ROM. If you live in the US, you can download ROMs from other Palm devices by signing up for the Palm Alliance Program. I did it. It is a very painless way to get extra ROMs for testing. I put all my ROMs in /usr/share/pose.

Installing the PilRC

PilRC is a handy program that takes a resource script file and turns it into one or more binary resource files. If you are brand new to PalmOS programming, that probably doesn't mean much to you. For now, just trust me that it is very cool. Mount the Red Hat 7.1 Powertools disc and issue:
rpm -Uvh /mnt/cdrom/RedHat/RPMS/pilrc-2.5b7-4.i386.rpm

Phew! Now What?

Congratulations! Now you have all the PalmOS tools working in Linux. You are now ready to program! I recommend checking out the Lonnon R. Foster's PalmOS Programming Bible (N.B. The Haus has no affiliation with Amazon.com). I took the "Hello World" program from its CD and compiled it to make sure I had everything installed properly. It worked like a charm. I hope this HOWTO helps you on your way to becoming a PalmOS programmer!