Building universal Stellarium 0.8.1 on an Intel Mac
What follows is a quick overview of what I did to build a universal application from Stellarium 0.8.1 sources on an Intel Mac.
What you need
- 1) Stellarium 0.8.1 sources that you can download here. They are in the file stellarium-0.8.1.tar.gz
- 2) A ready made Xcode project for building Stellarium on Mac OS X. You can download the file macosx-xcode.tar.gz containing such project from here. I choose revision 1.4.
- 3) An Intel Mac (a PowerPC Mac should make it too) with developer tools installed. I used Xcode 2.4.
After extracting the archives you should have two folders, one named stellarium-0.8.1 and the other named macosx. Make sure to place the macosx folder into the stellarium-0.8.1 folder, as this is essential for successful project building.
If you want to build an universal binary you have to modify the build settings of the Stellarium target, since they target a PPC architecture. Open the Stellarium target properties, choose the build tab and add the i386 architecture to the Architectures setting (double click on the row and check the i386 checkbox). This must be done for all configurations for which you want to build a universal binary.
Fixing some quirks
At this point one would expect to build the project, but after some work the compiler complains and stops the build. These are the code changes I had to do to successfully build the project:
- 1) There is a missing libgnuintl.h header file. This file should probably be one of the outputs of the configure script in the stellarium-0.8.1 folder. On my machine this script aborts prematurely and I didn't manage to make it work. As a workaround you can copy the libgnuintl.h.in file in the stellarium-0.8.1/intl folder to a file named libgnuintl.h in the same folder and replace in it the string @HAVE_POSIX_PRINTF@ with the string HAVE_POSIX_PRINTF. I don't know if doing this is correct but it seems to work!
- 2) There is a #include to change in the file gettext.h:
<pre> # include <libintl.h> </pre>
must be changed to:
<pre> #ifdef _LIBC # include <libintl.h> #else # include "libgnuintl.h" #endif </pre>