Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC

Scoping Your Transition Project

Apple now ships Intel-based Macintosh computers as well as PowerPC-based Macintosh computers. If you have an application designed only for the PowerPC processor, you'll want to make a version of your application to run natively on Intel-based Macintosh computers now that they are available to the public. But you'll also want your application to continue to run on PowerPC Macs. This page will help you understand what you will need to do.

The amount of work to prepare your application depends on the type of code you have and the compiler that you currently are using. The transition chart below shows the three most common transition paths. Projects that consist entirely of Java, Applescript, or other code written using an architecture-independent language require no work. (There are caveats if you mix in C, C++, or Objective-C.) The other two paths require that you build a universal binary. Universal binaries are applications, libraries, and frameworks that run natively on PowerPC and Intel-based Macintosh computers. Setting the universal options for building the binary is easy. Getting your code to that point is what requires most of the work.

The sections that follow describe that tasks required for each path and provide resources that can help you. Regardless of the transition path you take, when you have an application that builds, you need to test it on both architectures. You will either want to obtain an Intel-based Macintosh computer or arrange to use the ADC Compatibility Labs in Cupertino.

Before You Follow a Transition Path

Before you prepare or compile any code, you should familiarize yourself with the main issues that can prevent applications developed for PowerPC-based Macintosh computers from running on Intel-based Macintosh computers. Understanding the issues is useful even if you are a Java developer or use another architecture-independent language.

Read these sections in Universal Binary Programming Guidelines, Second Edition:

  • Introduction lists the requirements necessary for beginning the transition.
  • Architectural Differences will help you recognize and write portable code.
  • Swapping Bytes provides details about the most fundamental architectural difference—that of byte ordering—and discusses strategies for handling these issues. Most code changes that you'll need to make will be due to byte ordering differences between architectures, so you'll want to read this chapter carefully.

In the same document, quickly skim Guidelines for Specific Scenarios. Most of the situations described there won't apply to your application, but it is worthwhile to see what might affect your code. It could save you a lot of debugging time later on.

Mac OS X Projects That Use AltiVec Code

AltiVec code is specific to the PowerPC architecture. You'll need to take one of the following courses of action:

  • Replace AltiVec code with calls to the Accelerate framework. This is the preferred solution because it lets the operating system perform the chip-specific optimizations for you. You won't have to concern yourself with the particular hardware that Mac OS X runs on.
  • Write architecture-specific code for Intel-based Macintosh computers. This approach is recommended only when you need optimizations that Accelerate can't provide.

Read Preparing Vector-Based Code in Universal Binary Programming Guidelines, Second Edition.

Mac OS X Projects That Compile Using CodeWarrior

You need to move your project from CodeWarrior to Xcode 2.1 or later (Xcode 2.2 recommended). See Porting CodeWarrior Projects to Xcode.

After you move your project to Xcode 2.1 or later, find information about the appropriate settings to create a universal binary by reading:

If your project also uses the PowerPlant framework, see Using PowerPlant in Universal Binary Programming Guidelines, Second Edition.

Mac OS X Projects That Compile Using Xcode

If your project uses Xcode 2.0 or earlier, you need to move it to Xcode 2.1 or later (Xcode 2.2 recommended). Starting with Xcode 2.1, the compiler is GCC 4.0. Most of the issues you'll encounter will be related to using that compiler. See Porting to GCC 4.0 Release Notes.

When your project compiles successfully using Xcode 2.1 or later, find information about the appropriate settings to create a universal binary by reading:

If your project also uses the PowerPlant framework, see Using PowerPlant in Universal Binary Programming Guidelines, Second Edition.

Open Source and UNIX Projects That Compile Using Makefiles

Applications that build using makefiles must be compiled using GCC 4.0 or later.

If you are using a version of GCC that's earlier than 4.0, you need to switch to GCC 4.0. See Porting to GCC 4.0 Release Notes.

When you are using GCC 4.0 or later, you need to make the appropriate cross-architecture settings to create a universal binary. You can find information about cross-architecture settings by reading the following resources, which also discuss issues related to the use of GNU Autoconf macros when building a universal binary.

Java, AppleScript, Python, JavaScript, Shell Scripts and other Architecture-Independent Languages

Code that uses architecture-independent languages is not precompiled. This means that your work is done, with one caveat. If your Java application uses JNI libraries, you must build these libraries universally because they contain non-Java code (C, C++, Objective-C).

Testing and Debugging

Getting your application to build with universal settings—whether on a PowerPC Mac or an Intel-based Macintosh—is not the end of the transition. It's important that you run your test suite on all the systems that your application should run on. In addition, there are behaviors that you need to look for when testing your application on an Intel-based Macintosh. Unexpected numerical results, incorrect colors, and other behaviors are symptoms of byte-ordering and other differences between architectures. You can find out more by reading the Troubleshooting section in Universal Binary Programming Guidelines, Second Edition.

Additional Resources

Apple offers the following resources to help you through the transition:

  • Developer Transition Resource Center—Apple's suite of resources targeted at making the transition to Intel-based Macintosh computers.
  • ADC Compatibility Labs—A facility in Cupertino that you can visit to test your universal binary on a variety of Macintosh configurations, including Intel-based Macintosh computers.
  • Xcode Users Mailing List—An excellent forum for discussing problems using Xcode in Mac OS X.