Imported Upstream version 0.60.7
[platform/upstream/aspell.git] / README
1 Appendix A Installing
2 *********************
3
4 Aspell requires gcc 2.95 (or better) as the C++ compiler.  Other C++
5 compilers should work with some effort.  Other C++ compilers for mostly
6 POSIX compliant (Unix, Linux, BeOS, Cygwin) systems should work without
7 any major problems provided that the compile can handle all of the
8 advanced C++ features Aspell uses.  C++ compilers for non-Unix systems
9 might work but it will take some work.  Aspell at very least requires a
10 Unix-like environment ('sh', 'grep', 'sed', 'tr', ...), and Perl in
11 order to build.  Aspell also uses a few POSIX functions when necessary.
12
13    The latest version can always be found at GNU Aspell's home page at
14 <http://aspell.net>.
15
16 A.1 Generic Install Instructions
17 ================================
18
19      ./configure && make
20
21    For additional 'configure' options type './configure --help'.  You
22 can control what C++ compiler is used by setting the environment
23 variable 'CXX' before running configure and you can control what flags
24 are passed to the C++ compile via the environment variable 'CXXFLAGS'.
25 Static libraries are disabled by default since static libraries will not
26 work right due to the mixing of C and C++.  When a C program links with
27 the static libraries in Aspell it is likely to crash because Aspell's
28 C++ objects are not getting initialized correctly.  However, if for some
29 reason you want them, you can enable them via '--enable-static'.
30
31    Aspell should then compile without any additional user intervention.
32 If you run into problems please first check the sections below as that
33 might solve your problem.
34
35    To install the program simply type
36
37      make install
38
39    After Aspell is installed at least one dictionary needs to be
40 installed.  You can find them at <http://aspell.net/>.  The 'aspell'
41 program must be in your path in order for the dictionaries to install
42 correctly.
43
44    If you do not have Ispell or the traditional Unix 'spell' utility
45 installed on your system then you should also copy the compatibility
46 scripts 'ispell' and 'spell' located in the 'scripts/' directory into
47 your binary directory which is usually '/usr/local/bin' so that programs
48 that expect the 'ispell' or 'spell' command will work correctly.
49
50 A.2 HTML Manuals and 'make clean'
51 =================================
52
53 The Aspell distribution includes HTML versions of the User and
54 Developer's manual.  Unfortunately, doing a 'make clean' will erase
55 them.  This is due to a limitation of automake which is not easily
56 fixed.  If makeinfo is installed they can easily be rebuild with 'make
57 aspell.html aspell-dev.html', or you can unpack them from the tarball.
58
59 A.3 Curses Notes
60 ================
61
62 If you are having problems compiling 'check_funs.cpp' then the most
63 likely reason is due to incompatibilities with the curses implementation
64 on your system.  You should first try disabling the "wide" curses
65 library with the '--disable-wide-curses' configure option.  By doing so
66 you will lose support for properly displaying UTF-8 characters but you
67 may still be able to get the full screen interface.  If this fails then
68 you can disable curses support altogether with the '--disable-curses'
69 configure option.  By doing this you will lose the nice full screen
70 interface but hopefully you will be able to at least get Aspell to
71 compile correctly.
72
73    If the curses library is installed in a non-standard location then
74 you can specify the library and include directory with
75 '--enable-curses=LIB' and '--enable-curses-include=DIR'.
76
77    'LIB' can either be the complete path of the library--for example
78      /usr/local/curses/libcurses.a
79    or the name of the library (for example 'ncurses') or a combined
80 location and library in the form '-LLIBDIR -lLIB' (for example
81 '-L/usr/local/ncurses/lib -lncurses').
82
83    DIR is the location of the curses header files (for example
84 '/usr/local/ncurses/include').
85
86 A.3.1 Unicode Support
87 ---------------------
88
89 In order for Aspell to correctly spell check UTF-8 documents in full
90 screen mode the "wide" version of the curses library must be installed.
91 This is different from the normal version of curses library, and is
92 normally named 'libcursesw' (with a 'w' at the end) or 'libncursesw'.
93 UTF-8 documents will not display correctly without the right curses
94 version installed.
95
96    In addition your system must also support the 'mblen' function.
97 Although this function was defined in the ISO C89 standard (ANSI
98 X3.159-1989), not all systems have it.
99
100 A.4 Loadable Filter Notes
101 =========================
102
103 Support for being able to load additional filter modules at run-time has
104 only been verified to work on Linux platforms.  If you get linker errors
105 when trying to use a filter, then it is likely that loadable filter
106 support is not working yet on your platform.  Thus, in order to get
107 Aspell to work correctly you will need to avoid compiling the filters as
108 individual modules by using the '--enable-compile-in-filters' when
109 configuring Aspell with './configure'.
110
111 A.5 Using 32-Bit Dictionaries on a 64-Bit System
112 ================================================
113
114 Due to an oversight, Aspell compiled dictionaries not only depend on the
115 endian order, they also depend on the the size of the 'size_t' type,
116 which is generally different on 32 and 64-bit systems.  The 'size_t'
117 type is used in the hash function of the compiled dictionaries.  To
118 force the hash function to use a 32-bit integer instead, use the
119 '--enable-32-bit-hash-fun' configure option.  This option will allow you
120 to use dictionaries compiled on a 32-bit machine on a 64-bit one as long
121 as the endian order is the same.  Of course, dictionaries compiled on a
122 64-bit machine without this option enabled will no longer be usable.  If
123 Aspell detects that an incompatible hash function is used, it will fail
124 with:
125      Error: The file "SOME-FILE" is not in the proper format.
126      Incompatible hash function.
127
128 A.6 Upgrading from Aspell 0.50
129 ==============================
130
131 The dictionary format has changed so dictionaries will need to be
132 recompiled.
133
134    All data, by default, is now included in 'LIBDIR/aspell-0.60' so that
135 multiple versions of Aspell can more peacefully coexist.  This included
136 both the dictionaries and the language data files which were stored in
137 'SHAREDIR/aspell' before Aspell 0.60.
138
139    The format of the character data files has changed.  The new
140 character data files are installed with Aspell so you should not have to
141 worry about it unless you made a custom one.
142
143    The dictionary option 'strip-accents' has been removed.  For this
144 reason the old English dictionary (up to 0.51) will no longer work.  A
145 new English dictionary is now available which avoids using this option.
146 In addition the 'ignore-accents' option is currently unimplemented.
147
148    The flag '-l' is now a shortcut for '--lang', instead of '--list' as
149 it was with Aspell 0.50.
150
151 A.6.1 Binary Compatibility
152 --------------------------
153
154 The Aspell 0.60 library is binary compatible with the Aspell 0.50
155 library.  For this reason I chose _not_ to increment the major version
156 number (so-name) of the shared library by default which means programs
157 that were compiled for Aspell 0.50 will also work for Aspell 0.60.
158 However, this means that having both Aspell 0.50 and Aspell 0.60
159 installed at the same time can be pragmatic.  If you wish to allow both
160 Aspell 0.50 and 0.60 to be installed at the same time then you can use
161 the configure option '--incremented-soname' which will increment
162 so-name.  You should only use this option if you know what you are
163 doing.  It is up to you to somehow ensure that both the Aspell 0.50 and
164 0.60 executables can coexist.
165
166    If after incrementing the so-name you wish to allow programs compiled
167 for Aspell 0.50 to use Aspell 0.60 instead (thus implying that Aspell
168 0.50 is not installed) then you can use a special compatibility library
169 which can be found in the 'lib5' directory.  This directory will not be
170 entered when building or installing Aspell so you must manually build
171 and install this library.  You should build it after the rest of Aspell
172 is built.  The order in which this library is installed, with relation
173 to the rest of Aspell, is also important.  If it is installed _after_
174 the rest of Aspell then new programs will link to the old library (which
175 will work for Aspell 0.50 or 0.60) when built, if installed _before_,
176 new programs will link with the new library (Aspell 0.60 only).
177
178 A.7 Upgrading from Aspell .33/Pspell .12
179 ========================================
180
181 Aspell has undergone an extremely large number of changes since the
182 previous Aspell/Pspell release.  For one thing Pspell has been merged
183 with Aspell so there in no longer two separate libraries you have to
184 worry about.
185
186    Because of the massive changes between Aspell/Pspell and Aspell 0.50
187 you may want to clean out the old files before installing the the new
188 Aspell.  To do so do a 'make uninstall' in the original Aspell and
189 Pspell source directories.
190
191    The way dictionaries are handled has also changed.  This includes a
192 change in the naming conventions of both language names and
193 dictionaries.  Due to the language name change, your old personal
194 dictionaries will not be recognized.  However, you can import the old
195 dictionaries by running the 'aspell-import' script.  This also means
196 that dictionaries designed to work with older versions of Aspell are not
197 likely to function correctly.  Fortunately new dictionary packages are
198 available for most languages.  You can find them off of the Aspell home
199 page at <http://aspell.net>.
200
201    The Pspell ABI is now part of Aspell except that the name of
202 everything has changed due to the renaming of Pspell to Aspell.  In
203 particular please note the following name changes:
204
205      pspell -> aspell
206      manager -> speller
207      emulation -> enumeration
208      master_word_list -> main_word_list
209
210    Please also note that the name of the 'language-tag' option has
211 changed to 'lang'.  However, for backward compatibility the
212 'language-tag' option will still work.
213
214    However, you should also be able to build applications that require
215 Pspell with the new Aspell as a backward compatibility header file is
216 provided.
217
218    Due to a change in the way dictionaries are handled, scanning for
219 '.pwli' files in order to find out which dictionaries are available will
220 no longer work.  This means that programs that relied on this technique
221 may have problems finding dictionaries.  Fortunately, GNU Aspell now
222 provided a uniform way to list all installed dictionaries via the c API.
223 See the file 'list-dicts.c' in the 'examples/' directory for an example
224 of how to do this.  Unfortunately there isn't any simple way to find out
225 which dictionaries are installed which will work with both the old
226 Aspell/Pspell and the new GNU Aspell.
227
228 A.8 Upgrading from a Pre-0.50 snapshot
229 ======================================
230
231 At the last minute I decided to merge the 'speller-util' program into
232 the main 'aspell' program.  You may wish to remove that 'speller-util'
233 program to avoid confusion.  This also means that dictionaries designed
234 to work with the snapshot will no longer work with the official release.
235
236 A.9 WIN32 Notes
237 ===============
238
239 A.9.1 Getting the WIN32 version
240 -------------------------------
241
242 The latest version of the native Aspell/WIN32 port, including binaries,
243 can be found at <http://aspell.net/win32>.  This page has,
244 unfortunately, not been updated for Aspell 0.60.  If you are interested
245 in updated the native port please let me know.
246
247 A.9.2 Building the WIN32 version
248 --------------------------------
249
250 There are two basically different ways of building Aspell using GCC for
251 WIN32: You can either use the Cygwin compiler, which will produce
252 binaries that depend on the POSIX layer in 'cygwin1.dll'.  The other way
253 is using MinGW GCC, those binaries use the native C runtime from
254 Microsoft (MSVCRT.DLL).
255
256 A.9.2.1 Building Aspell using Cygwin
257 ....................................
258
259 This works exactly like on other POSIX compatible systems using the
260 './configure && make && make install' cycle.  Some versions of Cygwin
261 GCC will fail to link, this is caused by an incorrect 'libstdc++.la' in
262 the '/lib' directory.  After removing or renaming this file, the build
263 progress should work (GCC-2.95 and GCC-3.x should work).
264
265 A.9.2.2 Building Aspell using MinGW
266 ...................................
267
268 There are several different ways to build Aspell using MinGW. The
269 easiest way is to use a Cygwin compiler but instruct it to build a
270 native binary rather than a Cygwin one.  To do this configure with:
271
272      ./configure CFLAGS='-O2 -mno-cygwin' CXXFLAGS='-O2 -mno-cygwin'
273
274    You may also want to add the option '--enable-win32-relocatable' to
275 use more windows friendly directories.  *Note Win32-Directories::.  In
276 this case configure with:
277
278      ./configure CFLAGS='-O2 -mno-cygwin' CXXFLAGS='-O2 -mno-cygwin' --enable-win32-relocatable
279
280    It should also be possible to build Aspell using the MSYS
281 environment.  But this has not been very well tested.  If building with
282 MSYS _do not_ add 'CFLAGS ...' to configure.
283
284 A.9.2.3 Building Aspell without using Cygwin or MSYS
285 ....................................................
286
287 It is also possible to build Aspell without Cygwin of MinGW by using the
288 files in the 'win32/' subdirectory.  However, these files have not been
289 updated to work with Aspell 0.60.  Thus the following instructions will
290 not work without some effort.  If you do get Aspell to compile this way
291 please send me the updated files so that I can include them with the
292 next release.
293
294    To compile Aspell with the MinGW compiler, you will need at least
295 GCC-3.2 (as shipped with MinGW-2.0.3) and some GNU tools like 'rm' and
296 'cp'.  The origin of those tools doesn't matter, it has shown to work
297 with any tools from MinGW/MSys, Cygwin or Linux.  To build Aspell, move
298 into the 'win32' subdirectory and type 'make'.  You can enable some
299 additional build options by either commenting out the definitions at the
300 head of the Makefile or passing those values as environment variables or
301 at the 'make' command line.  Following options are supported:
302
303 'DEBUGVERSION'
304      If set to "1", the binaries will include debugging information
305      (resulting in a much bigger size).
306
307 'CURSESDIR'
308      Enter the path to the pdcurses library here, in order to get a
309      nicer console interface (see below).
310
311 'MSVCLIB'
312      Enter the filename of MS 'lib.exe' here, if you want to build
313      libraries that can be imported from MS Visual C++.
314
315 'WIN32_RELOCATABLE'
316      If set to "1", Aspell will detect the prefix from the path where
317      the DLL resides (see below for further details).
318
319 'TARGET'
320      Sets a prefix to be used for cross compilation (e.g.
321      '/usr/local/bin/i586-mingw32msvc-' to cross compile from Linux).
322
323    There are also a MinGW compilers available for Cygwin and Linux, both
324 versions are able to compile Aspell using the prebuilt 'Makefile'.
325 While the Cygwin port automatically detects the correct compiler, the
326 Linux version depends on setting the 'TARGET' variable in the 'Makefile'
327 (or environment) to the correct compiler prefix.
328
329    Other compilers may work.  There is a patch for MS Visual C++ 6.0
330 available at <ftp://ftp.gnu.org/gnu/aspell>, but it needs a lot of
331 changes to the Aspell sources.  It has also been reported that the Intel
332 C++ compiler can be used for compilation.
333
334 A.9.3 (PD)Curses
335 ----------------
336
337 In order to get the nice full screen interface when spell checking
338 files, a curses implementation that does not require Cygwin is required.
339 The PDCurses (<http://pdcurses.sourceforge.net>) implementation is known
340 to work, other implementations may work however they have not been
341 tested.  See the previous section for information on specifying the
342 location of the curses library and include file.
343
344    Curses notes:
345
346    * PDcurses built with MinGW needs to be compiled with
347      '-DPDC_STATIC_BUILD' to avoid duplicate declaration of 'DllMain'
348      when compiling 'aspell.exe'.
349
350    * The curses enabled version can cause trouble in some shells (MSys
351      'rxvt', 'emacs') and will produce errors like 'initscr() LINES=1
352      COLS=1: too small'.  Use a non-curses version for those purposes.
353
354 A.9.4 Directories
355 -----------------
356
357 If Aspell is configured with '--enable-win32-relocatable' or compiled
358 with 'WIN32_RELOCATABLE=1' when using a Makefile, it can be run from any
359 directory: it will set 'PREFIX' according to its install location
360 (assuming it resides in 'PREFIX\\bin').  Your personal wordlists will be
361 saved in the 'PREFIX' directory with their names changed from
362 '.aspell.LANG.*' to 'LANG.*' (you can override the path by setting the
363 'HOME' environment variable).
364
365 A.9.5 Installer
366 ---------------
367
368 The installer registers the DLLs as shared libraries, you should
369 increase the reference counter to avoid the libraries being uninstalled
370 if your application still depends on them (and decrease it again when
371 uninstalling your program).  The reference counters are located under:
372      HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs
373
374    The install location and version numbers are stored under
375
376      HKLM\SOFTWARE\Aspell
377
378 A.9.6 WIN32 consoles
379 --------------------
380
381 The console uses a different encoding than GUI applications, changing
382 this to to a Windows encoding (e.g.  1252) is not supported on Win9x/Me.
383 On WinNT (and later) those codepages can be set by first changing the
384 console font to 'lucida console', then changing the codepage using 'chcp
385 1252'.
386
387    Some alternative shells (e.g.  MSys' 'rxvt' or Cygwin's 'bash') do a
388 codepage conversion (if correctly set up), so running Aspell inside
389 those shells might be a workaround for Win9x.