@section Obtaining LilyPond

You can get the latest version of LilyPond at
@uref{ftp://ftp.lilypond.org/pub/LilyPond/,
ftp://ftp.lilypond.org/pub/LilyPond/}.

@section Windows build requirements
You need the following packages to compile Lilypond on Windows.

@table @code
@item The GNU + Cygnus tools, 1.3.2 or newer.
Check out the @uref{http://sources.redhat.com/cygwin,Cygwin webpage}.
You can get the latest version of the GNU + Cygnus tools from cygnus
@uref{http://sources.redhat.com/cygwin/mirrors.html,mirror site}.
Install everything, including tetex.
@item GUILE 1.4, or newer.
Check out the @uref{http://www.gnu.org/software/guile.html,GUILE
webpage}.  You may need the patch @file{guile-1.4-gnu-windows.patch}
included in LilyPond's source distribution.
@end table

@subsection Cross compiling

These binaries are cross compiled for Windows on a GNU/Linux box.  You
may want to check out the
@uref{http://www.lilypond.org/gnu-windows/cygwin-cross.tar.gz,cross
compilation scripts}.

@subsection Compiling on Windows

Compiling on Windows should be possible, but how should we now?  If you
have any experiences you want to share, please do so at
@uref{http://lilypond.org/wiki?CompilingOnWindows,Compiling on Windows}.
Or write to one of the mailing lists.

@section Windows installation specifics

Installing LilyPond on Windows is similar to a unix installation, but
needs a number of extra tricks.  All code for these tricks can be found
in the source package directory @file{Documentation/windows}.

@table @asis
@item @var{guile-1.4-gnu-windows.patch}
You may (Cygwin gets better every day) need this patch to compile GUILE.
@item @var{cygwin-installer.patch}
Apply this patch to the @file{cinstall} directory of
@file{winsup-src/cinstall}, to get the LilyPond installer.

Compiling @file{setup.exe} has been complicated a bit with the
introduction of the non-feature bzip2.  Here's how I did it:
@quotation
@example
    mkdir cygwin-20011202 && cd cygwin-20011202
    export CVSROOT=:pserver:anoncvs@@anoncvs.cygnus.com:/cvs/src
    touch $HOME/.cvspass
    cvs login
    cvs -z3 co -D20011202 winsup
    cd src/winsup/cinstall
    patch < $HOME/usr/src/lilypond/Documentation/windows/cygwin-installer.patch
    autoconf
    cd ../bz2lib
    MINGW32=yes CFLAGS='-mno-cygwin' ./configure
    make
    cd -
    MINGW32=yes CFLAGS='-mno-cygwin' ./configure
    CYGWIN=$HOME/usr/src/cygwin/cygwin-1.3.5
    cp $CYGWIN/usr/lib/mingw/crt2.o .
    cp $HOME/usr/src/lilypond/Documentation/windows/LilyPond.ico .
    make w32api_lib=$CYGWIN/usr/lib/w32api \
        CXX="g++ -L$CYGWIN/usr/lib/mingw"
    cp -pv setup.exe $CYGWIN/dist/cygwin-1.3.5/new-setup.exe
    strip $CYGWIN/dist/cygwin-1.3.5/new-setup.exe
@end example
@end quotation
@item @var{--prefix=/usr/lilypond-x.y.x}
The standard binary installation installs LilyPond into its own prefix.
We think it's silly, but do this is on special request of Windows users.
@item @file{fix-suffixes.sh}
Add @file{.exe} to binary executables, add @file{.py} to Python scripts.
@item @file{python-wrapper.sh}
All python scripts get a wrapper script to make direct invocation easier.
@item @file{latex-wrapper.sh}
TeX and LaTeX get a wrapper script that changes the TEX path variables
to DOS style, which is needed by non-Cygwin TeX, that's currently used.
@item @file{/etc/postinstall/}
A number of post installation scripts try to set registry entries and
symlinks that are needed for the additional windows packages.
@item @file{/etc/profile.d/}
A number of login profile scripts set environment vars, every time you
start the LilyPond/Cygwin shell (or Bash, for that matter).
@end table

These scripts and tricks are known to work in some cases, but are
woefully incomplete.  If you find a bug, please send us your fix.

Windows users have indicated that a DOS style login (as supposed to the
LilyPond/Cygwin shell), would be useful.  We don't enjoy DOS scripting,
and think users should try the bash shell, which is better suited for
typing in commands.  However, if you have written useful DOS login
scripts, please send us your code.

