]>
Commit | Line | Data |
---|---|---|
6b9a6d77 DS |
1 | wxWindows 2.5 for Mac installation |
2 | ---------------------------------- | |
2b5f62a0 VZ |
3 | |
4 | On MacOS X, you can download Apple's free developer tools (gcc | |
5 | and associated headers and libraries, such as the Carbon API). | |
6 | You can then use configure in a similar way to compiling | |
6b9a6d77 DS |
7 | wxWindows on Linux (or on Windows using MinGW or Cygwin). See |
8 | 'Apple Developer Tools' below for more details on using | |
2b5f62a0 VZ |
9 | configure. |
10 | ||
11 | To target on MacOS 8 or 9, you need to buy Metrowerks | |
12 | CodeWarrior. You can then compile Mac Classic or MacOS X | |
13 | applications on Mac OS X, or compile Mac Classic or MacOS X | |
14 | applications on Mac Classic. However you can only run and debug | |
15 | each type of application on the target operating system. | |
16 | ||
2e492c85 SC |
17 | Installing latest headers (and Carbon Support) |
18 | ---------------------------------------------- | |
19 | ||
2b5f62a0 VZ |
20 | NOTE: these steps are not necessary for CW Pro 6 and above, |
21 | only for CW Pro 5.3. | |
8d823dab | 22 | |
2b5f62a0 | 23 | The latest build for carbon support leads to a few changes you will have to |
f69fcd07 | 24 | follow, in order to successfully compile the code (also necessary if you don't |
2b5f62a0 VZ |
25 | want to build the carbon targets). |
26 | ||
27 | 1. You need CodeWarrior Pro 5.3 , i.e. 5.0 with all the upgrades. | |
28 | 2. You have to download the 3.4.0 (or greater) universal interfaces from | |
29 | ftp://ftp.apple.com/developer/Development_Kits/UniversalHeaders3.4.1.img.bin. | |
30 | 3. put the Interfaces and Libraries Folder into the MacOS Support folder and | |
31 | replace older versions. | |
32 | 4. remove from the MacOS Support folder the separate OpenTransport folder. | |
f9e45bd7 | 33 | 5. open the file MacOS Support:MacHeaders:MacHeaders.c and add the line |
1eaf1962 SC |
34 | #include <ControlDefinitions.h> |
35 | after the | |
36 | #include <Controls.h> | |
2b5f62a0 | 37 | 6. rebuild all MacHeaders from the MacHeaders.mcp project in the same folder. |
1eaf1962 | 38 | |
2b5f62a0 | 39 | If you want to build the carbon targets, you will also need the latest |
f69fcd07 | 40 | carbonized version of MSL from Metrowerks, at the time of writing, this meant |
2b5f62a0 VZ |
41 | applying the changes from the folders: |
42 | ||
1eaf1962 SC |
43 | CodeWarrior Pro 5:Pre-Release:Carbon & MacOSX Development:Carbonized MSL and |
44 | CodeWarrior Pro 5:Pre-Release:Carbon & MacOSX Development:Carbonized Runtimes | |
1ebfaf0c SC |
45 | (consult the file CodeWarrior Pro 5:Pre-Release:Carbon & MacOSX Development:Carbon & MacOSX README) |
46 | ||
ef3f71c3 JS |
47 | Patching headers: CodeWarrior 8.x |
48 | --------------------------------- | |
49 | ||
50 | If you run into trouble with WCHAR_MIN and WCHAR_MAX in ansi.h, | |
51 | apply the patch ansi.diff. | |
52 | ||
53 | You may also need to comment out the _T definition in | |
54 | ctype.h if you get multiple definition errors. | |
55 | ||
90838153 GD |
56 | setup.h |
57 | ------- | |
58 | ||
f69fcd07 GD |
59 | in order to build wxMac with CodeWarrior, you must copy or alias the file |
60 | include/wx/mac/setup0.h to include/wx/setup.h. | |
90838153 | 61 | |
f69fcd07 GD |
62 | this step is not needed when using the Apple Developer Tools under Mac OS X |
63 | since the setup.h file is automatically generated during the configuration. | |
90838153 | 64 | |
0a67a93b SC |
65 | OpenGL |
66 | ------ | |
67 | ||
f69fcd07 GD |
68 | In order to build opengl support with CodeWarrior, you must install the opengl |
69 | libraries and headers from http://developer.apple.com/opengl/index.html | |
90838153 | 70 | |
f69fcd07 GD |
71 | If you want OpenGL support with CodeWarrior, set wxUSE_OPENGL to 1 in |
72 | include/wx/setup.h | |
0a67a93b | 73 | |
2b5f62a0 VZ |
74 | If you don't want OpenGl support, set wxUSE_OPENGL to 0 (the |
75 | default) and remove the file OpenGLLibraryStub from the project | |
76 | before compilation. | |
b9eed05d | 77 | |
f69fcd07 GD |
78 | If you want OpenGL support with the Apple Developer Tools under Mac OS X, add |
79 | --with-opengl to the arguments of configure when configuring wxMac. | |
0a67a93b | 80 | |
8d823dab SC |
81 | Project Files |
82 | ------------- | |
83 | ||
f69fcd07 GD |
84 | The project files are stored as xml text files and converted to binary |
85 | CodeWarrior projects in the distribution (see AppleScript Files below): | |
86 | - *M5.xml -> *M5.mcp for CodeWarrior 5.3 | |
87 | - *M6.xml -> *M6.mcp for CodeWarrior 6 | |
2b5f62a0 | 88 | - *M7.xml -> *M7.mcp for CodeWarrior 7 and above. |
b9eed05d | 89 | |
eb5420bf | 90 | In order to build the library (and then the samples) you need to make the |
2b5f62a0 VZ |
91 | following projects (for CW 5.3, similar process for CW 7): |
92 | ||
93 | :src:wxwindowsM5.mcp | |
f69fcd07 GD |
94 | :src:png:pngM5.mcp |
95 | :src:tiff:tiffM5.mcp | |
96 | :src:jpeg:jpegM5.mcp | |
97 | :src:zlib:zlibM5.mcp | |
98 | ||
2b5f62a0 VZ |
99 | Note that if using CW 8 and above, when compiling the samples |
100 | you may need to edit the target settings, click on Language | |
101 | Settings, C/++ Language and remove the forward slash at the | |
102 | start of /wx/wx_cw_d.h (or similar filename). | |
103 | ||
f69fcd07 GD |
104 | AppleScript Files |
105 | ----------------- | |
106 | ||
a4411ee2 JS |
107 | Several AppleScript files are provided in the docs:mac directory: |
108 | ||
109 | - M5xml2mcp.applescript to convert xml files to CodeWarrior 5 projects | |
110 | - M5mcp2xml.applescript to convert CodeWarrior 5 projects to xml files | |
f69fcd07 | 111 | - M5build.applescript to automatically build all samples/demos projects |
a4411ee2 JS |
112 | - M8xml2mcp.applescript to convert xml files to CodeWarrior 8 projects |
113 | - M8mcp2xml.applescript to convert CodeWarrior 8 projects to xml files | |
61d6643f | 114 | - SetXMLCreator.applescript to set correct creator type (see below) |
a4411ee2 JS |
115 | |
116 | To run the XML to MCP conversion scripts: | |
117 | ||
118 | Double click on e.g. docs/mac/M8xml2mcp.applescript, then "run" | |
119 | the applescript and when asked for a folder pick src/. Then it | |
120 | takes a while to scan all dirs for the xml files and convert | |
121 | them to mcps. If some conversions fail it means an mcp already | |
122 | exists (back them up prior to running the script). | |
b9eed05d | 123 | |
61d6643f JS |
124 | To set the correct creator type for importing into CodeWarrior, |
125 | you may need to run SetXMLCreator.applescript. | |
126 | ||
6b9a6d77 DS |
127 | Apple Developer Tools |
128 | --------------------- | |
b9eed05d | 129 | |
6b9a6d77 DS |
130 | As in all Unix projects, you need to do something like this under MacOS X |
131 | with the Apple Developer Tools installed: | |
b9eed05d | 132 | |
c5229494 | 133 | 1) cd into the base dir |
6b9a6d77 DS |
134 | 2) mkdir osx-build |
135 | 3) cd osx-build | |
b9eed05d RR |
136 | 4) ../configure |
137 | 5) make | |
138 | ||
980550fc DE |
139 | If you want to install the library into the system directories you'll need |
140 | to do this as root. The accepted way of running commands as root is to | |
141 | use the built-in sudo mechanism. First of all, you must be using an | |
142 | account marked as a "Computer Administrator". Then | |
b9eed05d | 143 | |
980550fc DE |
144 | 6) sudo make install |
145 | 7) type <YOUR OWN PASSWORD> | |
146 | ||
147 | Note that while using this method is okay for development, it is not | |
148 | recommended that you require endusers to install wxWindows into their | |
149 | system directories in order to use your program. One way to avoid this | |
150 | is to configure wxWindows with --disable-shared. Another way to avoid | |
151 | it is to make a framework for wxWindows. Making frameworks is beyond | |
152 | the scope of this document. | |
b9eed05d | 153 | |
f69fcd07 | 154 | Note: |
980550fc | 155 | We recommend you configure a static library instead: |
b9eed05d RR |
156 | |
157 | 4) ../configure --disable-shared | |
158 | ||
f69fcd07 GD |
159 | or activate OpenGL: |
160 | ||
161 | 4) ../configure --with-opengl | |
b9eed05d | 162 | |
980550fc DE |
163 | Note: |
164 | It is rarely desirable to install non-Apple software into system directories. | |
165 | By configuring the library with --disable-shared and using the full path | |
166 | to wx-config with the --in-place option you can avoid installing the library. | |
8d823dab | 167 | |
2e492c85 SC |
168 | Problems with .xpm files |
169 | ------------------------ | |
1ebfaf0c SC |
170 | |
171 | if you have downloaded all the files and get errors like : | |
172 | ||
173 | Error : the file 'wx/generic/tip.xpm' cannot be opened | |
174 | tipdlg.cpp line 201 #include "wx/generic/tip.xpm" | |
175 | ||
f69fcd07 GD |
176 | then your cvs has changed the type of the .xpm files to something other than |
177 | text, in order to fix this either change the type by using a resource editor | |
178 | or drag the files from /include/wx/generic/..xpm on the SetTypeFromExtension | |
179 | application that is included in this folder. This small applet itself queries | |
180 | the Internet Config, so you will have to associate the "xpm" extension with | |
181 | CodeWarrior before making use of this applet. | |
2e492c85 SC |
182 | |
183 | Missing PLStringFuncsLib | |
184 | ------------------------ | |
185 | ||
b9eed05d | 186 | You will have to build All Targets for MacOS Support:Libraries:Sources:PLStringFuncs:Glue:PLStringFuncsGlue.mcp |
2b5f62a0 | 187 |