This covers the rather special Unix variant that is Apple MacOS X. You'll need XCode installed along with the Apple X11 implementation plus at least scons v0.96.1 (which added MacOS X support). v0.88.1 was tested on 10.5.4, XCode 3.1.1 and scons v0.96.90 (the v1.x series won't finish the build on Macs for some odd reason).
This page doesn't duplicate what's already said in Unix-specific notes so you should also read that. The very good news is that 10.5 is much improved over 10.4 thanks to much improved POSIX compatibility.
TnFOX was originally developed against Apple MacOS X v10.4.6 and XCode v2.3 on Intel x86 only. The PowerPC build has however been tested on x86 via Rosetta and appears to work just fine, but has not been extensively tested.
You have two choices when building TnFOX on Apples - the first is the same as on other platforms where you set x86
or x64
, however if you choose x86 then you MUST set architecture_version=7, x86_SSE=2 and x86_3dnow=0 in config.py as the Apple GCC won't output valid code for other architecture configurations.
The other choice is to specify one of the special architectures macosx-ppc/macosx-i386
. If you want to build a Universal binary, then you must use these. Firstly you build one, then change the config and build the other so you get two full builds - one PowerPC, the other i386. This is necessary because the endian is different for each.
You must then merge the two binaries into a Universal one using Apple's libtool:
Merging code to be added later
Unlike most Unices, MacOS X is missing libraries for JPEG, PNG and TIFF. Ideally you should install macports or fink and have these added - I personally had to manually hack them into /usr/local
because scons wouldn't find them anywhere else. Failing this, you can download a /usr/local
tree containing these from the TnFOX homepage after which these libraries will be found and used.
- Apple's X11 implementation provides Xft support, but will return no fonts available. Run 'sudo fc-cache' to fix this problem.
- MacOS X 10.4 has shitty support for thread cancellation. It is inconsistent, unreliable, and generally downright buggy. In particular, it does not support thread cancellation during select(). This is a major problem for TnFOX as the POSIX threads spec says it should be, so TnFOX emulates correct behaviour using an internal per-thread pipe to signal cancellation. You shouldn't notice any difference generally speaking.
- You MUST define
_APPLE_C_SOURCE
when compiling any code using TnFOX. This causes alternative (and improved) implementations of many C library functions to be used instead of the defaults. Failing to do this will cause random crashes and other weird behaviour.
- TestDLL fails on MacOS X due to
dlclose()
not kicking out a shared library like it's supposed to do.
- MacOS X does not come with a FAM implementation, so the BSD fallback of kqueues is used. These unfortunately have limitations - see the doc page for FX::FXFSMonitor. In particular, they won't monitor non-HFS partitions, so if you try running TestFSMonitor from a FAT partition, it will fail.
- TestGraphing fails on MacOS X due to buggy support within the X11 OpenGL routines. Specifically, because TnFOX sets
XInitThreads()
, the OpenGL code hangs in the internally called XLockDisplay()
. If you really need OpenGL working, you will have to comment out this call in FXApp.cpp
and of course lose multithreaded GUI support.
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:36 2009 for TnFOX by
v1.4.7