Obtaining LilyPond
==================

You can get the latest version of LilyPond at ftp://ftp.lilypond.org/pub/LilyPond/.

Windows build requirements
==========================

You need the following packages to compile Lilypond on Windows.

The GNU + Cygnus tools, 1.3.6 or newer.
     Check out the Cygwin webpage (http://sources.redhat.com/cygwin). You can get the latest version of the GNU + Cygnus tools from cygnus mirror site (http://sources.redhat.com/cygwin/mirrors.html). Install everything, including tetex and texmf.

GUILE 1.4, or newer.
     Check out the GUILE webpage (http://www.gnu.org/software/guile.html).  You may need the patch guile-1.4-gnu-windows.patch included in LilyPond's source distribution.

Cross compiling
---------------

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

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 Compiling on Windows (http://lilypond.org/wiki?CompilingOnWindows). Or write to one of the mailing lists.

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 Documentation/windows.

GUILE-1.4-GNU-WINDOWS.PATCH
     You may (Cygwin gets better every day) need this patch to compile GUILE.

CYGWIN-INSTALLER.PATCH
     Apply this patch to the setup directory of cygwin-apps/setup, to get the LilyPond installer.

     Compiling setup.exe has been complicated a bit with the introduction of the bzip2 feature.  Here's how I did it:

                   CYGWIN=$HOME/usr/src/cygwin/cygwin-1.3.10 # where your cygwin lives
                   cd $CYGWIN
                   wget ftp://ftp.sf.net/pub/sourceforge/mingw/gcc-2.95.3-20010828.tar.gz
                   wget ftp://ftp.sf.net/pub/sourceforge/mingw/w32api-1.4.tar.gz
                   mkdir -p usr/mingw
                   cd usr/mingw
                   tar xzf ../../gcc-2.95.3-20010828.tar.gz
                   tar xzf ../../w32api-1.4.tar.gz
                   cd ../..
                   rm -f linux-x-cygwin/usr/lib/mingw
                   ln -s ../../../usr/mingw/lib linux-x-cygwin/usr/lib/mingw
                   rm -f linux-x-cygwin/usr/include/mingw
                   ln -s ../../../usr/mingw/include linux-x-cygwin/usr/include/mingw
                   cp usr/lib/mingw/crt2.o linux-x-cygwin/usr/lib/mingw

                   cd $HOME/usr/src
                   export CVSROOT=:pserver:anoncvs@anoncvs.cygnus.com:/cvs/cygwin-apps
                   touch $HOME/.cvspass
                   cvs login
                   cvs -z3 -r setup-200206 setup
                   cd setup
                   patch < $HOME/cvs/lilypond/Documentation/windows/cygwin-installer.patch
                   cp $HOME/cvs/lilypond/Documentation/windows/LilyPond.ico .
                   CPPFLAGS="-I$CYGWIN/usr/include/mingw \
                               -I$CYGWIN/usr/mingw/mingw32/include \
               		-I$CYGWIN/usr/mingw/include/g++-3" \
               		CFLAGS='-mno-cygwin' \
               		CXXFLAGS='-mno-cygwin' \
               		LDFLAGS="-L$CYGWIN/usr/lib/mingw \
               		-L$CYGWIN/usr/mingw/lib/gcc-lib/mingw32/2.95.3-6/" \
                	./configure  --host=i686-pc-mingw32 \
               	--disable-shared --enable-dependencies --enable-maintainer-mode
                   make WINDRES="windres --include-dir $CYGWIN/usr/include/w32api"
                   cp -pv setup.exe $CYGWIN/dist/cygwin-1.3.10/new-setup.exe
                   strip $CYGWIN/dist/cygwin-1.3.10/new-setup.exe

--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.

fix-suffixes.sh
     Add .exe to binary executables.

/etc/postinstall/
     A post installation script that updates a symlink.

/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).

These scripts and tricks are known to work, but may be 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.  It really helps a lot and pays off to read some introduction to this Bash shell.  However, if you have written useful DOS login scripts, please send us your code.