Next Page > Hide TOC

Introduction to Porting UNIX/Linux Applications to Mac OS X

The UNIX Porting Guide is a first stop for UNIX developers coming to Mac OS X. This document helps guide developers in bringing applications written for UNIX-based operating systems to Mac OS X. It provides the background needed to understand the operating system. It touches on some of the design decisions, and it provides a listing and discussion of some of the main areas that you should be concerned with in bringing UNIX applications to Mac OS X. It also points out some of the advanced features of Mac OS X not available in traditional UNIX applications that you can add to your ported applications.

This document also provides an entry point for other documentation on various subjects that may be of interest if you are porting an application from a UNIX environment to Mac OS X.

This document is an overview, not a tutorial. In many regards it is a companion to the more extensive Mac OS X Technology Overview, but with a bias toward the UNIX developer.

This document also does not cover porting shell scripts to Mac OS X. For more information about shell scripts and Mac OS X, you should read Shell Scripting Primer.

Contents:

Bringing UNIX Apps to Mac OS X
Who Should Read This Document?
Organization of This Document
See Also


Bringing UNIX Apps to Mac OS X

The introduction of UNIX-like operating systems such as FreeBSD and Linux for personal computers was a great step in bringing the power and stability of UNIX to the mass market. Generally though, these projects were driven by power users and developers for their own use, without making design decisions that would make UNIX palatable to consumers. Mac OS X, on the other hand, was designed from the beginning with end users in mind.

With this operating system, Apple builds its well-known strengths in simplicity and elegance of design on a UNIX-based foundation. Rather than reinventing what has already been done well, Apple is combining their strengths with the strengths brought about by many years of advancement by the UNIX community.

Who Should Read This Document?

Any UNIX developers can benefit from reading this book.

If you’re a commercial UNIX developer, you are already familiar with other UNIX-based systems and may want to understand the differences between other systems and Mac OS X. You might be interested in porting the GUI from an X11 environment into a native graphics environment using Carbon or Cocoa. You may also have special needs such as direct hardware access, exclusive file access guarantees, and so on.

If you’re a corporate in-house developer (developing applications for internal use), you probably want to port applications with minimal code divergence.

If you’re an open source developer, you might want information about how to incorporate new technologies into your software, and may be interested in GUI porting, depending on your level of interest. Alternately, you might be interested only in quickly porting code to a new platform with minimal changes so that you can easily get your changes back into the official code base. If so, you may be more likely to use compatibility shims than to use new APIs.

No matter what “flavor” of developer you are, this book will provide information that is helpful to you and provide pointers to additional documents that may be of interest.

Important: This document is not designed for pure Java developers. Mac OS X has a full and robust Java 2 Platform, Standard Edition (J2SE) implementation. If you have a pure Java application already, it should run in Mac OS X. More information on Java development can be found at http://developer.apple.com/documentation/Java/Java.html.

Organization of This Document

This document is a first stop for UNIX developers coming to Mac OS X. It contains many links to more extensive documentation. Specific details of implementation are covered here only in cases where it is not adequately covered in other places in the documentation set.

To use this document most effectively, first read “Overview of Mac OS X” to find out the basics about the Mac OS X platform and to get some of the high-level information you need to begin your port. If you already have an application that builds on other UNIX-based platforms, “Compiling Your Code in Mac OS X” will help you find out how to compile your code on Mac OS X.

Most of your effort, however, should be spent towards making decisions concerning which, if any, graphical user interface to implement with your application. “Choosing a Graphical Environment for Your Application” helps you with this.

If you want to refactor your application to take advantage of the rich feature set of Mac OS X, see “Additional Features” for examples of features available in Mac OS X.

Once you have a complete application, read “Distributing Your Application” for information on getting your application to Mac OS X users.

See Also

Developer documentation can be found at Apple’s developer documentation website at http://developer.apple.com/documentation/. This site contains reference, conceptual, and tutorial material for the many facets of development on Mac OS X. The Mac OS X Developer Tools CD includes a snapshot of the developer documentation, which is installed in /Developer/ADC Reference Library/documentation and can be searched for and viewed in Xcode’s doc viewer. They are also accessible from Apple’s Technical Publications website. The man pages are also included with the Mac OS X Developer Tools.

Apple Developer Connection (ADC) hosts a website full of information useful to UNIX developers targeting Mac OS X, http://developer.apple.com/unix. ADC also offers a variety of membership levels to help you in your development. These range from free memberships that give you access to developer software, to paid memberships that provide support incidents as well as the possibility of software seeds. More information on memberships is available at http://developer.apple.com/membership/.

Once a year in early Summer, Apple hosts the Worldwide Developers Conference (WWDC) in the San Francisco, California Bay area. This is an extremely valuable resource for developers trying to get an overall picture of Mac OS X as well as specific implementation details of individual technologies. Information on WWDC is available on the ADC website.

Apple hosts an extensive array of public mailing lists. These are available for public subscription and searching at http://lists.apple.com. The unix-porting list is highly recommended. The darwin-development and darwinos-users lists also offer much help but less specific to the task of porting.

In addition to Apple’s own resources, many external resources exist. Two recommended websites are O’Reilly’s Mac DevCenter, http://www.oreillynet.com/mac/, and Stepwise, at http://www.stepwise.com.



Next Page > Hide TOC


© 2002, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-04-08)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.