Change a lot of `(if .. (progn ..)' to `(when ..)'.
[bpt/emacs.git] / mac / INSTALL
CommitLineData
0a1bb123 1* BUILDING EMACS ON MAC OS Classic AND MAC OS X -*- outline -*-
1a578e9b 2
ceb4c4d3
TTN
3Copyright (C) 2001, 2002, 2003, 2004, 2005,
4 2006 Free Software Foundation, Inc.
b6955da2
AC
5
6 Permission is granted to anyone to make or distribute verbatim
7 copies of this document as received, in any medium, provided that
8 the copyright notice and permission notice are preserved, and that
9 the distributor grants the recipient permission for further
10 redistribution as permitted by this notice.
11
12 Permission is granted to distribute modified versions of this
13 document, or of portions of it, under the above conditions,
14 provided also that they carry prominent notices stating who last
15 changed them.
16
e0f712ba 17* BUILDING EMACS ON MAC OS X
1a578e9b 18
e0f712ba
AC
19You should be able to build Emacs on Mac OS X by typing the following
20commands at the top-level directory after the source distribution is
21un-tarred.
1a578e9b 22
77a4e329 23 ./configure --enable-carbon-app
e0f712ba
AC
24 make
25 make install
1a578e9b 26
77a4e329
ST
27The last step may fail if you do not have permissions to install. If
28you try to install into /usr (with ./configure --prefix=/usr), then you
29must install as root using the sudo command. However, it is not
30recommended; see the notes section below for more details.
31
32The --enable-carbon-app specifies that the carbon GUI application
33should be installed into /Application. If you want it to install in a
34different location, specify --enable-carbon-app=<mydir>
1a578e9b 35
a4581dd3
AC
36If you have X Window installed on your Mac and you are building Emacs
37to run under Carbon and not X Window, you need to type `./configure
38--without-x' instead of `./configure'.
39
e0f712ba
AC
40You can type `make bootstrap' instead of `make' to rebuild everything,
41including byte-compiling the Lisp files.
1a578e9b 42
77a4e329
ST
43If you are compiling on Mac OS X versions before 10.2 and have not
44installed the GNU texinfo package on your system, the build will
45complain that makeinfo cannot be found. Instructions for installing the
46GNU texinfo package are given below. Alternatively, you can type `make
47-k' instead of `make' and safely ignore the error messages and use the
48existing info files.
1a578e9b 49
e0f712ba
AC
50After Emacs is installed, you can run it by typing `emacs -nw' from a
51terminal (make sure your path contains /usr/local/bin) or by
77a4e329
ST
52double-clicking on /Applications/Emacs.app in the Finder. To start
53Emacs as a GUI application from the terminal, the pathname to the
54executable in the bundle, i.e.,
f871a27b 55
77a4e329 56 /Application/Emacs.app/Contents/MacOS/Emacs
f871a27b
AC
57
58must be typed to the shell to enable Emacs to locate its resources
77a4e329
ST
59correctly. You may want to create a symlink or alias to this path to
60quickly access both the terminal and GUI versions.
1a578e9b 61
043131c4
AC
62If you are building Emacs to run on Mac OS X and X Window,
63instead of typing `./configure' above, type
9794a8cd 64
043131c4 65 ./configure --without-carbon --with-x
9794a8cd 66
9794a8cd 67
e0f712ba
AC
68To use colors in a terminal, put the following lines in the file
69~/.termcap and log in again.
1a578e9b 70
e0f712ba
AC
71-----
72# added ANSI color
73vt100|vt100-am|vt100am|dec vt100:\
74 :pa#64:Co#8:Sf=\E[3%dm:Sb=\E[4%dm:op=\E[m:AF=\E[3%dm:AB=\E[4%dm:\
75 :do=^J:co#80:li#24:cl=\E[;H\E[2J:sf=2*\ED:\
76 :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\
77 :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
78 :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:\
79 :rf=/usr/share/tabset/vt100:\
80 :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[;r\E[0m\E(B\E)B\E[2J:\
81 :ks=\E[?1h\E=:ke=\E[?1l\E>:\
82 :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
83 :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=2*\EM:vt#3:xn:\
84 :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:
85-----
86
177c0ea7 87To build the `info' files in versions prior to Mac OS X 10.2, you need
77a4e329 88to install the texinfo software.
e0f712ba
AC
89
90To install from source, obtain texinfo-4.2.tar.gz from ftp.gnu.org or
91a mirror. Un-tar it, enter its directory and type
92
93 ./configure
94 make
95 make install
96
177c0ea7 97The last step may need to be performed as root (sudo make install).
e0f712ba
AC
98
99You may also like to install ispell, which will allow you to use
100ispell and flyspell-mode. To install ispell from source, you first
101need to install GNU textutils.
102
103To do so, download textutils-2.0.tar.gz from ftp.gnu.org or a mirror.
104Un-tar it, enter its directory, type
105
106 ./configure --host=powerpc-apple-bsd
107 make
108 make install
177c0ea7 109
77a4e329 110Again, the last step may need to be performed as root. Note that if you
e0f712ba
AC
111run `make check', the test for `pr' will fail.
112
113Get and un-tar ispell-3.2.06.tar.gz. Look for it here:
114
115 http://fmg-www.cs.ucla.edu/geoff/ispell.html
116
117Go into its directory, type
1a578e9b 118
e0f712ba
AC
119 cp local.h.samp local.h
120
121Add a line `#define TERMLIB ""' to the end of local.h.
122
123Set the environment variable TMPDIR to an existing directory. For
124example since `/tmp' exists on my machine and I am using `bash', I
125typed
126
127 export TMPDIR=/tmp
128
129Run `make' and `make install', the latter as root.
130
b3d08fe6
ST
131* BUILDING BINARY DISTRIBUTIONS FOR MAC OS X
132
133If you are intending to build a binary distribution of Emacs, there is
134a script that will greatly simplify the process. It is called
135make-package and it is contained in this directory. It will generate
136a disc image containing a installer bundle. By default the installer
137will place the emacs common files in /usr/local/* and the carbon
138application in /Applications. Typical usage would be
139
140./make-package
141
142After running, an compressed disk image of the installer will be placed
143in a file called EmacsInstaller.dmg. This file can be then distributed
144to whomever would like a binary distribution. Here are the common
145options to user
146
177c0ea7 147--with-x - Use the X11 GUI instead of the Carbon GUI.
b3d08fe6
ST
148--prefix=DIR - Place the common emacs files in the given DIR. The
149 default is /usr/local. See note below if placing
150 in /usr
b3d08fe6
ST
151--self-contained - Place the common emacs files inside the Emacs.app
152 itself. This makes the application trivial to
153 uninstall and copy between computers.
177c0ea7 154--app-symlink - Use a symlink inside the Application to the
b3d08fe6
ST
155 $prefix/bin/emacs to reduce disk space. Note, this
156 option may removed in the future.
157
b3d08fe6
ST
158
159For usage of other options, use the --help option.
e0f712ba 160
0a1bb123 161* BUILDING EMACS ON MAC OS Classic
e0f712ba 162
0a1bb123
YM
163FIXME: You can use either Metrowerks CodeWarrior Pro 6 or MPW-GM
164(Aug. 2001) to build Emacs. MPW-GM can be downloaded free of charge
165from Apple.
e0f712ba
AC
166
167In either case, you will need MPW-GM to build the make-docfile utility
168and to generate the doc string file DOC.
169
0772ffb2 170### IMPORTANT ### You can use StuffIt Expander to decompress and untar
e0f712ba 171the distribution. However, you *must* set the radio button in the
fa0b4c14
AC
172Preferences->Cross Platform->Convert text files to Macintosh format to
173"Never". Otherwise the compiled Lisp files will be corrupted.
174
0a1bb123 175FIXME: (Optional) A subset of the fonts from the GNU intlfonts-1.2
e0f712ba
AC
176distribution converted to NFNT format can be obtained from
177
178 ftp://mac-emacs.sourceforge.net/pub/mac-emacs/GNU-fonts.smi.bin
1a578e9b
AC
179
180To build Emacs in the MPW Shell, simply set the directory to
181...:emacs:mac: and build the target Emacs of the make file
0a1bb123 182makefile.MPW. I.e., execute the commands
1a578e9b
AC
183
184 make Emacs -f makefile.MPW > Emacs.MakeScript
185 Emacs.MakeScript
186
c2b735aa
YM
187The above commands create an executable that uses the Carbon API. The
188non-Carbon version can also be created by replacing all the
189occurrences of `Emacs' above with `NonCarbon'. Not that the
190non-Carbon version does not support some features such as file
0a1bb123 191dialogs, drag-and-drop, and Unicode menus.
c2b735aa 192
0a1bb123
YM
193FIXME: To build Emacs using CodeWarrior, start up the CodeWarrior IDE,
194choose File->Import Project... and select the file cw6-mcp.xml. When
2d7d0390 195prompted to save the project, navigate to same directory as the file
e0f712ba
AC
196cw6-mcp.xml, name the project emacs-cw6.mcp, and save it there. Then
197choose Project->Make. Note that this does not build the DOC file. To
198do so, use MPW and build the target "Doc" in makefile.MPW.
1a578e9b 199
0a1bb123
YM
200FIXME: Once built, the Emacs application (Emacs CW or Emacs MPW) can
201be launched where it is created.
1a578e9b 202
0a1bb123
YM
203FIXME: To build an optimized version of Emacs in CodeWarrior, change
204the value in the Emacs Settings->Code Generation->Global Optimization
1a578e9b
AC
205dialog. To build a version for profiling, check the Profiler
206Information box in the Emacs Settings->Code Generation->PPC Processor
207dialog and include the Profiler PPC.Lib library.
208
1a578e9b
AC
209* NOTES
210
0a1bb123
YM
211Emacs should build and run on a PowerMac running Mac OS 8.6 - 9.2 (but
212only tested on 9.2.2), and Mac OS X 10.1 - 10.4.
1a578e9b
AC
213
214You will need around 100 MB of disk space for the source files and
215intermediate files.
216
0a1bb123
YM
217Under Mac OS Classic, there is no support for building the LEIM
218directory. However, it can be built on Mac OS X or another platform
219and transferred to the Mac.
1a578e9b 220
b3d08fe6 221On Mac OS X, installing the emacs files in /usr can cause issues with
0a1bb123 222system software updates possibly overwriting the distribution. If this
b3d08fe6
ST
223is a concern, as it should be in normal binary distributions, please
224use /usr/local as the prefix for installation.
1a578e9b 225
47600d8e
ST
226Emacs supports both PowerPC and Intel-based Macintoshes. However,
227due to the unexec process that Emacs uses to dump core, it is not
228possible at this time to generate a universal binary that supports both
229architectures. In addition, Rosetta doesn't appear to work correctly
230with PowerPC builds of Emacs; you will have to recompile for Intel.
231Therefore, builds of Emacs are architecture specific.
1a578e9b 232
0a1bb123
YM
233There are some compile-time flags that enable experimental features.
234Please use them at your own risk after reading the corresponding
235threads in the emacs-devel@gnu.org archive.
236
237 USE_ATSUI: Enable ATSUI (Apple Type Services for Unicode Imaging)
238 support. Available on Mac OS 9/Carbon and Mac OS X.
239 http://lists.gnu.org/archive/html/emacs-devel/2005-10/msg00005.html
240
241 SELECT_USE_CFSOCKET: Avoid polling in sys_select (in src/mac.c).
242 Available on Mac OS X.
243 http://lists.gnu.org/archive/html/emacs-devel/2004-12/msg00789.html
244
47600d8e 245Enjoy!