This is a guide for building pilot-mailsync for an Athlon 64-based system. I am a Debian user and, as such, have been spoiled by just doing an apt-get for whatever I want. Sadly, pilot-mailsync has not yet been packaged for Debian so I had to build it from source. Unfortunately, if you're running AMD64 this is much easier said than done. This guide should help you build it from source.
NOTE: This guide was written using my experiences on a Debian Sid system with an Athlon 64 processor with native 64-bit libs (debian-amd64). There may be some Debian-centric information in the guide that I am not aware of. For the parts that I know are specific to Debian, I will mark them as such. Also note that I have built pilot-mailsync using the --enable-gpilot flag as I want to integrate it with gpilotd. If you try to build it with jpilot support or just stand-alone, your mileage may vary. If you would like to contribute any information on building pilot-mailsync on a non-Debian AMD64 system, or with jpilot/without gpilot support please let me know. For starters, you will need to get the most recent version of pilot-mailsync from http://wissrech.iam.uni-bonn.de/people/garcke/pms/. This guide was written using version 0.9.0, released on May 10th, 2005. If you are using a different version your mileage may vary.
It is also important to note that I have been unable to get pilot-mailsync to build properly using gcc 4.0. I have had to use gcc 3.4 in order to get the build to succeed. While it is possible to pass the compiler to use as an option to configure, it does not appear to get passed onto the imap library. Instead, I would recommend creating a symlink from gcc 3.4 to /usr/bin/gcc. On a Debian system, this is as simple as running the following as root:
ln -fs /usr/bin/gcc-3.4 /usr/bin/gcc
Now it is time to run the configure script:
./configure --enable-gpilot CFLAGS=-fPICNote the CFLAGS option at the end. This option will force gcc to create position-independent code. While I am not yet familiar with all of the intricacies of compiling software for an AMD64 platform, and therefore can't explain why, exactly, position-independent code is important, I do know that the -fPIC option must be passed to gcc in order for the program to build correctly. :) If someone would care to contribute a blurb about the technical reasons for this I'd be very happy to include it here.
At this point, configure may or may not complete correctly, depending on whether you have all of the necessary development libraries installed. If you're running a distro that distributes pre-compiled binaries and you don't do much compiling from source on your box, you probably will not have the necessary libraries. The packages that I had to install on my Debian Sid system to build pilot-mailsync correctly are:
Or, if you'd prefer an easy-to-paste version for apt-get to use:
libpisock-dev gdk-imlib1-dev indent libart-dev libaudiofile-dev libdb3-dev libesd0-dev libglib1.2-dev libgnome-dev libgnorba-dev libgtk1.2-dev liborbit-dev libpopt-dev libwrap0-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxtrap-dev libxtst-dev libxv-dev xlibs-dev xlibs-static-dev libgnome-pilot2-dev libssl-dev libpam0g-dev libbonobo2-dev libgconf2-dev libgcrypt11-dev libgnome2-dev libgnomevfs2-dev libgnutls11-dev libgpg-error-dev libopencdk8-dev liborbit2-dev libtasn1-2-dev libxml2-dev libart-2.0-dev libbonoboui2-dev libglade2-dev libgnome-keyring-dev libgnomecanvas2-dev libgnomeui-dev libtoolNote that not all of these are required for configure to complete successfully, however they were all necessary in order for me to complete the entire build process. If in doubt, install them all, build the plugin, and then remove them all.
With configure finished successfully, it is time to build pilot-mailsync:
makeAfter the build has gone on for a while, it will fail with the following error:
/usr/bin/ld: /home/demonbane/pilot-mailsync/pilot-mailsync-0.9.0/imap-2004c1/c-cl\ ient/libc-client.a(osdep.o): relocation R_X86_64_32 against `a local symbol' can \ not be used when making a shared object; recompile with -fPIC /home/demonbane/pilot-mailsync/pilot-mailsync-0.9.0/imap-2004c1/c-client/libc-cli\ ent.a: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [libgnome_mailsync_conduit.la] Error 1 rm parsedate.cYou'll notice in the above error that there's a message saying recompile with -fPIC. But we did a configure with CFLAGS=-fPIC set earlier, didn't we? Unfortunately, the imap support libraries don't pull in the appropriate information and therefore need to be fixed by hand. Change directories into the c-client directory:
cd imap-2004c1/c-client/Now check what OSTYPE was detected by looking at the OSTYPE file:
cat OSTYPEI have seen both lnx and slx detected here on my machine, so it's a good idea to check just in case. Now you will need to edit the Makefile (remember, this is inside of imap-2004c1/c-client/). We will need to make two changes to the code. First, we will need to re-define the ln command to force over-writes (runs of make after the initial one started earlier cause some symbolic links to not be cleaned up properly). Then we will need to change the BASECFLAGS variable to add -fPIC. Open up Makefile in your editor of choice and look for the following section:
# Commands possibly overriden by the individual port ARRC=ar rc CC=cc LN=ln -s RANLIB=ranlibYou will need to add an "f" to the end of the LN line, so that it now looks like this:
LN=ln -sfNow you will need to find the appropriate OSTYPE section of the file. Assuming that your OS was detected as lnx earlier, you'll be looking for the following section of code:
lnx: # Linux non-shadow passwords @echo You are building for traditional Linux *without* shadow @echo passwords and with the crypt function in the C library. @echo If your system has shadow passwords, or if crypt is not @echo in the C library, you must use slx, sl4, or sl5 instead! $(BUILD) `$(CAT) SPECIALS` OS=$@ \ SIGTYPE=psx CRXTYPE=nfs \ SPOOLDIR=/var/spool \ ACTIVEFILE=/var/lib/news/active \ RSHPATH=/usr/bin/rsh \ BASECFLAGS="-g -O"Here you will need to edit the BASECFLAGS line and add the -fPIC option so that it looks like this:
BASECFLAGS="-g -O -fPIC"Now it's time to clean up and re-build this section of code, so still in the c-client directory do a make clean followed by a make with the OSTYPE listed as the only argument after it. In other words, assuming that you had lnx as OSTYPE earlier, you would do:
make clean make lnxOnce this completes it's just time to finish up the rest of the build. So go back to the base build directory:
cd ../..and do a make. This should complete without any further problems. Now it's just time to do your choice of build installs, and you're all set. In the case of using the gpilot plugin, this will be make gplugin_install. During this process make will need to change some permissions on some system files, so don't forget to become root before issuing the final make:
su Password: make gplugin_installOnce this completes, you'll be all set. If, like me, you built with gpilotd support, you can run gpilotd-control-applet and you should see MailSync listed under the Conduits. And with that, you're done!