How to Install the OS X Psychtoolbox Source on OS X
OS X Psychtoolbox version 1.0.6
October 26 2005

Requirements

	XCode version 2.1 or better.
	MATLAB 7.0.4.352 (R14) Service Pack 2
	OS X Version 10.4 or better
	Psychtoolbox Source
	Apple HID Utilities library (to build PsychHID)

The following sections still need to be updated  for PTB 1.0.6

to be changed: 
-give instructions for configuring for SVN
-the path settings have changed to separate the MATLAB directory name out from the rest of its path
-give an overview
- include SVN info links:
	-subversion howto at berliOS: https://developer.berlios.de/docman/display_doc.php?docid=394&group_id=2
	-subversion addresses at berliOS: https://developer.berlios.de/svn/?group_id=5064
	- apple subversion howto: http://developer.apple.com/tools/subversionxcode.html
	- macdevcenter tutorial: http://www.macdevcenter.com/pub/a/mac/2004/08/10/subversion.html?page=1
	- root for ptb http://svn.berlios.de/svnroot/repos/osxptb/
	- subversion book: http://svnbook.red-bean.com/
	- subversion gui wrapper: http://www.lachoseinteractive.net/en/community/subversion/svnx/download/
	- Xcode 2.2 uses guide:
	http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/index.html?http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/04_scm/chapter_24_section_1.html#//apple_ref/doc/uid/TP40002684-BABCCJCJ

Background

The OS X Psychtoolbox XCode targets which build mex files link against libraries and also compile in header files and a version.c file which are part of the MATLAB package.  Therefore, the XCode project needs to know the path to the MATLAB directory in order to locate these resources.  In previous versions of the Psychtoolbox source, we had allowed MATLAB to be located anywhere in the filesystem and we specified to XCode the location of MATLAB using an environment variable.  This required configuring your computer to set that environment variable on startup.  With Psychtoolbox version 1.0.2 the way which Xcode finds MATLAB has changed.  Instead of allowing MATLAB to be located anywhere, the Psychtoolbox XCode project now assumes that the path to MATLAB is "$(SYSTEM_APPS_DIR)/MATLAB701"   The variable SYSTEM_APPS_DIR is defined for you by XCode and defaults to "/Applications", the the Psychtoolbox project expects to find MATLAB in "/Applications/MATLAB".  (See the XCode 1.5 Release Notes on builds settings for variables defined for you in the build environment by Xcode: http://developer.apple.com/releasenotes/DeveloperTools/Xcode/XcodeBuildSettings.html).

The new method of locating MATLAB, which is to assume the conventional path, has the advantage that it makes installing the Psychtoolbox source easier; You don't need to configure your computer to set an environment variable.  It has the disadvantage that if you install MATLAB in a non-standard location, there is more work for you: you have to change every occurrence of  the MATLAB path in each setting.

Instructions

1. Launch MATLAB and remove all MATLAB path settings to the Psychtoolbox.  Add paths to the directory itself and all subdirectories of  Psychtoolbox3/Target/OSX/Psychtoolbox in the Psychtoolbox  source.

2.
	A. If your MATLAB folder is "/Applications/MATLAB701" then you are done.
	B. If your MATLAB path is /Applications/SomethingElse where SomethingElse names a version of MATLAB better than MATLAB701, then either this file is out of date or the project itself is out of date. Please send mail to the Psychtoolbox forum and we will correct it. 
	C. If your MATLAB path is /Applications/SomethingElse where SomethingElse names a version of MATLAB less than MATLAB701, then we recommend that you upgrade to the latest version of MATLAB.
	D. If your MATLAB path is /SomethingElse/MATLAB701 where SomethingElse is not "Applications" then continue from step 3 on.

3. For each target listed in the XCode Groups & Files pane under the group Targets, get info the on the target.  Under the Build tab
change the following build settings to agree with the path into your MATLAB directory:
	A. Header Search Paths
	B. Library Search Paths
	C. Exported Symbols File

4. Get info on the files mex.h, matrix.h and mexversion.c listed in the XCode Groups & Files pane under the Psychtoolbox/MATLAB Resources/headers and Psychtoolbox/MATLAB Resources/headers.  Modify the paths to to agree with the path into your MATLAB directory.

5.  Get info on MATLAB listed  in the XCode Groups & Files pane under the Executables.  In the arguments tab of the info window modify all variable values specifying paths into the MATLAB directory to agree with your own path into your MATLAB directory.