Difference between revisions of "Mac OS X"

From FM Plugin Wikipedia
Jump to: navigation, search
(Step One : Uninstall existing)
(Prelude)
 
(60 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
  
==OS X Lion==
+
==Prelude==
 
Mac OS X Lion no longer supports legacy PowerPC applications via Rosetta.  In addition, Xcode 4 no longer uses the GCC compiler. At this time, the FileMaker Plugin API requires us to use the GCC 4.0 compiler.
 
Mac OS X Lion no longer supports legacy PowerPC applications via Rosetta.  In addition, Xcode 4 no longer uses the GCC compiler. At this time, the FileMaker Plugin API requires us to use the GCC 4.0 compiler.
  
===XCode 4===
+
It's possible to continue to use Xcode 3.2 on OS X Lion,  however you will need to install via the command line  (see step two below).
 +
 
 +
Alternatively - you can restore GCC 4.0 and PPC support to Xcode 4 - which the following document will assist with.
 +
 
 +
 
 +
Note : This is a collection of steps from various other sites and developers.  I have completed these steps and am now able to compile plugins for FileMaker using Xcode 4.  Please make a backup before attempting !
 +
 
 +
All care taken - no responsibility !
 +
 
 +
 
 +
----
 +
 
 +
===Installing XCode 4 with support for GCC4.0===
 
The following link explains how to install Xcode 4 with the GCC 4.0 compiler, which is necessary to compile FileMaker Plugins.
 
The following link explains how to install Xcode 4 with the GCC 4.0 compiler, which is necessary to compile FileMaker Plugins.
  
Line 16: Line 28:
 
  sudo <Xcode>/Library/uninstall-devtools --mode=all
 
  sudo <Xcode>/Library/uninstall-devtools --mode=all
  
[[Image:UnistallXcode.jpg]]
+
<div style="text-align: center;"> [[Image:UnistallXcode.jpg]] </div>
:
+
 
:
+
<div style="text-align: center;"> [[Image:PromptToRestart.jpg]] </div>
[[Image:PromptToRestart.jpg]]
+
 
 +
Note : It may be necessary to restart your computer after installing Xcode 3 if you have just uninstalled Xcode 4
 +
 
  
Note : It may be necessary to restart your computer after this step before proceeding
+
 
 +
----
  
 
====Step Two : Install Xcode 3====
 
====Step Two : Install Xcode 3====
Line 27: Line 42:
 
Create a folder 'Xcode3' at the top level of your boot drive.  This is where we will install Xcode 3 to  (and not the default /Developer location)
 
Create a folder 'Xcode3' at the top level of your boot drive.  This is where we will install Xcode 3 to  (and not the default /Developer location)
  
Now, install Xcode 3 using the following steps :
+
To install Xcode 3, mount the Xcode 3.2.x DMG and then enter the following into 'Terminal' :
  
Mount the Xcode 3.2.x DMG
+
  export COMMAND_LINE_INSTALL=1
Open Terminal
+
  open “/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg”
Enter the command: export COMMAND_LINE_INSTALL=1
+
<div style="text-align: center;"> [[Image:InstallXcode3Lion.jpg]] </div>
Enter the command: open “/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg”
 
[[Image:InstallXcode3Lion.jpg]]
 
  
[http://anatomicwax.tumblr.com/post/8064949186/installing-xcode-3-2-6-on-lion-redux Install Xcode 4 on OS X Lion]
+
<div style="text-align: center;"> [http://anatomicwax.tumblr.com/post/8064949186/installing-xcode-3-2-6-on-lion-redux Install Xcode 3 on OS X Lion] </div>
  
Important:
 
*Do not install "System Tools" or "Unix Development" package of Xcode3.
 
*We need to install "Mac OS X 10.4 SDK"
 
*If that is a Xcode3 with iOS SDKs, whether you install those or not is also up to you.
 
  
Make sure you select to install into the "Xcode3" folder you created above.
+
On the 'Installation Type' screen :
 +
*Change the Location to be the 'Xcode3' folder you created above
 +
*Do not install "System Tools" or "Unix Development"
 +
*Select to install "Mac OS X 10.4 SDK"
 +
 
 +
<div style="text-align: center;"> [[Image:InstallXcode3Settings.jpg]] </div>
 +
 
 +
Note : Installing the Documentation  and/or  iOS SDK is optional  -  install if wanted.
 +
 
 +
 
 +
 
 +
----
  
 
====Step Three : Install Xcode 4====
 
====Step Three : Install Xcode 4====
  
Install 'Xcode 4' as normal. You
+
Mount the Xcode 4 DMG and Install as normal.
[http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4 10.4 sdk support to XCode]
+
 
 +
<div style="text-align: center;"> [[Image:InstallXcode4Lion.jpg]] </div>
 +
 
 +
On the 'Installation Type' screen, you should be able to use the default settings.
 +
 
 +
<div style="text-align: center;"> [[Image:InstallXcode4Settings.jpg]] </div>
 +
 
 +
<div style="text-align: center;"> [http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4 10.4 sdk support to XCode] </div>
 +
 
 +
 
 +
 
 +
----
 +
 
 +
====Step Four : Add GCC4.0 to Xcode 4====
 +
 
 +
Download and run the  '[http://fmplugins.idma.co.nz/downloads/Legacy-XCode-Scripts.zip restore-with-xcode3.sh]' script, which will add symbolic links within Xcode 4,  pointing to Xcode 3.
 +
 
 +
<div style="text-align: center;"> [https://github.com/thinkyhead/Legacy-XCode-Scripts Legacy-XCode-Scripts] </div>
 +
 
 +
 
 +
Execute the code
 +
 
 +
  ./restore-with-xcode3.sh
 +
 
 +
<div style="text-align: center;"> [[Image:Restorelecacyxcode.jpg]] </div>
 +
 
 +
We are now ready to open and use Xcode 4
 +
 
 +
----
 +
 
 +
===Opening Project in Xcode 4===
 +
 
 +
Open your project in Xcode 4.
 +
 
 +
 
 +
 
 +
====Step One : Modernise Project====
 +
 
 +
Select your project (on the left) and then click the 'Modernize Project' button at the bottom.
 +
 
 +
Untick any 'Build Setting' options.
 +
 
 +
<div style="text-align: center;"> [[Image:XcodeModernizeProject.jpg]] </div>
 +
 
 +
 
 +
====Step Two : Restore PPC & i386 support to project====
 +
 
 +
Select 'Build Settings' for your project, and reset any copiler settings.  You'll need to change to 'All'  in order to see all options to change.
 +
 
 +
*Architectures : ppc i386
 +
*Valid Architectures : ppc i386 x86_64
 +
*Build Options : GCC 4.0
 +
 
 +
Before :
 +
<div style="text-align: center;"> [[Image:XcodeSetPPCi386.jpg]] </div>
 +
 
 +
After :
 +
<div style="text-align: center;"> [[Image:XcodeRestoredPPCi386.jpg]] </div>
 +
 
 +
<div style="text-align: center;"> [[Image:XcodeSetCompiler.jpg]] </div>
 +
 
 +
 
 +
At this point,  when should be able to 'Build' our plugin
 +
 
 +
<div style="text-align: center;"> [[Image:XcodeBuildSucceeded.jpg]] </div>
 +
 
 +
 
 +
 
 +
----
 +
 
 +
====Step Three : Restore Build Locations====
 +
 
 +
Select XCode Preferences.  Then 'Locations'
 +
 
 +
Click the 'Advanced' button.
 +
 
 +
Change the 'Build Location' popup to 'Locations Specified by Targets'
 +
 
 +
 
 +
<div style="text-align: center;"> [[Image:XcodeBuildLocations.jpg]] </div>
 +
 
 +
 
 +
 
 +
For example, I have set my build location to be directly where FileMaker looks for plugins
 +
 
 +
<div style="text-align: center;"> [[Image:XcodeBuildLocationsPath.jpg]] </div>
 +
 
 +
 
 +
 
 +
 
 +
----
 +
 
 +
====Step Four : Debug v's Release Builds====
 +
 
 +
Select 'Manage Schemes' from the popup menu right of the stop button (top-left)
 +
 
 +
<div style="text-align: center;"> [[Image:XcodeSelectManageSchemes.jpg]] </div>
 +
 
 +
 
 +
 
 +
Select the first (should be only) scheme and 'Duplicate'.
 +
 
 +
Rename one scheme as 'Plugin Name (Debug)' and the other as 'Plugin Name (Release)'
 +
 
 +
<div style="text-align: center;"> [[Image:XcodeDuplicateScheme.jpg]] </div>
 +
 
 +
 
 +
 
 +
Edit the 'Release' scheme - change the 'Run : Build Configuration' from 'Debug' to 'Release'
 +
 
 +
<div style="text-align: center;"> [[Image:XcodeSetRunToRelease.jpg]] </div>
 +
 
 +
 
 +
You can now easily switch between 'Debug' and 'Release' builds using the Scheme Menu.
 +
 
 +
<div style="text-align: center;"> [[Image:XcodeSwitchDebugRelease.jpg]] </div>
 +
 
 +
 
 +
 
 +
In my case, because I am building directly to the FileMaker Extensions - I have also set Xcode to launch FileMaker once built  (when using the Run : Cmd + R option).  This means FileMaker is automatically launched once the plugin is built.
 +
 
 +
 
 +
 
 +
 
 +
----
 +
 
 +
==Acknowledgements==
 +
Thanks to Mark Banks who gave me the initial links, and Jake Traynham [http://www.cnsplug-ins.com/ CNS Plug-ins]  for his efforts to work out the steps to make everything work.

Latest revision as of 03:53, 21 August 2011


Prelude

Mac OS X Lion no longer supports legacy PowerPC applications via Rosetta. In addition, Xcode 4 no longer uses the GCC compiler. At this time, the FileMaker Plugin API requires us to use the GCC 4.0 compiler.

It's possible to continue to use Xcode 3.2 on OS X Lion, however you will need to install via the command line (see step two below).

Alternatively - you can restore GCC 4.0 and PPC support to Xcode 4 - which the following document will assist with.


Note : This is a collection of steps from various other sites and developers. I have completed these steps and am now able to compile plugins for FileMaker using Xcode 4. Please make a backup before attempting !

All care taken - no responsibility !



Installing XCode 4 with support for GCC4.0

The following link explains how to install Xcode 4 with the GCC 4.0 compiler, which is necessary to compile FileMaker Plugins.


Step One : Uninstall existing

If you already have Xcode installed, then uninstall it.

sudo <Xcode>/Library/uninstall-devtools --mode=all
UnistallXcode.jpg
PromptToRestart.jpg

Note : It may be necessary to restart your computer after installing Xcode 3 if you have just uninstalled Xcode 4



Step Two : Install Xcode 3

Create a folder 'Xcode3' at the top level of your boot drive. This is where we will install Xcode 3 to (and not the default /Developer location)

To install Xcode 3, mount the Xcode 3.2.x DMG and then enter the following into 'Terminal' :

 export COMMAND_LINE_INSTALL=1
 open “/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg”
InstallXcode3Lion.jpg


On the 'Installation Type' screen :

  • Change the Location to be the 'Xcode3' folder you created above
  • Do not install "System Tools" or "Unix Development"
  • Select to install "Mac OS X 10.4 SDK"
InstallXcode3Settings.jpg

Note : Installing the Documentation and/or iOS SDK is optional - install if wanted.



Step Three : Install Xcode 4

Mount the Xcode 4 DMG and Install as normal.

InstallXcode4Lion.jpg

On the 'Installation Type' screen, you should be able to use the default settings.

InstallXcode4Settings.jpg



Step Four : Add GCC4.0 to Xcode 4

Download and run the 'restore-with-xcode3.sh' script, which will add symbolic links within Xcode 4, pointing to Xcode 3.


Execute the code

 ./restore-with-xcode3.sh
Restorelecacyxcode.jpg

We are now ready to open and use Xcode 4


Opening Project in Xcode 4

Open your project in Xcode 4.


Step One : Modernise Project

Select your project (on the left) and then click the 'Modernize Project' button at the bottom.

Untick any 'Build Setting' options.

XcodeModernizeProject.jpg


Step Two : Restore PPC & i386 support to project

Select 'Build Settings' for your project, and reset any copiler settings. You'll need to change to 'All' in order to see all options to change.

  • Architectures : ppc i386
  • Valid Architectures : ppc i386 x86_64
  • Build Options : GCC 4.0

Before :

XcodeSetPPCi386.jpg

After :

XcodeRestoredPPCi386.jpg
XcodeSetCompiler.jpg


At this point, when should be able to 'Build' our plugin

XcodeBuildSucceeded.jpg



Step Three : Restore Build Locations

Select XCode Preferences. Then 'Locations'

Click the 'Advanced' button.

Change the 'Build Location' popup to 'Locations Specified by Targets'


XcodeBuildLocations.jpg


For example, I have set my build location to be directly where FileMaker looks for plugins

XcodeBuildLocationsPath.jpg




Step Four : Debug v's Release Builds

Select 'Manage Schemes' from the popup menu right of the stop button (top-left)

XcodeSelectManageSchemes.jpg


Select the first (should be only) scheme and 'Duplicate'.

Rename one scheme as 'Plugin Name (Debug)' and the other as 'Plugin Name (Release)'

XcodeDuplicateScheme.jpg


Edit the 'Release' scheme - change the 'Run : Build Configuration' from 'Debug' to 'Release'

XcodeSetRunToRelease.jpg


You can now easily switch between 'Debug' and 'Release' builds using the Scheme Menu.

XcodeSwitchDebugRelease.jpg


In my case, because I am building directly to the FileMaker Extensions - I have also set Xcode to launch FileMaker once built (when using the Run : Cmd + R option). This means FileMaker is automatically launched once the plugin is built.




Acknowledgements

Thanks to Mark Banks who gave me the initial links, and Jake Traynham CNS Plug-ins for his efforts to work out the steps to make everything work.