Posted: Sunday December 11, 2005
Tagged with: linux kde qt OSX
Getting kdelibs to compile on a Mac under Qt/Mac is a bit of a battle. Well, it isn't really, but getting everything to work properly is. Why would anyone try? Well, having switched from a linux box a while ago, I find myself missing my favorite linux app (and for that matter, music app on any platform) - Amarok. Truth be told, it kicks ass.
So I got down to work. This being my second attempt, the first having been a while ago with no Mac compiling experience and thus abandoned, it actually seemed to go really smoothly seeing as kdelibs 3.5 has been made to be largely platform independent (apart from just three outstanding X11 calls). Great. How? This is how:
I'm using Tiger so to start off with, I set gcc to version 3.3 with:
When I compiled this, I found it necessary to set libtool to use mac specific undefined link flags so I did this too when compiling the Mac kdelibs (this could be totally unnecessary).
The environment variables need to be set up properly, of course. Mine were as follows, bearing in mind that I wished to install KDE into /KDE , my Qt libs were at /Developer/qt and my Fink installation was at /sw
It is important using Tiger, that the compiler/linker uses Apple's ImageIO Framework instead of Fink's jpeglib or libpng. The headers nevertheless are required from Fink. This can be done once Fink has installed the libraries by creating a symbolic link inside /sw/lib to the Framework libraries (one line):
ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/¬
The same can be done for libpng.dylib. It is worth saving a backup of the Fink libraries first though, as they might come in handy later if problems crop up. After extracting the tarball, it was time to configure the compile process. I used the following:
LDFLAGS="-undefined dynamic_lookup" ./configure --enable-mac --without-arts --prefix=/KDE ¬
It is worth noting first though, that I have all the dependencies inside the /sw directory from Fink.
This should go smoothly, but if not, its because of missing dependencies.
Then comes the make process. Should be straightforwards enough, but as I mentioned there are I believe, 3 instances in which a few X11 calls have to be removed, but it is pretty easy to see where and how.
And thats how I compiled kdelibs using Qt/Mac. Now the question: does it work? Good for now. For example, KHotNewStuff runs and loads stuff from the internet (first putting it inside an application bundle). Also, kdeinit works very well, initialising dcop, etc.
Update 01/01/06 I have uploaded a patch. Get it here.