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