Building LProf using MinGW on Windows

Getting needed libraries:

Qt4

It is strongly recommended that you obtain the latest pre-built qt4 open source
edition binary installer from TrollTech. These builds are known to work reliably
and are widely tested. Additionally, they can download and install MinGW for you,
so you don't need to do that as a separate step.

If you have msys installed, make sure that the msys directory is not on your PATH.


tiff, jpeg, png and zlib:

Many binary packages of libraries needed to build LProf can
be found here:

http://sourceforge.net/project/showfiles.php?group_id=7382

These include:

libtiff
libjpeg
libpng
zlib

With these packages you do not have to build these libraries
some of which are a real pain to build on a Windows machine. So
using these is a real time saver and stress reducer.

The installation routines for these libraries allow them to be 
installed in the same location and this is likely the best
way to do this.

VIGRA:

You will need to get the VIGRA sources and build them.  I found 
that they were an easy build with msys installed along side mingw.
In addition is was a quick build.  At the msys command prompt:

./configure --prefix=<LIBS>

You should set --prefix to the same location you used to 
install your other libaries. 

then:

make
make install  

Libusb:

Download and install the binary.  It will put the dll in the correct 
system location and it will also have the needed include and library
files.  Move include/ubs.h to the location you created for header files and 
move lib/gcc/libusb.a to either the MinGW lib directory or the same lib 
directory where you installed libraries in the above steps.  

Windows Server 2003 Driver Developer Kit

Download it from here http://www.microsoft.com/whdc/devtools/ddk/default.mspx .  

This is an ISO image that you need to burn into a CD before you can 
install it.

All of the documentation I found for this was of very poor quality.  I also 
found that the batch file that is part of this that should setup the environement
has problems.  So there is a batch file included here named setupDDK.bat.  Use it
like this:

setupddk <path to root of DDK directory>

For my installation using the Windows Server 2003 DDK this path is:

d:\WINDDK\3790.1830

So to use this I would do the following:

setupddk d:\winddk\3790.1830

This will correctly setup the library and include paths that are needed to
build LProf with HID support.  This will build with support for all versions
of Windows starting with Windows 2000. 

Setting Up the Build Environement:

Select a location for your non-MinGW and non-Qt header and library files.  
The Windows parts of the build assume that these are all in one location.
That is that these are subdirectories locationed in the same branch of 
the directory tree.  For example, you might create a directory on your C: 
drive named lprof-libs which has a lib and an include directory.  In those 
directories place all of the header and library files for the non-Qt
libraries listed above.

To make the build work you will need to set four environment variables:

QTDIR will point to your Qt environment.

MINGW will point to the root of the MinGW directory tree.

MINGW2 will point to the location you setup for libraries above. 

HOME will also need to be set.  It's actual value does not matter.  
     It just needs to be set but you might try setiting it to:
     
     %HOMEDRIVE%%HOMEPATH%

Other tools:

You will need to install python and scons. Get the Windows binary installs
from both projects web sites and install them.

PATH settings:

You will need to have the following in your path 

%QTDIR/bin 
%MINGW/bin
python needs to be in your path but the installation should take care of this.
As an option 
msys/1.0/bin should be in your path if you are using msys

NSIS

NSIS is used to create a binary installer for LProf.  There are a number of NSIS 
files located in the root of the LProf source tree.  The base file is lprof.nsi.

These files assume that lprof is built in the default locate which is build/win32
on a Windows system.  It also assumes that there is a directory named 
build/win32/extern that contains all of the needed libraries and other external 
executables.  You will need to create this by hand and it needs to have the 
following files:

From the Qt4 bin directory:

Qt3Support4.dll 
QtNetwork4.dll 
assistant.exe 
QtAssistantClient4.dll  
QtSql4.dll 
mingwm10.dll
QtCore4.dll 
QtSvg4.dll 
QtGui4.dll 
QtXml4.dll

From other places:

libtiff3.dll
libusb0.dll
jpeg62.dll 
libpng13.dll
zlib1.dll

Once this is setup you can just compile lprof.nsi with the NSIS compiler and it
will create a Windows binary installer for LProf.

