Monday, June 07, 2010

How to build Firefox on Windows 64-bit machine with Visual Studio 2010

I thought you might want to know what are the instructions how to generate a Windows 64-bit build of Firefox with VS2010.

Setup instructions
  1. Install Visual Studio 2010 Pro (4/12/2010, vs_proweb.exe)
  2. Install Windows 7 SDK (winsdk_web.exe - v7 - 7/24/2009 )  
  3. Install MozillaBuild 1.4
  4. Download into your Mozilla Build installation directory (e.g. C:\mozilla-build) the following files:
  5. Rename or delete this file:

    • C:\mozilla-build\vim\vim72\install.exe
    NOTE: At the time of posting MozillaBuild 1.5 has not yet been released. Steps 4 and 5 should not apply with the new version.

     Now let's build
    • Start Mozilla Build with start-msvc10-x64.bat
    • Use for instance this mozconfig 
    . $topsrcdir/browser/config/mozconfig
    ac_add_options --target=x86_64-pc-mingw32
    ac_add_options --host=x86_64-pc-mingw32 
    # Once we fix jemalloc for VC10 + x64 - bug 569375
    export WIN32_REDIST_DIR="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\x64\Microsoft.VC100.CRT"
    •  and then:
    make -f build
      NOTE: The WIN32_REDIST_DIR is because we don't have jemalloc support for VS2010; we do have support for it in VS2008 and VS2005 (therefore you won't need the WIN32_REDIST_DIR line). For VS2005 use start-msvc8-x64.bat and for VS2008 use start-msvc9-x64.bat (NOTE I have not tested it myself).

      I hope this helps you out,

      EDIT: I had to switch VS2005 and VS2008 in the last note of this post. I had them switched. Thanks Makoto!

      Creative Commons License
      This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.