We're going to build everything from source

  1. Preaparing LLVM 
    1. Download source or
    2. Generating projects for Visual Studio with CMake
      1. Download and install CMake
      2. Open source folder in CMake
      3. Configure, with native compiler
      4. Set necessary building flags 
        • CMAKE_INSTALL_PREFIX — specify folder where binaries will be put (e.g. C:\LLVM)
        • LLVM_USE_CRT_RELEASE — set MT, as LLVM will be statically linked with llvmpipe, which we will build with MT flag (release build)
      5. Apply configuration (don't forget this one, spent week to figure it out)
      6. Generate projects
    3. Compiling LLVM in  Visual Studio
      1. Find LLVM.sln, in projects folder and open it with Visual Studio
      2. Choose INSTALL target
      3. Set configuration to Release
      4. Start building
    4. Define location LLVM in corresponding environment variable: 


  2. Prepare building evironment for Gallium3D llvmpipe
    1. Download and install Python
    2. Download and install libxml2-python
    3. Download and install SCons
    4. Download and install MinGW
      1. After installation open MSys console by running C:\MinGW\msys\1.0\msys.bat
      2. Install flex and bison packages, executing following command:

        mingw-get install msys-flex msys-bison
      3. Add MinGW MSys location to system's path 


    5. Download Mesa source or git://
  3. Building Gallium3D llvmpipe
    1. open console, and go to Mesa source folder
    2. Start building: 

      c:\Python27\Scripts\scons.bat build=release llvm=yes libgl-gdi

      SCons installs in Python's folder but doesn't set it in system, thus we need to specify full path. You can specify it in PATH variable yourself, though.

  4. In the end, we get  mesa\build\windows-x86\gallium\targets\libgl-gdi\opengl32.dll
If everything went right you're done :)

Based on short stories:

Getting Started with the LLVM System using Microsoft Visual Studio --
Mesa: Compiling/Installing --
Mesa: Gallium llvmpipe driver --