source: rtems-graphics-toolkit/fltk-1.3.0/README.OSX.txt @ d280eda

Last change on this file since d280eda was f5c9e9c, checked in by Alexandru-Sever Horin <alex.sever.h@…>, on 07/05/12 at 09:33:03

Aded FLTK 1.3.0

  • Property mode set to 100644
File size: 9.5 KB
Line 
1README.OSX.txt - 2010-10-23 - Building FLTK under Apple OS X
2------------------------------------------------------------
3
4
5
6 CONTENTS
7==========
8
9  1   INTRODUCTION
10  2   HOW TO BUILD FLTK USING GCC
11    2.1   Prerequisites
12    2.2   Downloading and Unpacking
13    2.3   Configuring FLTK
14    2.4   Building FLTK
15    2.5   Testing FLTK
16    2.6   Installing FLTK
17    2.7   Creating new Projects
18  3   HOW TO BUILD FLTK USING XCODE3
19    3.1   Prerequisites
20    3.2   Downloading and Unpacking
21    3.3   Configuring FLTK
22    3.4   Building FLTK
23    3.5   Testing FLTK
24    3.6   Uninstalling previous versions of FLTK
25    3.7   Installing FLTK
26    3.8   Installing Little Helpers
27    3.9   Creating new Projects
28  4   DOCUMENT HISTORY
29
30
31 1  INTRODUCTION
32=================
33
34FLTK currently supports the following development environments on the Apple OS X
35platform:
36
37    - gcc command line tools
38    - Xcode 3.x
39   
40CAUTION: gcc command line built libraries and Xcode created Frameworks should
41not be mixed!   
42
43
44 2  HOW TO BUILD FLTK USING GCC
45================================
46
47
48 2.1  Prerequisites
49--------------------
50
51In order to build FLTK from the command line, you need to install the Xcode
52developer environment from the Apple Inc. web site. The developer environment
53can be downloaded from the Mac Dev Center for free:
54
55  http://developer.apple.com/technologies/xcode.html
56 
57After downloading and installing, you need to launch the Terminal. Terminal.app
58is located in the "Utilities" folder inside the "Applications" folder. I like to
59keep the Terminal in the Dock.
60
61
62 2.2  Downloading and Unpacking
63--------------------------------
64
65Download FLTK from here:
66
67  http://www.fltk.org/software.php
68
69If you are familiar with "subversion" and like to stay current with your
70version, you will find the subversion access parameters at the bottom of that
71page. Unpack FLTK into a convinient location. I like to have everything in my
72dev directory:
73
74  cd
75  mkdir dev
76  cd dev
77  mv ~/Downloads/fltk-1.3.xxxx.tar.gz .
78  tar xvfz fltk-1.3.xxxx.tar.gz
79  cd fltk-1.3.xxxx
80 
81
82 2.3  Configuring FLTK
83-----------------------
84
85Stay in your FLTK source-code directory. Type:
86 
87  autoconf
88
89Now configure your FLTK installation:
90
91  ./configure
92 
93ADVANCED: type "./configure --help" to get a complete list of optional
94configurations parameters. These should be pretty self-explanatory. Some
95more details can be found in README.
96
97To create Universal Binaries, start "configure" with these flags:
98  ./configure  --with-archflags="-arch i386 -arch ppc -arch x86_64"
99:END_ADVANCED
100
101The configuration script will check your machine for the required resources
102which should all have been part of your Xcode installation. Review the
103Configuration Summary, maybe take some notes.
104
105
106 2.4  Building FLTK
107--------------------
108
109Now this is easy. Stay in your FLTK source-code directory and type:
110
111  make
112
113The entire FLTK toolkit including many test programs will be built for you. No
114warnings should appear, but "ranlib" may complain about a few modules having no
115symbols. This is normal and can safely be ignored.
116
117
118 2.5  Testing FLTK
119-------------------
120
121After a successful build, you can test FLTK's capabilities:
122
123  test/demo
124
125
126 2.6  Installing FLTK
127----------------------
128
129If you did not change any of the configuration settings, FLTK will be installed
130in "/usr/local/include" and "/usr/local/lib" by typing
131
132  sudo make install
133 
134It is possible to install FLTK without superuser privileges by changing the
135installation path to a location within the user account by adding the
136"--prefix=PREFIX" parameter to the "./configure" command.
137
138
139 2.7  Creating new Projects
140----------------------------
141
142FLTK provides a neat script named "fltk-config" that can provide all the flags
143needed to build FLTK applications using the same flags that were used to build
144the library itself. Architecture flags (e.g., -arch i386) used to build the
145library, though, are not provided by the fltk-config script. This allows to
146build universal libraries and to produce applications of any architecture
147from them. Running "fltk-config" without arguments will print a list
148of options. The easiest call to compile an FLTK application from a single source
149file is:
150
151  fltk-config --compile myProgram.cxx
152
153"fltk-config" and "fluid" will be installed in "/usr/local/bin/" by default. I
154recommend that you add it to the command search path.
155
156
157
158 3  HOW TO BUILD FLTK USING XCODE3
159===================================
160
161
162 3.1  Prerequisites
163--------------------
164
165In order to build FLTK from within Xcode, you need to install the Xcode
166developer environment from the Apple Inc. web site. The developer environment
167can be downloaded from the Mac Dev Center for free:
168
169  http://developer.apple.com/technologies/xcode.html
170 
171
172 3.2  Downloading and Unpacking
173--------------------------------
174
175Download FLTK from here:
176
177  http://www.fltk.org/software.php
178
179If you are familiar with "subversion" and like to stay current with your
180version, you will find the subversion access parameters at the bottom of that
181page. You can use the SCM system that is built into Xcode.
182
183Unpack FLTK by double-clicking it and copy the new folder into a convenient
184location. I have set up a "dev" folder in my home folder for all my projects.
185
186
187 3.3  Configuring FLTK
188-----------------------
189
190Launch Xcode. Open the project file in
191
192  .../fltk-1.3.xxxx/ide/Xcode3/FLTK.xcodeproj
193
194Use the "Project" pulldown menu to change "Active Build Configuration" to
195"Release". Change the "Active Architecture"  as desired.
196 
197
198 3.4  Building FLTK
199--------------------
200
201Use the "Project" pulldown menu to set the "Active Target" to "Demo".
202Select "Build" from the "Build" menu to create all libraries and test applications.
203
204All frameworks and apps will be located in "./ide/Xcode3/build/Release/".
205
206
207 3.5  Testing FLTK
208-------------------
209
210Select "Build and Run" from the "Build" menu to run the Demo program. Use "Demo"
211to explore all test programs.
212
213
214 3.6  Uninstalling previous versions of FLTK
215---------------------------------------------
216
217Remove FLTK frameworks:
218
219  sudo rm -r /Library/Frameworks/fltk*.framework
220 
221Remove Fluid and possibly other utilities:
222
223  sudo rm -r /Developer/Applications/Utilities/FLTK/
224 
225
226 3.7  Installing FLTK
227----------------------
228
229When distributing FLTK applications, the FLTK frameworks should be made part of
230the application package. For development however, it is very convenient to have
231the Release-mode Frameworks in a standard location.
232
233For Xcode project template use, all FLTK frameworks should be copied from
234"./ide/Xcode3/build/Release/" to "/Library/Frameworks/". The FLTK header files
235for all FLTK frameworks will then be at "/Library/Frameworks/fltk.framework/
236Headers/". Add this path to the header search path of your projects.
237
238  sudo rm -f -r /Library/Frameworks/fltk*
239  sudo cp -R ide/Xcode3/build/Release/fltk*.framework /Library/Frameworks/
240
241Many FLTK applications will use Fluid, the FLTK User Interface builder, to
242generate C++ source code from .fl resource files. Add Fluid to the developer
243tools:
244
245  sudo mkdir /Developer/Applications/Utilities/FLTK/
246  sudo rm -f -r /Developer/Applications/Utilities/FLTK/Fluid.app
247  sudo cp -R ide/Xcode3/build/Release/Fluid.app /Developer/Applications/Utilities/FLTK/
248
249
250 3.8  Installing Little Helpers
251--------------------------------
252
253
254- Project Templates:
255
256Project Templates are the quickest way to create a new FLTK application from
257within Xcode. The included project builds an FLTK based Cocoa application
258written in C++ with support for the Fluid UI designer, image reading, and
259OpenGL. Unused FLTK sub-Frameworks can simply be removed from the project.
260The template assumes that Release versions of the FLTK frameworks are installed
261in /Library/Frameworks as described above.
262
263First, we need to create the Template folder:
264
265  sudo mkdir -p /Library/Application\ Support/Developer/Shared/Xcode/Project\ Templates/
266
267Next, we copy the project template over:
268
269  sudo cp -r ide/Xcode3/Project\ Templates/* /Library/Application\ Support/Developer/Shared/Xcode/Project\ Templates/
270
271After restarting Xcode, the dialog for "File > New Project..." will offer an
272FLTK 1.3 user template which is ready to compile.
273
274
275- Fluid file handling
276
277This section assumes that a Release version of Fluid is installed in
278"/Developer/Applications/Utilities/FLTK/" as described above. It will install
279a new file type which opens Fluid as an editor for files ending in ".fl".
280
281First, we need to create the spec folder:
282
283  sudo mkdir -p /Library/Application\ Support/Developer/Shared/Xcode/Specifications/
284
285Next, we copy the Fluid specification over:
286
287  sudo cp ide/Xcode3/fluid.pbfilespec /Library/Application\ Support/Developer/Shared/Xcode/Specifications/
288
289Open Xcode preferences and select the File Types tab. Find the
290"sourcecode.fluid" entry in "file > text > sourcecode" and set the external
291editor to Fluid. When adding ".fl" files, set the File Type in the Info dialog
292to "sourcecode.fluid" and Xcode will edit your file in Fluid when
293double-clicking.
294
295
296- More
297
298TODO: Language Definition
299TODO: Build Rules
300
301
302 3.9  Creating new Projects
303----------------------------
304
305If the little helpers above were installed, the menu "File > New Project..."
306will pop up a dialog that offers a User Template named Fluid. Select it and
307follow the instructions.
308
309
310
311 4  DOCUMENT HISTORY
312=====================
313
314Oct 29 2010 - matt: removed warnings
315Oct 24 2010 - matt: restructured entire document and verified instructions
316Dec 19 2010 - Manolo: corrected typos
317Dec 29 2010 - Manolo: removed reference to AudioToolbox.framework that's no longer needed
318Feb 24 2011 - Manolo: architecture flags are not propagated to the fltk-config script.
Note: See TracBrowser for help on using the repository browser.