Difference between revisions of "Development:Building:Mac OS X 10.7"

From Camino Wiki
Jump to navigation Jump to search
(style tweaks)
Line 1: Line 1:
Building on Mac OS X 10.7 is unfortunately complicated. Gecko 1.9.2 is not Xcode 4 / 10.7-build-friendly. This page contains a full list of supplemental instructions to help you complete a Cm2.1-M1.9.2 build on Mac OS X 10.7 with Xcode 4 (please be sure you follow all of the other instructions on [[Development:Building:Mozilla 1.9.2 Branch]] and [[Development:Building:Mac OS X 10.6]]). Please let us know of any additional issues in {{bug|717513}}
+
Building on Mac OS X 10.7 is unfortunately complicated. Gecko 1.9.2 is not Xcode 4 / 10.7-build-friendly. This page contains a full list of supplemental instructions to help you complete a Cm2.1-M1.9.2 build on Mac OS X 10.7 with Xcode 4 (please be sure you follow all of the other instructions on [[Development:Building:Mozilla 1.9.2 Branch]] and [[Development:Building:Mac OS X 10.6]]). Please let us know of any additional issues by commenting in {{bug|717513}}.
  
 
==Preparing the build environment: installing Xcode 3 alongside Xcode 4==
 
==Preparing the build environment: installing Xcode 3 alongside Xcode 4==
Xcode 4 (available for free through the Mac App Store) does not include the necessary tools for building Camino: the 10.4 sdk and the GCC 4.0 compiler. Those need to be fetched from Xcode 3. The necessary steps have originally been documented in this post on [http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4 Stack Overflow] and reposted on [http://hints.macworld.com/article.php?story=20110318050811544 MacOS X hints] (note that those steps were written before Lion and Xcode 4.2 had been released; Xcode 4.2.1 changed a few things). Below are updated instructions
+
Xcode 4 (available for free through the Mac App Store) does not include the necessary tools for building Camino: the 10.4 SDK and the GCC 4.0 compiler. Those need to be fetched from Xcode 3. The necessary steps for obtaining these tools were originally documented in this post on [http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4 Stack Overflow] and reposted on [http://hints.macworld.com/article.php?story=20110318050811544 Mac OS X Hints] (note that those steps were written before Lion and Xcode 4.2 had been released; Xcode 4.2.1 changed a few things). Below are updated instructions.
  
Before installing Xcode 3, it is recommended to uninstall Xcode 4 if it was installed. Any preferences, color scheme or key binding customizations will not be deleted.
+
Before installing Xcode 3, it is recommended that you uninstall Xcode 4 if it was installed. Any preferences, color scheme or key binding customizations will not be deleted.
  
 
===Installing Xcode 3===
 
===Installing Xcode 3===
 
Xcode 3 can be downloaded for free from [https://developer.apple.com/ Apple Developer site] ([https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_3.2.6_and_ios_sdk_4.3__final/xcode_3.2.6_and_ios_sdk_4.3.dmg direct download link]). But the installer does a version check and won't allow installation on Lion 10.7.2. The necessary Xcode Toolset component is disabled. If the COMMAND_LINE_INSTALL environment variable is set, the version check can be bypassed (source: [http://anatomicwax.tumblr.com/post/8064949186/installing-xcode-3-2-6-on-lion-redux anatomic wax]).
 
Xcode 3 can be downloaded for free from [https://developer.apple.com/ Apple Developer site] ([https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_3.2.6_and_ios_sdk_4.3__final/xcode_3.2.6_and_ios_sdk_4.3.dmg direct download link]). But the installer does a version check and won't allow installation on Lion 10.7.2. The necessary Xcode Toolset component is disabled. If the COMMAND_LINE_INSTALL environment variable is set, the version check can be bypassed (source: [http://anatomicwax.tumblr.com/post/8064949186/installing-xcode-3-2-6-on-lion-redux anatomic wax]).
  
<ol><li>Mount the Xcode 3.2.6 DMG</li>
+
<ol><li>Mount the Xcode 3.2.6 <code>.dmg</code></li>
 
<li>From a Terminal window:
 
<li>From a Terminal window:
 
<pre>$ export COMMAND_LINE_INSTALL=1
 
<pre>$ export COMMAND_LINE_INSTALL=1
 
$ open "/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg"</pre>
 
$ open "/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg"</pre>
The installer.app will open.</li>
+
'''Installer.app''' will open.</li>
 
<li>Create a destination folder before continuing with the installation process (e.g. <code>/Xcode 3</code>).</li>
 
<li>Create a destination folder before continuing with the installation process (e.g. <code>/Xcode 3</code>).</li>
<li>Proceed with the installation through the installer. As noted in the Stack Overflow exchange above, do not install the "System Tools" or "Unix Development" packages of Xcode 3. But make sure to install the 10.4u SDK (the option is unchecked by default).</li>
+
<li>Proceed with the installation through the installer. As noted in the Stack Overflow exchange above, do not install the “System Tools” or “Unix Development” packages of Xcode 3. But make sure to install the 10.4u SDK (the option is unchecked by default).</li>
 
</ol>
 
</ol>
  
 
===Install Xcode 4===
 
===Install Xcode 4===
The most recent version (4.2.1) doesn't allow any custom choices. By default it will install in /Developer.
+
The most recent version (4.2.1) doesn't allow any custom choices. By default it will install in <code>/Developer</code>.
  
 
===Restoring 10.4u SDK support===
 
===Restoring 10.4u SDK support===
Line 49: Line 49:
 
==Patches==
 
==Patches==
  
On Mac OS X 10.7 Lion, the configure process fails silently to generate a number of defines… and for some obscure reason the version detection for Xcode is not accurate.
+
*On Mac OS X 10.7 Lion, the configure process silently fails to generate a number of defines, and the version detection for Xcode was not updated to handle the new output format of Xcode 4.
* [https://bugzilla.mozilla.org/attachment.cgi?id=587947 Attachment 587947] on {{bug|717513}} works around these issues.
+
** [https://bugzilla.mozilla.org/attachment.cgi?id=587947 Attachment 587947] on {{bug|717513}} works around these issues.
Note that after applying this patch, you'll need to [https://developer.mozilla.org/en/configure.in regenerate] <code>configure</code>. If autoconf-2.13 was installed through Macports  the command is: <code>autoconf213</code> in your mozilla directory
+
**: Note that after applying this patch, you’ll need to [https://developer.mozilla.org/en/configure.in regenerate] <code>configure</code>. If '''autoconf-2.13''' was installed through MacPorts, the command is: <code>cd /path/to/mozilla; autoconf213</code>.
  
See also the patch(es) linked in [[Development:Building:Mac OS X 10.6]].
+
* <code>striptease</code> will not build on 10.7; as this tool is only necessary for release builds, the failure can be worked around by disabling <code>striptease</code>.
 +
** [https://bug717513.bugzilla.mozilla.org/attachment.cgi?id=588331 Attachment 588331] on {{bug|717513}} works around this issues.
 +
 
 +
* See also the patch(es) linked in [[Development:Building:Mac OS X 10.6]], which are still required for building on Mac OS X 10.7.
  
 
==Building in Xcode 4==
 
==Building in Xcode 4==
(untested so far) Afaict, the project file opens correctly and see the correct compiler and SDK.
+
Building in Xcode 4 (as opposed to the default command-line-driven build) is untested so far.  However, the project file does appear to open correctly and see the correct compiler and SDK.
  
==Building an Universal Build==
+
==Building a Universal Binary==
This is currently untested. In addition to the instruction above, you'll need the Xcode 3 'as' symlink mentioned on the Stack Overflow page.
+
This is also currently untested. However, in addition to the instructions above, you’ll need to create the Xcode 3 <code>as</code> symlink mentioned on the Stack Overflow page in order to generate PPC binaries.

Revision as of 15:25, 13 January 2012

Building on Mac OS X 10.7 is unfortunately complicated. Gecko 1.9.2 is not Xcode 4 / 10.7-build-friendly. This page contains a full list of supplemental instructions to help you complete a Cm2.1-M1.9.2 build on Mac OS X 10.7 with Xcode 4 (please be sure you follow all of the other instructions on Development:Building:Mozilla 1.9.2 Branch and Development:Building:Mac OS X 10.6). Please let us know of any additional issues by commenting in Bug 717513.

Preparing the build environment: installing Xcode 3 alongside Xcode 4

Xcode 4 (available for free through the Mac App Store) does not include the necessary tools for building Camino: the 10.4 SDK and the GCC 4.0 compiler. Those need to be fetched from Xcode 3. The necessary steps for obtaining these tools were originally documented in this post on Stack Overflow and reposted on Mac OS X Hints (note that those steps were written before Lion and Xcode 4.2 had been released; Xcode 4.2.1 changed a few things). Below are updated instructions.

Before installing Xcode 3, it is recommended that you uninstall Xcode 4 if it was installed. Any preferences, color scheme or key binding customizations will not be deleted.

Installing Xcode 3

Xcode 3 can be downloaded for free from Apple Developer site (direct download link). But the installer does a version check and won't allow installation on Lion 10.7.2. The necessary Xcode Toolset component is disabled. If the COMMAND_LINE_INSTALL environment variable is set, the version check can be bypassed (source: anatomic wax).

  1. Mount the Xcode 3.2.6 .dmg
  2. From a Terminal window:
    $ export COMMAND_LINE_INSTALL=1
    $ open "/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg"
    Installer.app will open.
  3. Create a destination folder before continuing with the installation process (e.g. /Xcode 3).
  4. Proceed with the installation through the installer. As noted in the Stack Overflow exchange above, do not install the “System Tools” or “Unix Development” packages of Xcode 3. But make sure to install the 10.4u SDK (the option is unchecked by default).

Install Xcode 4

The most recent version (4.2.1) doesn't allow any custom choices. By default it will install in /Developer.

Restoring 10.4u SDK support

$ cd /Developer/SDKs
$ sudo ln -s /Xcode3/SDKs/MacOSX10.4u.sdk .

Restoring GCC 4.0 support

$ cd /Developer/usr/bin
$ sudo ln -s /Xcode3/usr/bin/*4.0* .
$ cd /Developer/usr/libexec/
$ sudo ln -s /Xcode3/usr/libexec/gcc .

Let Xcode 4 see the GCC 4.0 compiler

$ cd /Developer/Library/Xcode/PrivatePlugIns
$ cd Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins
$ sudo ln -s "/Xcode3/Library/Xcode/Plug-ins/GCC 4.0.xcplugin" .

Command line build process

The process above needs to be repeated to install the GCC 4.0 compiler in a location that Gecko will understand without problems. By default, Gecko is looking in /usr.

$ cd /usr/bin; sudo ln -s /Xcode3/usr/bin/*4.0* .
$ cd /usr/libexec; sudo ln -s /Xcode3/usr/libexec/gcc .
$ cd /usr/lib; sudo ln -s /Xcode3/usr/lib/gcc .

Patches

  • On Mac OS X 10.7 Lion, the configure process silently fails to generate a number of defines, and the version detection for Xcode was not updated to handle the new output format of Xcode 4.
    • Attachment 587947 on Bug 717513 works around these issues.
      Note that after applying this patch, you’ll need to regenerate configure. If autoconf-2.13 was installed through MacPorts, the command is: cd /path/to/mozilla; autoconf213.
  • striptease will not build on 10.7; as this tool is only necessary for release builds, the failure can be worked around by disabling striptease.

Building in Xcode 4

Building in Xcode 4 (as opposed to the default command-line-driven build) is untested so far. However, the project file does appear to open correctly and see the correct compiler and SDK.

Building a Universal Binary

This is also currently untested. However, in addition to the instructions above, you’ll need to create the Xcode 3 as symlink mentioned on the Stack Overflow page in order to generate PPC binaries.