First download and install Cygwin (http://cygwin.com/setup.exe), installing packages listed below in addition to standard development ones such as make, sed, bash, etc. I personally, install absolutely all the packages available from my local cygwin mirror. I use cygwin (and the cygwin mingw package) because cygwin packages are more up to date than msys ones. In the list below, software marked with * are probably not available in cygwin (gnuwin32 packages are marked with @), everything else is, so its best to use it. Where possible, I've indicated what to download (inc versions I used) and what to do to make non-cygwin stuff available during the build. For downloading the source code and other software, you'll need wget. For unpacking the source code, you'll need tar, gzip, bzip2 and unzip. For adding the xchm icons to the exe, you'll need png2ico* and imagemagick to convert xpm to png (you can use anything for this, inc IrfanView or even Win32 Gimp). For compressing the resulting exe, you will need upx. For image support, you'll need to download the developer stuff for zlib@, libpng@, libjpeg@, libtiff@ and libgw32c@ from the gnuwin32 project. Please report any problems you find to the xchm mailing list rather than the bug tracking system, since problems are more likely to be my fault. Of course, if you find the same problem under your GNU/Linux build, please feel free to use the BTS. Run the following script from the cygwin shell (updating wget lines for newer software): export BUILD_LOCATION=/h/home/pabs/devel/xchm # FOR EXAMPLE cd $BUILD_LOCATION wget -c http://heanet.dl.sourceforge.net/sourceforge/libunicows/libunicows-1.1.1-mingw32.zip wget -c http://www.winterdrache.de/freeware/png2ico/data/png2ico-win-2002-12-08.zip wget -c http://heanet.dl.sourceforge.net/sourceforge/gnuwin32/libpng-1.2.8-lib.zip wget -c http://heanet.dl.sourceforge.net/sourceforge/gnuwin32/tiff-3.7.4-lib.zip wget -c http://heanet.dl.sourceforge.net/sourceforge/gnuwin32/libjpeg-6b-lib.zip wget -c http://heanet.dl.sourceforge.net/sourceforge/gnuwin32/zlib-1.2.3-lib.zip wget -c http://heanet.dl.sourceforge.net/sourceforge/gnuwin32/libgw32c-0.4-lib.zip wget -c http://heanet.dl.sourceforge.net/sourceforge/wxwindows/wxMSW-2.6.2.zip wget -c http://66.93.236.84/~jedwin/projects/chmlib/chmlib-0.37.4.tbz wget -c http://heanet.dl.sourceforge.net/sourceforge/xchm/xchm-1.2.tar.gz export PREFIX="$BUILD_LOCATION/install" export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal/" export LDFLAGS="-L$PREFIX/lib -mno-cygwin -mwindows" export CPPFLAGS="-I$PREFIX/include -mno-cygwin -mwindows" export CFLAGS="-I$PREFIX/include -mno-cygwin -mwindows" export CXXFLAGS="-I$PREFIX/include -mno-cygwin -mwindows" export PATH="$PREFIX/bin:$PATH" mkdir -p install/bin install/include install/lib install/share/aclocal install/share/doc unzip -o libunicows-*-mingw32.zip cp -f libunicows-*-mingw32/libunicows.a $PREFIX/lib unzip -o png2ico-win-*.zip cp png2ico/png2ico.exe $PREFIX/bin cd install && unzip -o ../libpng-*-lib.zip && cd .. cd install && unzip -o ../tiff-*-lib.zip && cd .. cd install && unzip -o ../libjpeg-*-lib.zip && cd .. cd install && unzip -o ../zlib-*-lib.zip && cd .. cd install && unzip -o ../libgw32c-*-lib.zip && cd .. unzip -o wxMSW-*.zip cd wxWidgets*/ ./configure --disable-precomp-headers --enable-unicode --enable-static --disable-shared --disable-debug_flag --disable-debug_info --with-msw --enable-optimise --prefix=$PREFIX --enable-treectrl --enable-universal make make install cd .. tar jxf chmlib-*.tbz cd chmlib-*/ CFLAGS="-DWIN32 $CFLAGS" CXXFLAGS="-DWIN32 $CXXFLAGS" LDFLAGS="-DWIN32 $LDFLAGS" ./configure --enable-static --disable-shared --prefix=$PREFIX sed -i -e 's/__int64/long long/gi' src/chm_lib.h sed -i -e 's/#elif defined(WIN32)/#endif\ #if defined(WIN32)/gi' src/chm_lib.c make make install cd .. export XCHM_VERSION=`ls xchm-*.tar.gz | sed -e 's/^xchm-\([0-9.]*\)\.tar.gz/\1/gi'` tar zxf xchm-*.tar.gz CFLAGS="-DWIN32 $CFLAGS" CXXFLAGS="-DWIN32 $CXXFLAGS" LDFLAGS="-DWIN32 wxrc.o $LDFLAGS" ./configure --enable-static --disable-shared --prefix=$PREFIX make cd src strip src/xchm.exe upx src/xchm.exe clean: cd $BUILD_LOCATION rm -rf install libunicows-*-mingw32/ png2ico/ wxWidgets*/ chmlib-*/ xchm-*/