MulleFoundation, technically speaking
The class library of mulle-objc is the MulleFoundation. For
compatibility its name is shortened in #import
statements to just “Foundation”.
e.g. #import <Foundation/Foundation.h>
.
The MulleFoundation is assembled on a per-platform basis from various components.
Library | Contains |
---|---|
MulleObjC | NSObject, NSThread, NSAutoreleasePool… |
MulleObjCDarwinFoundation | OS X specifica (OS X only) |
MulleObjCExpatFoundation | XML PropertyList support |
MulleObjCFoundation | NSString, NSArray, NSException, KVC … |
MulleObjCICUFoundation | NSCalendar… |
MulleObjCLinuxFoundation | Linux specifica ( Linux only) |
MulleObjCPosixFoundation | NSTask, NSBundle, NSFileManager… |
Required Toolset
mulle-bootstrap
The dependencies are managed with mulle-bootstrap. If you clone the MulleFoundation repository, mulle-bootstrap will fetch and build all dependencies.
git
git is used by mulle-bootstrap to download the dependencies.
cmake (make)
cmake is a cross-platform Makefile generator. It is used instead of autoconf because it is somewhat easier to use and is available on more platforms (Windows).
mulle-clang
The mulle-clang compiler is needed to compile the various frameworks. They do not work with a different Objective-C compiler.
Required Libraries
(In addition to those needed by the runtime itself)
Library | Use |
---|---|
mulle-sprintf | A sprintf style formatted printer, needed for %@ arguments |
mulle-objc-runtime | The Objective-C Runtime |
mulle-utf | A unicode library for detection and conversion of Unicode strings. |
mulle-container | A collection of C data structures |
Porting considerations
The Foundation is designed so that you can add and remove Features cleanly and quickly.
- You don’t have and want Expat/XML ?
- Rip out the MulleObjCExpatFoundation.
- libicu is too heavy and you don’t need
NSCalendar
?- Drop MulleObjCICUFoundation from the build.
- You want to support another platform ?
- Don’t obscure the code with
#ifdef
s but add your platform specific code in categories like MulleObjCDarwinFoundation does.
- Don’t obscure the code with
MulleObjC and MulleObjCFoundation should be ready to run on any platform. For a new platform, try to build on top of MulleObjCPosixFoundation if possible. Otherwise consider creating a MulleObjCCommonFoundation and extracting reusable code from MulleObjCPosixFoundation to MulleObjCCommonFoundation. Then build your MulleObjCPlatformFoundation on top of this MulleObjCCommonFoundation.
If you want to run a different class library with mulle-objc, it would be probably easiest to build on top of MulleObjC.
Post a comment
All comments are held for moderation; basic HTML formatting accepted.