cfad47cfa3/doc/MacOSX

4b825dc642cb6eb9a060e54bf8d69288fbee4904cfad47cfa334b206c65f22086bcc5d63e6f70944
1
How to install Frobtads on a Mac running OSX
2
So that you too can write TADS games!!!
3
4
(These are instructions for command-line novices, like me!)
5
6
by Reg
7
8
Corrections to this text should be sent to regan.toews@mail.mcgill.ca
9
10
--------------------------------------------
11
12
1) Find the program "Terminal".  Get to know it.
13
14
It is probably stored in the utilities folder which is inside your applications folder.  Drag it to the dock as you'll be needing to open this often.
15
16
Some info for Terminal Newbies:
17
18
Using terminal, you are always located somewhere inside your computer.  For instance, you could be inside your applications folder, or perhaps your itunes
folder... but it's important to know where you are because this affects how commands could be interpreted.
19
20
Some common commands:
21
22
CHANGING DIRECTORY
23
	cd			- change directory (this is how you navigate around in your computer)
24
	/Applications		- the slash refers to a folder, the name after the slash is the name of a folder
25
	cd /Applications	- this is how you would enter the Applications folder
26
	cd /Applications/Utilities - this is how you would enter the utilities folder
27
	.			- a dot means "current folder"
28
	..			- two dots mean "one folder before"
29
	cd ../			- means move to the previous folder
30
31
Try the cd command with different folders to get a feel for navigating.
32
33
(If any folders have spaces in them, things are a little more complicated - you can drag a file or folder into the "terminal" window and it will show
how you would type the location of the file or folder)
34
35
FINDING A FILE (includes hidden files which spotlight won't show you)
36
	cd /			- changes directories so you're located in the top-most directory
37
	find . -name adv3.h	- searches for a file called "adv3.h"
38
39
OTHER COMMANDS
40
	tar -xzf		- expand a *.tar.gz compressed archive
41
	ls			- list all files in a folder, except hidden files
42
	ls -a			- list everything in a folder, including hidden files
43
	sudo			- this command is added to the beginning of a command if it's something where you need to have administrative (root) access
44
45
A list of more commands:
46
http://www.ss64.com/bash
47
48
A very good unix beginner page is here:
49
http://forums.macosxhints.com/showthread.php?t=40648
50
51
By the way:
52
The word "binary" generally means "compiled file" as opposed to the "source code" which is the building blocks of a file.
53
54
--------------------------------------------
55
56
2) Download a free text-editing application.
57
58
You will use this program to write your game code files with.  I use Smultron (available at: http://smultron.sourceforge.net/).
59
60
--------------------------------------------
61
62
3) Install xcode tools.
63
64
This is on your install DVD that came with your mac but it's better to download the newest version via the internet.
65
Goto: http://developer.apple.com/tools/xcode/
66
This is free when you make an ADC account (account is also free).
67
Follow the installation instructions that come with it.
68
69
--------------------------------------------
70
71
4) Download and install fink
72
73
Goto: http://fink.sourceforge.net/download/
74
75
IMPORTANT NOTE: the installer disk image of fink contains additional files, including an application called finkcommander.  Create a new folder in Applications
called "fink extras" and drag the extra info including finkcommander to this folder after you've installed fink itself.
76
77
The instructions on how to download and install the program are on the site but I've included it here so you don't have to be reading instructions from more
than one place.
78
79
I've edited it a little too:
80
81
-----
82
   1.
83
      Download the installer disk image:
84
      Fink 0.8.1 Binary Installer (PowerPC) - 17930 KB
85
      Fink 0.8.1 Binary Installer (Intel) - 17510 KB
86
      (10.3 users - use Fink 0.7.2)
87
      (10.2 users - use Fink 0.6.4)
88
      (10.1 users - use Fink 0.4.1)
89
90
   2.
91
      Double-click "Fink-0.8.1-XYZ-Installer.dmg" (where XYZ is either PowerPC or Intel) to mount the disk image, then double-click the "Fink
0.8.1 XYZ Installer.pkg" package inside. Follow the instructions on screen.
92
93
      Then create a folder in your Applications folder called "fink extras" and drag the other information, including the application
"finkcommander" contained in the disk image, into the fink extras folder.
94
95
   3.
96
      At the end of the installation, the pathsetup utility will be launched. You will be asked for permission before your shell's configuration files are
edited (use your administrative password). When the utility has finished, you are set to go!
97
98
   4.
99
      If anything goes wrong during this process, you can try again by launching the pathsetup application which appears on the installer disk, or by running
(from the command line in a Terminal.app window)
100
101
      /sw/bin/pathsetup.sh
102
103
      (This step should also be repeated by any other users on your system: each user must run pathsetup in his or her own account.)
104
105
      If pathsetup generates errors messages, consult the documentation, particularly section 2.3 "Setting Up Your Environment" of the User's Guide.
106
107
   5.
108
      Open a new Terminal.app window and run the following: "fink scanpackages; fink index", or use the included Fink Commander GUI application (which
must be placed in a real folder on your system, not run from the disk image) and run the following commands from its menu: Source->scanpackages followed by
Source->Utilities->index.
109
110
   6.
111
      Once those two commands are finished you should update the fink package, in case there have been significant changes since the last point release. After
you do this you can install other packages. There are several ways to do this:
112
113
          *
114
            Use the included Fink Commander to select and install packages. Fink Commander provides an easy to use GUI for Fink. This is the recommended method
for new users, or users who are not comfortable with the command line. Fink Commander has Binary and Source menus. You should install from binaries if you don't
have the Developer Tools installed, or don't want to build packages yourself.
115
116
                o
117
                  The Fink Commander sequence to update fink from binaries is as follows:
118
                     1. Binary->Update descriptions
119
                     2. Select the fink package.
120
                     3. Binary->Install
121
                o
122
                  The recommended Fink Commander sequence to update fink from source is as follows:
123
                     1. Source->Selfupdate
124
                     2. Tools->Interact with Fink...
125
                     3. Make sure "Accept default response" is selected, and click "Submit".
126
                     4. fink and other base packages will be built and run automatically
127
128
            Now that you've updated fink, you can install other packages.
129
                o To install from binaries, select the package, and use Binary->Install.
130
                o To install from source, select the package, and use Source->Install
131
132
          *
133
            Use apt-get. Apt-get will fetch and install binary packages for you, saving compiling time. You should either use this method or the Fink Commander
binary method (above) if you don't have the Developer Tools installed.
134
135
            To update fink open a Terminal.app window and type sudo apt-get update ; sudo apt-get install fink
136
137
            Once you've updated fink, you can install other packages, using the same syntax, e.g sudo apt-get install gimp to install the Gimp. Note, however,
that not all fink packages are in binary form.
138
139
          *
140
            Install from source (requires the XCode Tools [Developer Tools on 10.2] to be installed). To update fink run fink selfupdate. When prompted, select
option (1), "rsync". This will automatically update the fink package.
141
142
            Once fink is updated, you can use "fink install" to fetch and compile from source code. For example, to install the Gimp, run fink install
gimp.
143
144
--------------------------------------------
145
146
5) Use finkcommander to install ncurses
147
148
- start the finkcommander application (should be in the folder you made called "fink extras")
149
- type "ncurses" in the search window
150
- locate nucurses, ncurses-dev, and ncurses-shlibs and see if they say "current" on the left and have a date under "installed".  If so,
you're good to go to the next step. If not, click on those that are not installed and click on the "install binary" icon (the little icon with the
blue crss on it)
151
152
--------------------------------------------
153
154
6) Download and install Frobtads and the TADS2 and/or TADS3 compiler(s)
155
156
Go to: http://www.tads.org/frobtads.htm
157
158
- Download "FrobTADS" and then one or both of the TADS 2 and TAD 3 compiler add-ons depending on your preference.
159
- Your computer will probably automatically decompress these items. If it hasn't done so for the frobtads folder, double-click on the disk image so it
decompresses.  Throw out any expanded versions of the Tads 2 or 3 compilers as you must expand these using "terminal"
160
- Drag your decompressed frobtads folder to your computer icon
161
- start the "terminal" program
162
- type "cd /frobtads-0.6" and press enter
163
164
- Drag the disk image of the compiler(s) to the expanded frobtads folder
165
- Expand the compiler disk images using the "terminal" application
166
- Do this by changing the directory to frobtads folder where the disk images are now stored
167
	cd /Applications/frobtads-0.6
168
- expand the files depending on which ones you have by typing the following:
169
	tar -xzf t3comp.tar.gz
170
	tar -xzf t2comp.tar.gz
171
172
To configure and compile the program, type the following one-at-a-time:
173
174
	export PATH=$PATH:/usr/local/bin
175
	./configure
176
	make
177
	sudo make install
178
179
(after sudo make install you will be probably asked for your admin password)
180
(If, after "make" all it says is: make  all-am, type "make clean" and then "make" again)
181
(If, after "make" it says "no rule to make target" then you've written over the tad3compiler folder with the one you expanded and you need
to go back to the beginning and re-expand the frobtads folder.  Make sure you expand the tads3 compiler using the "terminal" application and not
stuffit)
182
183
------------------------
184
185
7) Make sure all is in working order
186
187
Frobtads should now be installed on your computer.  Check by:
188
downloading a Tads3 game, use the terminal program to change directories to the folder containing the game and then type "frob" and the game name in
order to see if the game will run.
189
190
Example:
191
Download a game from here: http://www.ifarchive.org/indexes/if-archiveXgamesXtads.html
192
If you saved it in a folder called "textadventuers" inside another called "games" you would do the following:
193
	cd /games/textadventures
194
	frob abrokenman.t3
195
196
If it works, test the compilers:
197
198
TADS 2 (I don't know how to test it other than write a game and see if it compiles since I only have TADS 3 installed myself).
199
To write a game, read: 	TADS 2: http://www.tela.bc.ca/tads-manual/
200
Note:  For Tads 3, you don't need to specify where the compiler's include files
201
are installed.  But the Tads 2 compiler works different.  When invoking
202
'tadsc', you'll have to use the -i option:
203
	tadsc -i /usr/local/share/frobtads/tads2 somesource.t
204
205
For Tads3 compiler:
206
	make sample
207
	./frob ./samples/sample.t3
208
209
If a game starts, all is well!
210
211
Write your game!
212
	TADS 2: http://www.tela.bc.ca/tads-manual/
213
	TADS 3: http://www.tads.org/t3doc/doc/index.htm
214
215
NOTE ABOUT INVOKING (STARTING) T3MAKE, FROB ETC:
216
If when you type t3make it says command not found, try typing /usr/local/bin/t3make
217
If this works, t3make has been installed, it's just that your "path" isn't set-up.
218
219
To set up your PATH in bash, you edit the file ~/.profile (using any text editor that can save in plain text - e.g. 'pico') and add a line like the following:
220
	export PATH="$PATH:/usr/local/bin"
221
222
For information on how to edit this file, go to:
223
http://forums.macosxhints.com/showthread.php?t=40648
224
225
226
--------------------------------------------
227
228
8) Tidy Up!
229
230
Once all is in working order, you can trash the frobtads folders and disk images as they are no longer neccessary.  (Everything is now stored in folders in your
computer, namely /usr/local)
231
232
--------------------------------------------
233
234
9) Notes
235
236
Once a compiler or run-time is installed, you can just type the command like "frob" or "t3make" for example and you don't have to tell the
computer where the command is stored, nor do you have to be in the directory where it's stored - you have to tell it where the game file is stored though or be
located in the correct folder where the game is located
237
238
When compiling using the Tads3 compiler the "-f" is vital... don't forget it!
239
   t3make -f heidi.t3m
240
   (or specify location: t3make -f /Games/heidi.t3m)
241
242
Usually, in your own game, you name your project file (actually a
243
makefile) "Makefile.t3m".  That way, you only need to type:
244
   t3make
245
to compile the game.  No "-f Makefile.t3m" required.
246
247
Where to get games:
248
	http://www.ifarchive.org/indexes/if-archiveXgamesXtads.html
249
250
How to start writing your own games:
251
	TADS 2: http://www.tela.bc.ca/tads-manual/
252
	TADS 3: http://www.tads.org/t3doc/doc/index.htm
253
254
To play games:
255
	In the "terminal" program, type "frob" followed by the location of the game file.  For instance, if I create a folder called
"games" on my harddrive and I want to play a game called greatgame.gam, I would type:
256
frob /games/greatgame.gam
257
258
To get a list of command-line options: "frob --help".
259
260
--------------------------------------------
261
262
10) Troubleshooting
263
264
1
265
266
If both curses and ncurses are installed, ncurses will be preferred.
267
If neither is found, the 'configure' script will inform you
268
that the interpreter cannot be built.  You need to go back to the fink program and make sure they are installed.
269
270
2
271
272
If you're "denied permission" at any time, add the word "sudo" to the front of the command
273
274
3
275
276
For Tads 3, you don't need to specify where the compiler's include files
277
are installed.  But the Tads 2 compiler works different.  When invoking
278
'tadsc', you'll have to use the -i option:
279
280
  tadsc -i /usr/local/share/frobtads/tads2 somesource.t
281
282
(Remember to use the actual path if you installed somewhere else.)
283
284
4
285
286
If, when you type "make" it just says "make  all-am" and nothing else, type "make clean" and then "./configure" again
287
288
5
289
290
If you decide later you want to install one or the other of the compilers but you have already installed the frobtads program, type "./config-status
--recheck" and then recompile.
291
292
5
293
294
If you're trying to do "make install" and nothing seems to work, type
295
export PATH=$PATH:/usr/local/bin
296
If you're told certain folders are missing too, type the line above and start again from ./configure
297
298
6
299
300
If it says t3make not found, you probably forgot
301
export PATH=$PATH:/usr/local/bin
302
303
7
304
305
If the game isn't compiling, don't forget the "-f" part of the command.  Also make sure to create an obj folder in the same folder as the heidi game.
306
307
8
308
309
If you've installed frobtads (when you type "cd /usr/local/bin" and then "ls" it is listed), but when you type t3make, it says command not
found, you need to set up your "path"
310
311
To set up your PATH in bash, you edit the file ~/.profile (using any text editor that can save in plain text - e.g. 'pico') and add a line like the following:
312
	export PATH="$PATH:/usr/local/bin"
313
314
For information on how to edit this file, go to:
315
http://forums.macosxhints.com/showthread.php?t=40648
316
317
318
---------------------------
319
320
Most important websites:
321
322
www.tads.org
323
http://www.ifarchive.org/
324
http://forums.macosxhints.com/showthread.php?t=40648