CopperSpice Overview  1.5.2
Development for Mac OS X

To use platform specific features, enclose your platform specific code using the appropriate #ifdef directives.

Mac OS

Mac OS X is a UNIX like platform and was designed to run exclusively on Macintosh computers. The main difference is Unix uses X11 as it primary windowing system and Mac OS X uses its own native windowing system that is accessible through the Cocoa APIs.

The core of Mac OS X is a POSIX compliant operating system built on top of the XNU kernel, with standard Unix facilities available from the command line interface. Apple has released this family of software as an open source operating system named Darwin.

Mac Development

Application development on Mac OS X is done using Xcode which is an IDE that provides interfaces to compilers that support programming languages like C, C++, Objective-C, clang, and Java.

Xcode is distributed in the App Store as a stand alone application. After installing Xcode the clang compiler should be available. Xcode includes an Apple version of the GCC compiler which will be required to install MacPorts.

  • On Mac OS X 10.12 the version of Xcode is 9.2
  • On Mac OS X 10.13 the version of Xcode is 9.2

For more information and to download Xcode refer to the following Xcode

Compilers

For information about the Mac OS X requirements refer to Building for Mac OS X.

Universal Binaries

Universal binaries are used to bundle binaries for more than one architecture into a single package, simplifying deployment and distribution. When running an application the operating system will select the most appropriate architecture.

Universal binaries support the architectures listed in the following table. If there are no -arch flags specified, configure builds for a 32-bit architecture and 64-bit architecture by default.

Architecture Options/Flags
Intel, 32-bit -arch x86
Intel, 64-bit -arch x86_64
PPC, 32-bit -arch ppc
PPC, 64-bit -arch ppc64

Application Architecture

Applications built on Mac OS X are by default, built for both x86 and x86_64. To build for a single architecture modify the CXXFLAGS in your Makefile.am

# 32 bit
CXXFLAGS += -arch x86
# 64 bit
CXXFLAGS += -arch x86_64

Additional Mac OS X Information