Skip to content

Cross-compiling to Windows #544

Description

@wintersteiger

My Windows-Emacs (26) and Flyspell told me that they want aspell 0.60 or up, so I attempted to compile my own as there is no recent binary package available. I use WSL (Windows Subsystem for Linux, Ubuntu on Windows), but this should work just as well on any Linux that has the MinGW cross-compiler in its package system. I needed one source change to make this work; in common/file_util.cpp add #include "common/asc_ctype.hpp", which I believe may be necessary on some other platforms as well?

Then:

sudo apt-get install mingw-w64 
./autogen
sed -i 's/#define PACKAGE_VERSION \".*\"/#define PACKAGE_VERSION "0.60.1"/' gen/settings.h
sed -i 's/#define VERSION \".*\"/#define VERSION "0.60.1"/' gen/settings.h
sed -i 's/#define USE_POSIX_MUTEX/\/\/#define USE_POSIX_MUTEX/' gen/settings.h
LDFLAGS="--static" ./configure --host=x86_64-w64-mingw32 --prefix $PWD/win32-install --enable-32-bit-hash-fun --enable-static --disable-shared
make
make install

This produces a working aspell.exe in ./win32-install/bin. The default configuration uses non-Windows directory strings, so a custom .aspell.conf is necessary.

I use the Linux-native binaries to compile/install dictionaries for now as I couldn't find any scripts/Makefiles that would work on Windows. Are there any existing scripts that work on Windows?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions