--------------------------------------------------------
libjpeg.lib:
1. download jpegsrc.v6b.tar.gz
2. extract
3. in the extracted folder, copy jconfig.vc to jconfig.h
4. Edit makefile.vc to add these flags:
    CFLAGS= $(cflags) $(cdebug) $(cvars) -I. /Ox /GL /Gy
    LDFLAGS= $(ldebug) $(conlflags) /OPT:REF /OPT:ICF /LTCG

5. nmake nodebug=1 /f makefile.vc
6. Copy resulting libjpeg.lib to ..\utils

--------------------------------------------------------
zlib: (needed by libpng)
1. download zlib-1.2.3.tar.gz
2. extract. Rename extracted folder to zlib.
3. open zlib/projects/visualc6/zlib.dsw in MS Visual C++ Express Edition.
4. In project settings, select LIB release configuration.
5. enable link-time code generation and Full Optimization
6. Add include path for windows.h to RC command line, if required.
7. Build.
8. Copy resulting zlib.lib file to zlib folder.
9. Copy zlib.lib, zconf.h, and zlib.h to utils folder.

-------------------------------------------------------
libpng:
1. download libpng-1.2.22
2. extract, rename to libpng.
4. copy scripts/makefile.vcwin32 to libpng.
5. Edit these lines to add extra parameters
    CFLAGS  = -nologo -DPNG_NO_MMX_CODE -MT -Ox -W3 -I..\zlib /GL /Gy
    LDFLAGS = -nologo /OPT:REF /OPT:ICF /LTCG


------------------------------------------------------
1. Download and extract pixman-0.10.0. Rename to pixman (This step is needed
for cairo later on)
2. go to pixman/pixman
3. Edit Makefile.win32
4. Change the CFLAGS line as follows, replacing /MD with /MT and adding -Ox -Gy
-GL. Change LINK line as follows. 

CFLAGS     = -MT -Ox /GL /Gy -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
LINK = link /OPT:REF /OPT:ICF /LTCG

Change @mkdir -p $(CFG) to:
-@mkdir $(CFG)

5. ..\..\tools\make -f Makefile.win32 CFG=release MMX=1

6. Output files are:
pixman\release\pixman-1.lib
pixman\pixman.h
pixman\pixman-version.h

------------------------------------------------------
expat

------------------------------------------------------
fontconfig

------------------------------------------------------
1. download freetype-2.3.6.tar.gz
2. Extract and rename the folder to freetype.

-----------------------------------------------------
libcairo:
1. download cairo-1.6.4.tar.gz
2. extract
3. Place this file as cairo-1.6.4/src/cairo-features.h:
#ifndef CAIRO_FEATURES_H
#define CAIRO_FEATURES_H

#if defined(__cplusplus) && !defined(LIBCAIRO_EXPORTS)
# define CAIRO_BEGIN_DECLS  extern "C" {
# define CAIRO_END_DECLS    }
#else
# define CAIRO_BEGIN_DECLS
# define CAIRO_END_DECLS
#endif

/*
#ifndef cairo_public
    #ifdef LIBCAIRO_EXPORTS
        #define cairo_public __declspec(dllexport)
    #else
        #define cairo_public __declspec(dllimport)
    #endif
#endif
*/
#define cairo_public

#define CAIRO_VERSION_MAJOR 1
#define CAIRO_VERSION_MINOR 5
#define CAIRO_VERSION_MICRO 3

#define CAIRO_VERSION_STRING "1.5.3"

#define HAVE_WINDOWS_H 1

#define CAIRO_HAS_SVG_SURFACE 1
#define CAIRO_HAS_PDF_SURFACE 1
#define CAIRO_HAS_PS_SURFACE 1
#define CAIRO_HAS_WIN32_SURFACE 1
#define CAIRO_HAS_WIN32_FONT 1
#define CAIRO_HAS_PNG_FUNCTIONS 1

#define PACKAGE_NAME "cairo"
#define PACKAGE_TARNAME "cairo"
#define PACKAGE_STRING "cairo 1.5.3"

#endif

4. Change Makefile.win32:
@mkdir -p $(CFG) 
to:
-@mkdir  $(CFG)

Change 
DEFAULT_CFLAGS = -MT -nologo $(OPT)

to:
DEFAULT_CFLAGS = -MD /GL /Gy /Ox -nologo

Change
LINK := link
to:
LINK := link /OPT:REF /OPT:ICF /LTCG

5. Change src/Makefile.win32:
all: inform $(CFG)/cairo.dll $(CFG)/cairo-static.lib


4. set INCLUDE=%INCLUDE%;c:\svnrepo\utils
..\..\tools\make.exe -f Makefile.win32 CFG=release

5. Output files are:
src\release\cairo-static.lib
src\cario.h
src\cario-features.h
src\cairo-deprecated.h


