Portability

So I spent some time over this past weekend trying to make sure that kdesvn-build works on FreeBSD instead of just working on Linux. Someone at #kde-devel was gracious enough to give me access to a FreeBSD system for testing purposes.

I was actually quite surprised at how little I had to do to get kdesvn-build to run. There was only one thing that I can find so far that I messed up in kdesvn-build, which was to use GNU-specific command line arguments to the copy program. And this was only for the qt-copy module.

After fixing that bug though, kdesvn-build would still often fail on the test system. So I tried tracking down the cause of other errors, and it turns out that the KDE build system doesn’t quite detect all versions of autoconf and automake. Normally it works anyways since most people have the tools installed as automake and autoconf. For systems that didn’t, however, like the FreeBSD install I had access to, if you didn’t have your tools named with one of the searched-for filenames, KDE would be unable to build.

So I went and rewrote the autotools detection code. It wasn’t hard or anything, so it’s not like this was a major hack. However it does mean, from what I understand, that FreeBSD users won’t need to install the special gnu-autoconf and gnu-automake ports just to build KDE anymore (as long as the autotools are installed, that is). I’ve also had someone report that now KDE on NetBSD gets at least through make -f Makefile.cvs without patches required now. :-)

Another bonus is that you can now use environment variables before you run make -f Makefile.cvs to point to exactly the program you want to use. As an example, you could set AUTOMAKE=”/usr/bin/automake19″ if you wanted to override the new detection code.

One final change is that if you have a script just called “automake”, and then a versioned automake script (e.g. automake18), the unversioned script will be preferred, which is a change from the old code. This also applies to autoconf.

What this means is that the latest version of kdesvn-build (in trunk, not v0.97) should be able to get much further in building KDE from trunk on FreeBSD than it did before. I’ve tested qt-copy and arts so far, which is hardly a representative example, but then it’s not my machine. ;-) If you use unsermake, you also need to make sure you update unsermake to pick up a change I made to call the correct autoconf. If you experience any problems with the changes please let me know.