]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/mac/install.txt
documented __WXFUNCTION__
[wxWidgets.git] / docs / mac / install.txt
... / ...
CommitLineData
1wxWidgets 2.7.0 for Mac installation
2------------------------------------
3
4On MacOS X, you can download Apple's free developer tools (gcc
5and associated headers and libraries, such as the Carbon API).
6You can then use configure in a similar way to compiling
7wxWidgets on Linux (or on Windows using MinGW or Cygwin). See
8'Apple Developer Tools' below for more details on using
9configure.
10
11To target on MacOS 8 or 9, you need to buy Metrowerks
12CodeWarrior. You can then compile Mac Classic or MacOS X
13applications on Mac OS X, or compile Mac Classic or MacOS X
14applications on Mac Classic. However you can only run and debug
15each type of application on the target operating system.
16
17
18Apple Developer Tools: command line
19-----------------------------------
20
21As in all Unix projects, you need to do something like this under MacOS X
22with the Apple Developer Tools installed:
23
241) cd into the base dir
252) mkdir osx-build
263) cd osx-build
274) ../configure
285) make
29
30If you want to install the library into the system directories you'll need
31to do this as root. The accepted way of running commands as root is to
32use the built-in sudo mechanism. First of all, you must be using an
33account marked as a "Computer Administrator". Then
34
356) sudo make install
367) type <YOUR OWN PASSWORD>
37
38Note that while using this method is okay for development, it is not
39recommended that you require endusers to install wxWidgets into their
40system directories in order to use your program. One way to avoid this
41is to configure wxWidgets with --disable-shared. Another way to avoid
42it is to make a framework for wxWidgets. Making frameworks is beyond
43the scope of this document.
44
45Note:
46We recommend you configure a static library instead:
47
484) ../configure --disable-shared
49
50or activate OpenGL:
51
524) ../configure --with-opengl
53
54Note:
55It is rarely desirable to install non-Apple software into system directories.
56By configuring the library with --disable-shared and using the full path
57to wx-config with the --in-place option you can avoid installing the library.
58
59
60Apple Developer Tools: XCode
61----------------------------
62
63You can use the project in src/wxWindows.xcodeproj to build wxWidgets,
64and there is a sample project supplied with the minimal sample.
65
66Creating universal binaries
67---------------------------
68
69The Xcode projects for the wxWidgets library and minimal project are set up
70to create universal binaries.
71
72If using the Apple command line tools, pass --enable-universal_binary when
73configuring wxWidgets. If you use wx-config --libs to link your application,
74he necessary linker flags will be added. When compiling your own files,
75you need to add -arch ppc -arch i386 to your CFLAGS.
76
77As an alternative to using --enable-universal_binary, you can build for
78each architecture separately and then use the lipo tool to glue the
79binaries together. Assuming building on a PPC system:
80
811. First build in the usual way to get the PPC library.
82
832. Then, build for Intel, in a different folder. This time use:
84
85export CFLAGS="-g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386"
86export LDFLAGS="-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
87
88./configure --disable-dependency-tracking --enable-static=yes --enable-shared=no \
89 --target=i386-apple-darwin8 --host=powerpc-apple-darwin8 --build=i386-apple-darwin8
90
91You will need to reverse the powerpc and i386 parameters everywhere to build PPC on an Intel
92machine.
93
943. Use lipo to glue the binaries together.
95
96See also:
97http://developer.apple.com/technotes/tn2005/tn2137.html
98
99
100Building with CodeWarrior
101-------------------------
102
103(Note that using the Apple tools is recommended.)
104
105Installing latest headers (and Carbon Support)
106----------------------------------------------
107
108Patching headers: CodeWarrior 8.x
109---------------------------------
110
111If you run into trouble with WCHAR_MIN and WCHAR_MAX the for
112MacOS X Support:Headers:(wchar_t Support fix):machine:ansi.h,
113apply the patch ansi.diff.
114
115You may also need to comment out the _T definition in
116ctype.h if you get multiple definition errors.
117
118setup.h
119-------
120
121in order to build wxMac with CodeWarrior, you must copy or alias the file
122include/wx/mac/setup0.h to include/wx/setup.h.
123
124this step is not needed when using the Apple Developer Tools under Mac OS X
125since the setup.h file is automatically generated during the configuration.
126
127OpenGL
128------
129
130In order to build opengl support with CodeWarrior, you must install the opengl
131libraries and headers from http://developer.apple.com/opengl/index.html
132
133If you want OpenGL support with CodeWarrior, set wxUSE_OPENGL to 1 in
134include/wx/setup.h
135
136If you don't want OpenGl support, set wxUSE_OPENGL to 0 (the
137default) and remove the file OpenGLLibraryStub from the project
138before compilation.
139
140If you want OpenGL support with the Apple Developer Tools under Mac OS X, add
141--with-opengl to the arguments of configure when configuring wxMac.
142
143Project Files
144-------------
145
146The project files are stored as xml text files and converted to binary
147CodeWarrior projects in the distribution (see AppleScript Files below):
148
149 - *M8.xml -> *M8.mcp for CodeWarrior 8 and above.
150
151AppleScript Files
152-----------------
153
154Several AppleScript files are provided in the docs:mac directory:
155
156 - M8xml2mcp.applescript to convert xml files to CodeWarrior 8 projects
157 - M8mcp2xml.applescript to convert CodeWarrior 8 projects to xml files
158 - SetXMLCreator.applescript to set correct creator type (see below)
159
160To run the XML to MCP conversion scripts:
161
162Double click on e.g. docs/mac/M8xml2mcp.applescript, then "run"
163the applescript and when asked for a folder pick src/. Then it
164takes a while to scan all dirs for the xml files and convert
165them to mcps. If some conversions fail it means an mcp already
166exists (back them up prior to running the script).
167
168To set the correct creator type for importing into CodeWarrior,
169you may need to run SetXMLCreator.applescript.
170
171Problems with .xpm files
172------------------------
173
174if you have downloaded all the files and get errors like :
175
176Error : the file 'wx/generic/tip.xpm' cannot be opened
177tipdlg.cpp line 201 #include "wx/generic/tip.xpm"
178
179then your cvs has changed the type of the .xpm files to something other than
180text, in order to fix this either change the type by using a resource editor
181or drag the files from /include/wx/generic/..xpm on the SetTypeFromExtension
182application that is included in this folder. This small applet itself queries
183the Internet Config, so you will have to associate the "xpm" extension with
184CodeWarrior before making use of this applet.
185
186Missing PLStringFuncsLib
187------------------------
188
189You will have to build All Targets for MacOS Support:Libraries:Sources:PLStringFuncs:Glue:PLStringFuncsGlue.mcp
190
191