How to compile scmxx for Windows:
===============================

There are two choices, currently:

A. mingw (for cross-compiling, see bottom of this file)
==========
1. install mingw and msys from [1].
   You neeed at least the following packages:
   mingw-runtime
   gcc-core
   binutils
   w32api
   msys
   msys-autoconf (if you install from CVS)
   mingw-utils (to convert the README file)
   
   If you install from CVS and want to get the documentation in
   HTML format, you must install xsltproc and prefered also the
   docbook-XML files.
   
   Get libiconv and gettext from [2] and [3], extract them, and
   configure, build and install them each in the following order:
   gettext, libiconv, gettext again.
   Use "./configure --prefix=/mingw" for the configure step, "make"
   for the build step and "make install" for the install step.
   Run "make uninstall clean" before compiling gettext the second time.
   
   For bluetooth support:
   Get the proper Platform SDK for your version of Windows from [5]
   and install it. You have to copy the following header files to the
   mingw32 include directory:
   bluetoothapis.h (not actually needed)
   bthdef.h
   bthsdpdef.h
   ws2bth.h
   You HAVE to make all the names lowercase if you cross-compile.

2. Run msys and read the normal INSTALL file because the rest
   is like on a normal *nix system.


3. You might also want to install InnoSetup[4] and use the
   winsetup-mingw.iss file. Prior to packaging, you must copy
   the iconv.dll and intl.dll from /mingw/bin to the local
   direcory. You also might want to convert the docs/README_WIN32.txt
   to windows style EOL character using unix2dos.exe

   As a shortcut for this step, run "make -f Makefile.dist exe". The
   InnoSetup install directory must be either in your path or you must
   set the INNODIR environmen variable to that directory.

[1]: http://www.mingw.org/
[2]: http://ftp.gnu.org/gnu/libiconv/
[3]: http://ftp.gnu.org/gnu/gettext/
[4]: http://www.jrsoftware.org/
[5]: http://www.microsoft.com/platformsdk/

B. cygwin
=========
1. install cygwin[6] with at least the following packages:

   When compiling from CVS:
   autoconf, autoconf-devel

   For building the HTML documentation:
   docbook-xsl, libxml2, libxslt

   For building gettext catalogs and support:
   gettext, gettext-devel, libgettextpo0, libintl3

   For compiling the program:
   binutils, gcc, gcc-core, gcc-mingw, gcc-mingw-core
   make
   libiconv, libiconv2 (simply reinstall those two, when getting iconv errors)
   
   (list may be incomplete)
   Currently, you cannot build the manpages because you need
   docbook2x[7] for that


2. Run the cygwin shell and read the normal INSTALL file because
   the rest is like on a normal *nix system.


3. You might also want to install InnoSetup[4] and use the
   winsetup-mingw.iss file. Prior to packaging, you must copy
   the cygwin1.dll, cygiconv-2.dll and cygintl-3.dll from /bin
   to the local direcory. You also might want to convert the
   docs/README_WIN32.txt to windows style EOL character using
   unix2dos.exe

   As a shortcut for this step, run "make -f Makefile.dist exe". The
   InnoSetup install directory must be either in your path or you must
   set the INNODIR environmen variable to that directory.


[6]: http://www.cygwin.com
[7]: http://docbook2x.sourceforge.net



Cross-compiling
===============

You can cross-compile the mingw target. Additionally to the normal
compilation, you need to install:
- the mingw cross compiler (Debian package "mingw32")
- WINE (Debian package "wine")

Use the following script for configuring for cross-compiling (it is now
used as "cross-configure"):
----------------------------snip---------------------------
#!/bin/sh
TARGET_HOST="i586-mingw32msvc"
BUILD_HOST="$(uname -m)-linux"

BASE=$(echo ~/win32)
CFLAGS="-I${BASE}/include"
LDFLAGS="-L${BASE}/lib"
export CFLAGS
export LDFLAGS

exec ./configure \
  --target=${TARGET_HOST} --host=${TARGET_HOST} --build=${BUILD_HOST} \
  --prefix=${BASE} "$@"
----------------------------snip---------------------------

Then you must compile libiconv from [2] and gettext from [3]:
- cross-configure and compile gettext and install it e.g. to ~/win32/
- cross-configure and compile libiconv and install it e.g. to ~/win32/
- clean up and uninstall gettext
- again: cross-configure and compile gettext and install it e.g. to ~/win32/

Install InnoSetup from [4] using wine to C:\Programs\Inno5
(something without spaces is easier thatn with) and install the
following script to be executable as "issc" in the path:
----------------------------snip---------------------------
#!/bin/sh
exec wine C:/Programs/Inno5/iscc "$@"
----------------------------snip---------------------------
"which iscc" should show a result (you may have to relogin).
As an alternative, you can set INNODIR to "wine C:/Programme/Inno5/".

Now cross-configure scmxx and compile.
Copy libiconv-2.dll and libintl-3.dll to the local directory.
As final step, run "make -f Makefile.dist exe".
