]> git.saurik.com Git - wxWidgets.git/blame - docs/osx/install.txt
fix doxygen warning about XHTML syntax
[wxWidgets.git] / docs / osx / install.txt
CommitLineData
d716e453
JS
1wxWidgets for Mac installation
2------------------------------
2b5f62a0
VZ
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
fc2171bd 7wxWidgets on Linux (or on Windows using MinGW or Cygwin). See
6b9a6d77 8'Apple Developer Tools' below for more details on using
2b5f62a0
VZ
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
0cd6a2f8
JS
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
a7d9f9fc 60Apple Developer Tools: Xcode
0cd6a2f8
JS
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
a7d9f9fc
VZ
66Notice that the command line build above builds not just the library itself but
67also wxrc tool which doesn't have its own Xcode project. If you need this tool,
68the simplest possibility is to build it from the command line after installing
69the libraries using commands like this:
70
71$ cd utils/wxrc
72$ g++ -o wxrc wxrc.cpp `wx-config --cxxflags --libs base,xml`
73
0cd6a2f8
JS
74Creating universal binaries
75---------------------------
76
77The Xcode projects for the wxWidgets library and minimal project are set up
78to create universal binaries.
79
80If using the Apple command line tools, pass --enable-universal_binary when
81configuring wxWidgets. If you use wx-config --libs to link your application,
82he necessary linker flags will be added. When compiling your own files,
83you need to add -arch ppc -arch i386 to your CFLAGS.
84
85As an alternative to using --enable-universal_binary, you can build for
86each architecture separately and then use the lipo tool to glue the
87binaries together. Assuming building on a PPC system:
88
891. First build in the usual way to get the PPC library.
90
912. Then, build for Intel, in a different folder. This time use:
92
93export CFLAGS="-g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386"
94export LDFLAGS="-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
95
96./configure --disable-dependency-tracking --enable-static=yes --enable-shared=no \
97 --target=i386-apple-darwin8 --host=powerpc-apple-darwin8 --build=i386-apple-darwin8
98
99You will need to reverse the powerpc and i386 parameters everywhere to build PPC on an Intel
100machine.
101
1023. Use lipo to glue the binaries together.
103
104See also:
105http://developer.apple.com/technotes/tn2005/tn2137.html
106
107
108Building with CodeWarrior
109-------------------------
110
111(Note that using the Apple tools is recommended.)
112
2e492c85
SC
113Installing latest headers (and Carbon Support)
114----------------------------------------------
115
ef3f71c3
JS
116Patching headers: CodeWarrior 8.x
117---------------------------------
118
f1570682
SC
119If you run into trouble with WCHAR_MIN and WCHAR_MAX the for
120MacOS X Support:Headers:(wchar_t Support fix):machine:ansi.h,
ef3f71c3
JS
121apply the patch ansi.diff.
122
123You may also need to comment out the _T definition in
124ctype.h if you get multiple definition errors.
125
90838153
GD
126setup.h
127-------
128
f69fcd07
GD
129in order to build wxMac with CodeWarrior, you must copy or alias the file
130include/wx/mac/setup0.h to include/wx/setup.h.
90838153 131
f69fcd07
GD
132this step is not needed when using the Apple Developer Tools under Mac OS X
133since the setup.h file is automatically generated during the configuration.
90838153 134
0a67a93b
SC
135OpenGL
136------
137
f69fcd07
GD
138In order to build opengl support with CodeWarrior, you must install the opengl
139libraries and headers from http://developer.apple.com/opengl/index.html
90838153 140
f69fcd07
GD
141If you want OpenGL support with CodeWarrior, set wxUSE_OPENGL to 1 in
142include/wx/setup.h
0a67a93b 143
2b5f62a0
VZ
144If you don't want OpenGl support, set wxUSE_OPENGL to 0 (the
145default) and remove the file OpenGLLibraryStub from the project
146before compilation.
b9eed05d 147
f69fcd07
GD
148If you want OpenGL support with the Apple Developer Tools under Mac OS X, add
149--with-opengl to the arguments of configure when configuring wxMac.
0a67a93b 150
8d823dab
SC
151Project Files
152-------------
153
f69fcd07
GD
154The project files are stored as xml text files and converted to binary
155CodeWarrior projects in the distribution (see AppleScript Files below):
f69fcd07 156
f1570682 157 - *M8.xml -> *M8.mcp for CodeWarrior 8 and above.
2b5f62a0 158
f69fcd07
GD
159AppleScript Files
160-----------------
161
a4411ee2
JS
162Several AppleScript files are provided in the docs:mac directory:
163
a4411ee2
JS
164 - M8xml2mcp.applescript to convert xml files to CodeWarrior 8 projects
165 - M8mcp2xml.applescript to convert CodeWarrior 8 projects to xml files
61d6643f 166 - SetXMLCreator.applescript to set correct creator type (see below)
a4411ee2
JS
167
168To run the XML to MCP conversion scripts:
169
170Double click on e.g. docs/mac/M8xml2mcp.applescript, then "run"
171the applescript and when asked for a folder pick src/. Then it
172takes a while to scan all dirs for the xml files and convert
173them to mcps. If some conversions fail it means an mcp already
174exists (back them up prior to running the script).
b9eed05d 175
61d6643f
JS
176To set the correct creator type for importing into CodeWarrior,
177you may need to run SetXMLCreator.applescript.
178
2e492c85
SC
179Problems with .xpm files
180------------------------
1ebfaf0c
SC
181
182if you have downloaded all the files and get errors like :
183
184Error : the file 'wx/generic/tip.xpm' cannot be opened
185tipdlg.cpp line 201 #include "wx/generic/tip.xpm"
186
f69fcd07
GD
187then your cvs has changed the type of the .xpm files to something other than
188text, in order to fix this either change the type by using a resource editor
189or drag the files from /include/wx/generic/..xpm on the SetTypeFromExtension
190application that is included in this folder. This small applet itself queries
191the Internet Config, so you will have to associate the "xpm" extension with
192CodeWarrior before making use of this applet.
2e492c85
SC
193
194Missing PLStringFuncsLib
195------------------------
196
b9eed05d 197You will have to build All Targets for MacOS Support:Libraries:Sources:PLStringFuncs:Glue:PLStringFuncsGlue.mcp
2b5f62a0 198
0cd6a2f8 199