Spellchecker for Mozilla

|
Home |
Mailing List |
Installation |
Source Code |
Bugs |
Screenshots
|
Spellchecker Compiling FAQ
Last update 2003-04-09Do I have to compile all of Mozilla just to get a Spellchecker binary
-
Unfortunately, yes.
I'm trying to check out a particular release (using the -r flag with cvs), but I get errors like "user 'guest' cannot access", and the checkout fails.
This is probably because you have logged into the guest@mozdev.org cvs account with the incorrect password. Look in your ~/.cvspass file for the line containing "guest@mozdev.org" and remove that line. Then do a cvs login again. (See the spellchecker source page.)
How do I apply the patch once I've copied the spellcheck directory into the Mozilla source?
From the root of the Mozilla source, type the following command:
patch -p0 < unix-spellcheck.patch
I'm trying to compile the spellchecker with (some earlier release of mozilla), but the patch doesn't apply cleanly, or I get errors during compile
Make sure that if you are compiling for an older version that you check out the spellchecker source that was tagged for that version. For Mozilla 1.0.x through 1.2.x, get the source tagged RELEASE_1_2. For Mozilla 1.3.x, get the source tagged RELEASE_1_3. (See the spellchecker source page.)
I'm trying to compile the spellchecker with the Mozilla 1.0.x source, but when I issue the patch command, I get a bunch of errors
The files that the patch changes are slightly different in the Mozilla 1.0.x source than in later versions, and the previous version of the patch file has been lost (and no one has bothered to recreate it). So the patch doesn't apply cleanly. You will just have to examine the patch file and make the file changes manually.
How do I make an XPI from my binary?
The first thing to note is that an XPI file is just a ZIP file with the extension .xpi. What makes an XPI file special is that it contains a file named install.js, which is a JavaScript file that tells Mozilla how to install the files.
So you should create a zip file with the following files:
install.js
components/libmyspell.so
components/libspellchecker.so
components/myspell/en-US.dic
components/myspell/en-US.aff
components/spellchecker.xpt
and change the file extension to .xpi.
On Unix, this can be easily done with a command such as the
following (while in the directory containing your files):
zip -r mySpellchecker.xpi *
The easiest way to create the install.js file is to find
an existing spellchecker XPI file, extract the install.js
file, and include it in your XPI.
How do I make an RPM for the spellchecker?
The easiest way is to start with an existing source package (SRPM) (maintained by Aleksey Nogin). After installing the source package, you can build it using rpmbuild -ba mozilla-xyz.spec. Of course, you might want to customize the spec file before building.
If you want to try compiling an RPM that would be compatible with the ones mozilla.org or Red Hat provides, you need to make sure that you are using exactly the same compiler versions and configure options as they do. You should probably download their source package as well and compare the spec files. Note, that mozilla.org's packages are compiled using gcc 2.91 (see below) and Red Hat's packages are compiled with gcc 2.96, even on Red Hat 8.0, while Aleksey Nogin's RedHat 8.0 packages are built with the default gcc 3.2.
I compiled a binary for Linux, but when I install it, it doesn't work
(2003-04-09) NOTE: RedHat now seems to be compiling the RedHat 8.0 RPMs (and possibly the RedHat 7.x RPMs as well), with gcc-3.2 (which is the default gcc on Redhat 8.0). They will likely start creating RedHat 9 RPMs with whatever version of gcc comes with RedHat 9 as well.
In addition, the mozilla.org folks have talked of compiling the .tar.gz releases with gcc-2.95.3 instead of gcc-2.91.66, but they don't seem to have made that change yet.
So in short, these instructions may be outdated.
Binaries on Linux are a bit tricky. Unfortunately, there are binary incompatibilities among gcc-2.91 (default on RedHat 6.x), gcc-2.96 (default on Redhat 7.x), and gcc-3.x (default on RedHat 8.x).
The easiest way to make sure that everything is compatible is to use all Mozilla binaries (not just the spellchecker) from the same source. But if you want to create a spellchecker binary that would work with the official mozilla.org Mozilla releases, or with the official RedHat Mozilla releases, you have to make sure you are using the right compiler version.
Compiling spellchecker for mozilla.org releases of Mozilla
Mozilla.org compiles their Linux distribution on RedHat 6.2, which uses gcc-2.91. So if you are trying to install your binary with a version of Mozilla released by mozilla.org, your binary has to have been compiled with gcc-2.91
Luckily, you don't need to have RedHat 6.2 to compile your binary! You just need to install egcs-1.1.2, which you can download and compile from http://gcc.gnu.org/egcs-1.1/.
But it gets even easier! If you use RedHat 7.x (this should also
work for any other RPM-based Linux distribution), you can download
the egcs RPMs from http://rpmfind.net instead:
compat-egcs-6.2-1.1.2.16.i386.rpm
compat-egcs-c++-6.2-1.1.2.16.i386.rpm
compat-glibc-6.2-2.1.3.2.i386.rpm
compat-libs-6.2-3.i386.rpm
compat-libstdc++-6.2-2.9.0.16.i386.rpm
compat-libstdc++-devel-6.2-2.9.0.16.i386.rpm
If you downloaded and compiled egcs yourself:
Before you configure and compile the Mozilla+spellchecker source, put
the path to gcc-2.91 first in your PATH. i.e., if you installed egcs
to /usr/local/gcc291, then before you compile, type the
command
export PATH=/usr/local/gcc291/bin:$PATH.
If you installed the compat-egcs RPMs:
You now have the
commands egcs (gcc-2.91) and egcs++ (g++-2.91) in
/usr/bin. So before you compile Mozilla with the spellchecker, set
the CC and CXX environment variables:
export CC=egcs
export CXX=egcs++
A special note to RedHat 8.0 users
I noticed that
compat-libstdc++-6.2-2.9.0.16 conflicts with
compat-libstdc++-7.3-2.96-110. It turns out that if you have
compat-libstdc++-7.3-2.96-110 installed, then
compat-libstdc++-6.2-2.9.0.16 is not required. But
you will have to use rpm --nodeps when installing
compat-egcs-c++-6.2-1.1.2.16.i386.rpm.
Compiling spellchecker for RedHat releases of Mozilla
The Mozilla RPMs that RedHat releases are built with gcc 2.96. If
you are using RedHat 7.x, you should be able to build the spellchecker
with your default gcc and it will work with RedHat Mozilla releases.
RedHat 8.0 comes with gcc 3.2, so you will need to get the following
gcc 2.96 packages from http://rpmfind.net:
compat-gcc-7.3-2.96.110.i386.rpm
compat-gcc-c++-7.3-2.96.110.i386.rpm
compat-libstdc++-7.3-2.96.110.i386.rpm
compat-libstdc++-devel-7.3-2.96.110.i386.rpm
You now have the commands gcc296 and g++296 in
/usr/bin. So before you compile Mozilla with the
spellchecker, set the CC and CXX environment
variables:
export CC=gcc296
export CXX=g++296