BUILDING LIBLOUISXML UNDER WINDOWS
by
Michel Such

This document describes how to build liblouisxml and associated tools
under Windows using the Mingw environment.

1. Prerequisites and dependencies:

Performing the steps below requires you to be familiar with a
Unix-like development environment. The one used here is Mingw, so you
first need to install the Mingw, Msys and MsysDtk packages, which you
can find at: http://www.mingw.org .

Installation of Mingw, Msys and Msysdtk is easy since they come under
the form of a classic WINDOWS install program. The packages must be
installed in the following order: Mingw, Msys and finally MsysDtk.
Mingw will install in the c:\mingw directory. When installing MSYS,
you'll be proposed to install it in the same mingw directory. Don't do
it! Replace the proposed directory by c:\msys . At the end of
installation of MSYS, you'll be asked where Mingw is installed.
Answer: c:\mingw .

By default, msys opens in a draphical interface which is not
accessible, at least not by Jaws. To tell it to use a command-line
interface, go to your msys directory, then to bin. Change the name of
rxvt.exe to something else.

You will also need to install pkg-config from:
http://pkg-config.freedesktop.org/releases/ Version 0.21 seems to be
the preferred one. Uncompress it using the command:

tar xfz pkg-config-0.21.tar.gz

This creates a directory called pkg-config-0.21

Note: the tar command comes with Mingw and should be located in
directory c:\mingw\bin or c:\msys\1.0\bin

From the MSYS prompt, changedir to pkg-config-0.21 with the command:

cd c:/pkg-config-0.21

(note the use of the '/' character instead of the '\' we generally use
under Windows).

Now, simply run the 3 following commands:

./configure --prefix=c:/mingw
make
make install

As liblouisxml depends on the liblouis and libxml2 libraries, we will
first build and install these libraries.

For convenience, we will install liblouis, libxml2 and liblouisxml in
directory c:\louis. Once the complete build process is finished, you
will be able to move this directory anywhere you want (for example in
c:\ProgramFiles\louis).

2. Installing Liblouis:

From the Liblouis site: http://www.abilitiessoft.com/ download the
latest liblouis tarball. Uncompress it using the command:

tar xfz liblouis-x.x.x.tar.gz

where x.x.x is the tarball version number used in the filename. This
creates a directory called liblouis-x.x.x

From the MSYS prompt, changedir to liblouis-x.x.x with the command:

cd c:/liblouis-x.x.x

(note the use of the '/' character instead of the '\' we generally use
under Windows).

Now, simply run the 3 following commands:

./configure --prefix=c:/louis
make
make install


3. Installing libxml2:

From the Libxml2 site: http://xmlsoft.org/ download the latest libxml2
tarball. Uncompress it using the command:

tar xfz libxml2-x.x.x.tar.gz

where x.x.x is the tarball version number used in the filename. This
creates a directory called libxml2-x.x.x

From the MSYS prompt, changedir to libxml2-x.x.x with the command:

cd c:/libxml2-x.x.x

Now, simply run the 3 following commands:

./configure --prefix=c:/louis
make
make install


4. Installing liblouisxml:

From the Liblouisxml site: http://www.abilitiessoft.com/ download the
latest liblouisxml tarball. Uncompress it using the command:

tar xfz liblouisxml-x.x.x.tar.gz

where x.x.x is the tarball version number used in the filename. This
creates a directory called liblouisxml-x.x.x

We now need to configure pkg-config a bit so it can find the
dependencies: Edit the Msys profile located in directory
c:\msys\1.0\etc add the following line at the end of the file:

export PKG_CONFIG_PATH=c:/louis/lib/pkgconfig

From the MSYS prompt, changedir to liblouisxml-x.x.x with the command:

cd c:/liblouisxml-x.x.x

Now, simply run the 3 following commands:

./configure --prefix=c:/louis --build=i686
make
make install

5. All done!

The directory c:\louis now contains all the components you need. the
bin subdirectory contains all executa les and dlls. To save some disk
space, you may apply the strip command against them as follows:

strip *.exe
strip *.dll

The strip command comes with Mingw and should be located in directory
c:\mingw\bin

If you wish to make an archive of your louis directory, which can be
used as a sort of Windows binary, do the following:

cd c:
tar cfz winlouis.tar.gz louss

This will will create the file winlouis.tar.gz, which will recreate
the louis directory and all its subdirectories wherever it is
unpacked.

