Installing DeSmuME from source on OS X

From DeSmuME
(Difference between revisions)
Jump to: navigation, search
(OS X App Build for Final Release)
(Build the DeSmuME Source)
Line 215: Line 215:
 
3. In the Build Target menu, under Active Target, choose one of the four build targets.
 
3. In the Build Target menu, under Active Target, choose one of the four build targets.
  
''Note: If you have previously made the OS X App Legacy build, you MUST perform a project clean prior to building the standard OS X App build. To do this, perform steps 4.5 and 4.6.''
+
''Note: If you have previously made the OS X App Legacy build, you MUST perform a project clean prior to building the standard OS X App build. To do this, perform steps 3.5 and 3.6.''
  
4.5. Choose Build > Clean All Targets.
+
3.5. Choose Build > Clean All Targets.
  
4.6. If the Clean All Target sheet drops down, check all options, then click Clean.
+
3.6. If the Clean All Target sheet drops down, check all options, then click Clean.
  
5. Choose Build > Build, and then wait for Xcode to finish building the app.
+
4. Choose Build > Build, and then wait for Xcode to finish building the app.
  
 
And you're done! The newly built app will be present in the "/trunk/desmume/src/cocoa/build/Release" folder.
 
And you're done! The newly built app will be present in the "/trunk/desmume/src/cocoa/build/Release" folder.
Line 261: Line 261:
 
3. In the Build Target menu, under Active Target, choose the build target "DeSmuME (OS X App; PowerPC; LLVM-Clang)".
 
3. In the Build Target menu, under Active Target, choose the build target "DeSmuME (OS X App; PowerPC; LLVM-Clang)".
  
''Note: If you have previously made the OS X App Legacy build, you MUST perform a project clean prior to building the standard OS X App build. To do this, perform steps 4.5 and 4.6.''
+
''Note: If you have previously made the OS X App Legacy build, you MUST perform a project clean prior to building the standard OS X App build. To do this, perform steps 3.5 and 3.6.''
  
4.5. Choose Build > Clean All Targets.
+
3.5. Choose Build > Clean All Targets.
  
4.6. If the Clean All Target sheet drops down, check all options, then click Clean.
+
3.6. If the Clean All Target sheet drops down, check all options, then click Clean.
  
5. Choose Build > Build. This will make a new app called "DeSmuME (PPC).app" in the "/trunk/desmume/src/cocoa/build/Release" folder.
+
4. Choose Build > Build. This will make a new app called "DeSmuME (PPC).app" in the "/trunk/desmume/src/cocoa/build/Release" folder.
  
6. Open the "DeSmuME (XCode 4).xcodeproj" project file.
+
5. Open the "DeSmuME (XCode 4).xcodeproj" project file.
  
7. Choose Product > Scheme > DeSmuME (OS X App; v10.5 Leopard Release Build).
+
6. Choose Product > Scheme > DeSmuME (OS X App; v10.5 Leopard Release Build).
  
8. Choose Product > Build For > Archiving, and then wait for Xcode to finish building the app.
+
7. Choose Product > Build For > Archiving, and then wait for Xcode to finish building the app.
  
 
And you're done! The newly built app will be present in the "/trunk/desmume/src/cocoa/build/Merged Release" folder.
 
And you're done! The newly built app will be present in the "/trunk/desmume/src/cocoa/build/Merged Release" folder.
Line 284: Line 284:
 
3. In the Build Target menu, under Active Target, choose one of the four build targets.
 
3. In the Build Target menu, under Active Target, choose one of the four build targets.
  
''Note: If you have previously made the standard OS X App build using Xcode 3, you MUST perform a project clean prior to building the OS X App Legacy build. To do this, perform steps 4.5 and 4.6.''
+
''Note: If you have previously made the standard OS X App build using Xcode 3, you MUST perform a project clean prior to building the OS X App Legacy build. To do this, perform steps 3.5 and 3.6.''
  
 
''Note: You do NOT have to perform a project clean if you made the standard OS X App build using Xcode 4.''
 
''Note: You do NOT have to perform a project clean if you made the standard OS X App build using Xcode 4.''
  
4.5. Choose Build > Clean All Targets.
+
3.5. Choose Build > Clean All Targets.
  
4.6. If the Clean All Target sheet drops down, check all options, then click Clean.
+
3.6. If the Clean All Target sheet drops down, check all options, then click Clean.
  
5. Choose Build > Build, and then wait for Xcode to finish building the app.
+
4. Choose Build > Build, and then wait for Xcode to finish building the app.
  
 
And you're done! The newly built app will be present in the "/trunk/desmume/src/cocoa/build/Release" folder.
 
And you're done! The newly built app will be present in the "/trunk/desmume/src/cocoa/build/Release" folder.

Revision as of 04:39, 13 March 2013

Contents

About the Build Targets

DeSmuME for OS X may be built using several different configurations. Each build configuration is listed in an Xcode project as a "build target." The Xcode project files (provided with the DeSmuME source,) provide several build targets to suit your needs. Many build targets are similar to each other, and so they have been organized into the following categories, based on what the build target produces.


OS X App

These build targets produce a self-contained OS X application package (or "app bundle"). These builds use our official OS X frontend to run the DeSmuME emulator, and are designed for the debugging and testing of pre-release builds. These app bundles are compatible with OS X v10.6 or later. (Also compatible with OS X v10.5 if building from the Xcode 3 project).

Build Target Goals:

  • Fully featured.
  • Widest build compatibility with Xcode versions running different OS X versions.
  • Quick debug-and-test of code changes.

Advantages:

  • Can be built on machines running OS X v10.5 or later, and Xcode 3.1.4 or later.
  • Binaries can be configured to run in debug mode or in release mode.
  • Binaries can be configured for PowerPC or Intel compatibility.
  • Building the app is faster than the final release build.

Disadvantages:

  • Binary compatibility with OS X v10.5 requires Xcode 3 to build.


OS X App (Final Release)

There is only one build target of this kind, and is only used for final release builds. It also produces an app bundle like the usual debug-and-test builds, but has the widest compatibility of all the builds.

Build Target Goals:

  • Fully featured.
  • Widest binary compatibility.
  • Fastest performance.

Advantages:

  • Produces the fastest running binaries compared to all other build targets.
  • Produces a universal binary that supports both 32-bit and 64-bit.

Disadvantages:

  • Must be built on a machine running the latest version of OS X and Xcode.
  • Building the app for release takes more steps than other builds.
  • Requires Xcode 3 to build.


OS X App (Legacy)

These build targets produce a self-contained OS X application package that uses our legacy OS X frontend to run the DeSmuME emulator. These build targets are deprecated, but continue to exist for historical reasons, and also for people who need an app bundle that can run on OS X v10.4.

Build Target Goals:

  • Binary compatibility with OS X v10.4.
  • Retain legacy code for historical reference.

Advantages:

  • Can be built on machines running OS X v10.5 or later.
  • The build app is backwards compatible with OS X v10.4.
  • Binaries can be configured for PowerPC or Intel compatibility.

Disadvantages:

  • These builds are deprecated. We no longer do any active development work on the legacy code.
  • Built applications use the legacy user interface, which does not expose all of DeSmuME's current features to the user.
  • Requires Xcode 3 to build.
  • Produces the slowest running binaries compared to all other build targets.


OpenEmu Plug-in

These build targets produce a plug-in bundle that is compatible with the OpenEmu application (http://openemu.org/). These build targets exist to prove that our DeSmuME source code is modular enough to be adapted easily into other applications. In this case, the plug-in contains the DeSmuME emulator backend, while OpenEmu acts as the frontend that runs the emulator.

Build Target Goals:

  • Compatibility with OpenEmu.
  • Proving good code modularity in the source.

Advantages:

  • Compatible with OpenEmu.
  • Built plug-ins are much smaller in size than full application builds.

Disadvantages:

  • Must be built on a machine running OS X v10.7 or later.
  • Binaries only run on machines with 64-bit Intel processors running OS X v10.7 or later.
  • The frontend is handled by a third-party application, which will not expose all of DeSmuME's features to the user.

Set Up the Build Environment

All DeSmuME build targets must be built using Apple's Xcode IDE. The Xcode project files, included in the desmume/src/cocoa directory of the source code, are supported for the following versions of Xcode:

Project File Name Supported Xcode Version
DeSmuME (Xcode 3).xcodeproj v3.1.4 (if running on Leopard); v3.2.6 (if running on Snow Leopard or later)
DeSmuME (Xcode 4).xcodeproj v4.3 or later
DeSmuME (Legacy).xcodeproj v3.1.4 (if running on Leopard); v3.2.6 (if running on Snow Leopard or later)

Xcode Setup

Refer to the following conditions to determine which Xcode version you need to install.


You must use Xcode 3 if any of the following conditions apply:

  • You are running OS X v10.5 or v10.6.
  • You are building a Legacy OS X App (can be configured to run on OS X v10.4).
  • You are building an OS X App that runs on OS X v10.5.
  • You are building an OS X App that runs on PowerPC processors.
  • You are building an OS X App for final release.


You must use Xcode 4 if any of the following conditions apply:

  • You are running OS X v10.7 or later.
  • You are building an OpenEmu Plug-in.
  • You are building an OS X App for final release.


Download Xcode 3

You can download Xcode 3 from the Apple Developer Connection website. Note that before you can download anything from the ADC website, you must log in using an Apple Developer ID. Once you are logged in, you may use the provided download links to download Xcode 3.


If you do not have an Apple Developer ID, you can register one for free.

If you are not already logged in to ADC, you can log in by accessing the ADC Downloads page.

Once you are logged in to ADC, you can use the following download links for Xcode 3.


Download Xcode 4

Downloading Xcode 4 is very easy! If you are running Lion or later and have any Apple ID, then you can download Xcode 4 directly from the Mac App Store.

Uninstall Previous Versions of Xcode

We highly recommend that you uninstall any previous versions of Xcode before you begin your installation. Doing so will better guarantee that you will have a clean build environment for DeSmuME. The easiest method for uninstalling Xcode is to use the uninstall-devtools script, located in the Library folder of your Xcode installation.

Note: You do not need to uninstall any versions of Xcode that are v4.3 or later. These versions of Xcode are self-contained application packages, which do not conflict with other Xcode versions.

To uninstall Xcode, open Terminal and type the following command into the command line:

sudo /Developer/Library/uninstall-devtools -mode=all

Note: You must be logged into an Administrator account to use this command.

Note: This command assumes that Xcode was installed at the default location, /Developer. The path to the uninstall-devtools script may be different if you did not use the default location when installing Xcode from before.


Set Up Xcode 3

Note: If you do not require the build options that Xcode 3 provides, then you may skip this step. See the Xcode Setup section for more details.

After Xcode 3 is downloaded, you will have a .dmg disk image containing a package installer. Start the Xcode 3 installation by opening the installer, and follow the onscreen instructions until you get to the installation list.

Once the installation list is shown, do the following:

  • If you are planning on making legacy builds, select the Mac OS X 10.4 SDK.
  • If you are planning on installing Xcode 4, then deselect the iOS SDK, which is listed under Essentials. Since Xcode 4 already has a newer version of the iOS SDK, installing the version included with Xcode 3 will be a waste of time and disk space.

Continue the installation as normal and let the installation finish.


Set Up Xcode 4

Note: When you download Xcode from the Mac App Store, Xcode should automatically install itself to the Applications folder once the download is complete. There are no additional steps. Pretty easy, right?

Download the DeSmuME Source Code

The DeSmuME source code is managed using Subversion (SVN) and is hosted on SourceForge. In this section, we describe two of the most common methods for downloading the source code. (In reality, there are many methods for downloading the source code, but those methods are beyond the scope of this document.)

Download via SourceForge Web Interface

These instructions will download the DeSmuME source code from the SourceForge Web Interface using your web browser.

1. Follow this link to DeSmuME's SourceForge Web Interface: http://desmume.svn.sourceforge.net/viewvc/desmume/

2. Click "Download GNU tarball" to start the download.

Download via Command Line

These instructions will download the DeSmuME source code to your desktop.

1. Open Terminal.app.

2. In the command prompt, enter the following exactly as shown:

svn co https://desmume.svn.sourceforge.net/svnroot/desmume ~/Desktop/desmume

Note: If you want to change the destination directory to a directory other than your desktop, change the "~/Desktop/desmume" part to the directory of your choice.

3. At this point, the download should start. However, if instead there is a message about an untrusted certificate, enter the following exactly as shown:

p

Download via Xcode 4 Organizer

These instructions are for Xcode 4 users that wish to use the Organizer for downloading the DeSmuME source code.

1. Open Xcode.app.

2. Choose Window > Organizer.

3. In the Organizer window, click Repositories.

4. In the bottom-left corner, click the + button, then choose Checkout or Clone Repository.

5. In the Location field, enter the following exactly as shown:

https://desmume.svn.sourceforge.net/svnroot/desmume

6. After Xcode confirms that the host is reachable, click Checkout.

7. In the file navigation sheet, choose a folder to save the source code to, then click Checkout.

Build the DeSmuME Source

Regardless of which build target you will be using, you will need to use one of the Xcode project files provided with the DeSmuME source code. For most cases, you will want to build the latest revision. So from the source code folder, navigate to the "/trunk/desmume/src/cocoa" folder.

There should be three Xcode project files present in this folder:

  • DeSmuME (Legacy).xcodeproj
  • DeSmuME (XCode 3).xcodeproj
  • DeSmuME (XCode 4).xcodeproj


OS X App Build

This is the quickest and easiest way to get started with using a pre-release build of DeSmuME.

Building Using Xcode 3

1. Open the "DeSmuME (XCode 3).xcodeproj" project file using Xcode 3.

2. In the Build Target menu (located in the upper-left corner of the project window), under Active Configuration, choose Release.

3. In the Build Target menu, under Active Target, choose one of the four build targets.

Note: If you have previously made the OS X App Legacy build, you MUST perform a project clean prior to building the standard OS X App build. To do this, perform steps 3.5 and 3.6.

3.5. Choose Build > Clean All Targets.

3.6. If the Clean All Target sheet drops down, check all options, then click Clean.

4. Choose Build > Build, and then wait for Xcode to finish building the app.

And you're done! The newly built app will be present in the "/trunk/desmume/src/cocoa/build/Release" folder.

Building Using Xcode 4

1. Open the "DeSmuME (XCode 4).xcodeproj" project file.

2. Choose Product > Scheme > DeSmuME (OS X App).

3. Click Run. This will build a Debug version of the app, which will automatically launch when finished.

4. After the app launches, go back to Xcode.

5. In Xcode, choose Product > Build For > Archiving.

6. Right-click the DeSmuME (Debug) app in the dock, and then choose Options > Show in Finder.

7. In the Finder window that appears, you should be in a folder named "Debug". Right-click the window title (which should read "Debug"), and then choose the "Products" folder underneath it.

8. Wait for Xcode to finish building the app.

9. In the Finder, from the "Products" folder, open the "Release" folder.

And you're done! The newly built app will be present in the "Release" folder. You may quit the DeSmuME (Debug).app if you want.

Note: You may want to create an alias to this folder so that it is easier to access in the future.


OS X App Build for Final Release

This is the process that we use for our official release builds. To make this build, you must meet the following requirements:

  • You must have both Xcode 3.2.6 (this specific version) and the latest version of Xcode 4 installed.
  • You must be running the latest version of OS X. At the time of this writing, the latest version is v10.8 Mountain Lion.


1. Open the "DeSmuME (XCode 3).xcodeproj" project file using Xcode 3.

2. In the Build Target menu (located in the upper-left corner of the project window), under Active Configuration, choose Release.

3. In the Build Target menu, under Active Target, choose the build target "DeSmuME (OS X App; PowerPC; LLVM-Clang)".

Note: If you have previously made the OS X App Legacy build, you MUST perform a project clean prior to building the standard OS X App build. To do this, perform steps 3.5 and 3.6.

3.5. Choose Build > Clean All Targets.

3.6. If the Clean All Target sheet drops down, check all options, then click Clean.

4. Choose Build > Build. This will make a new app called "DeSmuME (PPC).app" in the "/trunk/desmume/src/cocoa/build/Release" folder.

5. Open the "DeSmuME (XCode 4).xcodeproj" project file.

6. Choose Product > Scheme > DeSmuME (OS X App; v10.5 Leopard Release Build).

7. Choose Product > Build For > Archiving, and then wait for Xcode to finish building the app.

And you're done! The newly built app will be present in the "/trunk/desmume/src/cocoa/build/Merged Release" folder.

OS X App Legacy Build

1. Open the "DeSmuME (Legacy).xcodeproj" project file using Xcode 3.

2. In the Build Target menu (located in the upper-left corner of the project window), under Active Configuration, choose Release.

3. In the Build Target menu, under Active Target, choose one of the four build targets.

Note: If you have previously made the standard OS X App build using Xcode 3, you MUST perform a project clean prior to building the OS X App Legacy build. To do this, perform steps 3.5 and 3.6.

Note: You do NOT have to perform a project clean if you made the standard OS X App build using Xcode 4.

3.5. Choose Build > Clean All Targets.

3.6. If the Clean All Target sheet drops down, check all options, then click Clean.

4. Choose Build > Build, and then wait for Xcode to finish building the app.

And you're done! The newly built app will be present in the "/trunk/desmume/src/cocoa/build/Release" folder.


OpenEmu Plug-in Build

TBD

Appendix A: Comparison Charts of Different Builds

Build Compatibility

The table below lists a summary of both binary and operating system compatibility for all possible builds.

OS X App OS X App (Final Release) OS X App (Legacy) OpenEmu Plug-in (Xcode 4)
PowerPC, 32-bit Yes[1] Yes Yes[1] No
PowerPC, 64-bit Yes[1] Yes Yes[1] No
Intel, 32-bit Yes Yes Yes[1] No
Intel, 64-bit Yes Yes Yes[1] Yes
OS X v10.4 (Tiger) No No Yes[1] No
OS X v10.5 (Leopard) Yes Yes Yes[1] No
OS X v10.6 (Snow Leopard) Yes Yes Yes No
OS X v10.7 (Lion) Yes Yes Yes Yes
OS X v10.8 (Mountain Lion) Yes Yes Yes Yes

1. Available only by configuration in Xcode 3.

Personal tools