Following on from work enabling native spell checking on MacOSX, I've been searching for a spell checking engine or method for Wx on Windows. There are a few CPAN modules available but I kept coming back to Text::Aspell.
Aspell is pretty much universally available on Linux distributions and seems to be easily built on the Mac. It has a widely usable license in LGPL 2.1 so might provide the solution I need. Windows support is different though with the last 'recognised' Windows port dating back to December 2002. If I could build the current stable Aspell on Windows it would give me solutions to my spell checking requirements on all platforms. Mailing lists and support forums suggested there are quite a few source changes needed to compile natively on Windows. (assuming you don't count Cygwin / MSYS as native).
I took a look again at the forked gcc compiler for windows,
mingw-w64. I've used this to provide 64bit PPMs of Perl modules building natively on a Windows x64 machine. This compiler also provides cross compilers for Linux hosts targeting both 64 and 32 bit Windows binaries.
Installing the mingw-w64 cross compilers on Linux was as simple as the Windows versions. Just extract the tar-ball to a directory and add the contained bin directory to your path. I initially had some difficulty as my standard Linux build environment is CentOS 5 (a RHEL5 'equivalent'). This comes with some static versions of libraries that prevent (or at least prevented me) using the cross compilers. Switching to a different distribution solved these problems (I used Debian).
Once I had a usable Linux distribution, there were just minor changes needed to the source. As with most Linux builds, the install location is hard coded in the binaries by the Aspell build process. This is not practically usable in a Windows environment so some code is added to locate the binaries at runtime. There was just a single #include that needed to be added in the rest of the source code to get a working build of Aspell for both 32 and 64 bit Windows.
I've made these Aspell builds available as part of the Text::Aspell PPM module available in the repository. You can also get a standalone install plus patches, source and build scripts from the
Aspell Page.
The last thing to do was enabling builds of Aspell dictionaries. Normally this is done via './configure' on Linux platforms but there is really no need for any compiler to be present to carry out the installation. I created an install script to parse the dictionary bundles and run the necessary install commands, then packaged this as an executable for my binary distribution.
That, I think, is my spell checking requirements taken care of. I can offer a common solution across all platforms and then perhaps add in support for switching to 'native' solutions if available and required.