Build instructions for Pale Moon (Windows + VS2012 Express)

Post your tutorials for using Pale Moon here.

Moderator: Indalecio

Forum rules
Tutorials and Howtos should only relate to Pale Moon, and not to third party applications. e.g.: Don't post a Howto for configuring your firewall.

Build instructions for Pale Moon (Windows + VS2012 Express)

Postby Moonchild » Sat Apr 05, 2014 11:38 am

To build your own copy of Pale Moon from source on Windows, using the free version of Visual Studio 2012, you will need to do the following.
Most of these instructions are universal for building x86 and x64, so I will indicate differences required for x64 at the steps they are required.

Install prerequisites

  • Make sure you have powerful enough hardware running Windows 7 SP1 or above (at least dual-core full-fledged processor, at least 4GB of Ram (8 or more recommended), at least 20GB of free disk space). Don't try to build on a laptop. If you are even considering doing this, stop. You need a development-class computer to build Pale Moon.
  • Visual Studio 2012 Express: http://www.microsoft.com/en-us/download/details.aspx?id=34673
    Launch VS2012 after installation to initialize the environment, start the IDE and get the latest updates (Update 4 at the time of this writing). Launch after updating to finish up the update, after which you can close the IDE. For x64 builds, make sure you install the x64 build tools.
    (Note: You will be asked to register with Microsoft when launching it the first time. If you want to continue using VS2012 Express after 30 days, I strongly recommend you do so immediately and get it out of the way. Skipping this step will give you a 30-day evaluation period after which VS2012 Express will cease to work.)
  • June 2010 DirectX SDK: http://www.microsoft.com/download/en/details.aspx?id=6812
    When installing, make sure to also install the runtime libraries (do not uncheck them). Samples and documentation are optional.
    (Note that other versions of the DirectX SDK on Microsoft's Developer Center that claim to have been released after June 2010 are actually older versions that are misdated, some of which will result in an error if you try and download them due to the installer files themselves having been removed from the MS servers. There will not be any further standalone DirectX SDKs released by MS, since DirectX has been transitioned from an independent distribution model to an integrated (into Windows and Visual Studio) model, and the DirectX SDK is now integrated into the Windows 8 SDK (which is bundled with Visual Studio as of VS2012). The reason that we require the June SDK even on newer Win7+VS2012 systems is because ANGLE depends on D3DX9, but MS considers D3DX to have been obsoleted by newer technologies and therefore VS2012 doesn't include the d3dx9.h and d3dx9tex.h headers that are required to compile ANGLE.)

    Caveat:
    If installation fails with an "S1023" error, execute the following commands to remove the VC++ 2010 redistributable libraries from your computer:
    Code: Select all
    MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
    MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}
    Then install the DirectX SDK again. After installation has completed, you can re-install the VC++ redistributable libraries from http://www.microsoft.com/download/en/details.aspx?id=26999
  • The MozillaBuild package: https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe
    Install it in the recommended location, or a different path that has no spaces in it.
Contrary to some instructions on the 'web, you do not need the Windows 7.1 SDK, not even for building for Windows XP machines. This is not required for VS2012 versions (that come with the Win8 SDK integrated) and will actually complicate matters and may break your build. Please do not install the Win 7.1 SDK.

Get the source

Download the source from http://www.palemoon.org/sourcecode.shtml
Unpack the source code (using 7-zip) to a path that does not contain spaces, e.g. c:\palemoon-source

This source tree will contain everything needed for both x86 and x64 builds of Pale Moon (they share the same release source code).

Configure

Create a file called .mozconfig in the source folder you unpacked the source in.
(Yes, that is {dot}mozconfig -- don't omit the . at the start. Also make sure it's not .mozconfig.txt or something crooked like that. If you are hiding extensions of known file types, fix that first in folder options because it's a PITA when trying to do this kind of thing)
Make sure it contains at least the following for a close-to-official build:

For x86 (32-bit):
Code: Select all
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-application=browser
ac_add_options --enable-optimize="-O2"
ac_add_options --enable-jemalloc
ac_add_options --disable-crashreporter
ac_add_options --disable-accessibility
ac_add_options --disable-parental-controls
ac_add_options --disable-maintenance-service
ac_add_options --disable-webrtc
ac_add_options --disable-metro
WIN32_REDIST_DIR=$VCINSTALLDIR/redist/x86/Microsoft.VC110.CRT


For x64 (64-bit):
Code: Select all
ac_add_options --target=x86_64-pc-mingw32
ac_add_options --host=x86_64-pc-mingw32
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-application=browser
ac_add_options --enable-optimize="-O2"
ac_add_options --enable-jemalloc
ac_add_options --enable-shared-js
ac_add_options --disable-crashreporter
ac_add_options --disable-accessibility
ac_add_options --disable-parental-controls
ac_add_options --disable-maintenance-service
ac_add_options --disable-webrtc
ac_add_options --disable-metro
WIN32_REDIST_DIR=$VCINSTALLDIR/redist/x64/Microsoft.VC110.CRT


Build

  • Go to C:\mozilla-build (or wherever you extracted to mozilla build tools) and run start-shell-msvc2012.bat
    This will open a UNIX-like shell with the compile environment set up for Visual Studio 2012. Please do not use the -x64 batch file even if you are on a 64-bit operating system when building x86.

    The -x64 batch file is for launching a 64-bit build environment and building a 64-bit browser using a 64-bit compiler. So for creating an x64 build of Pale Moon, run start-shell-msvc2012-x64.bat
  • In the shell, cd to your pale moon source directory, e.g.
    cd /c/palemoon-source
    if you installed the source in C:\palemoon-source
  • Start the build:
    ./mach build
  • Be patient. Building will take a long time. Your PC will be fully occupied compiling and linking the browser (you can expect 100% CPU usage throughout and lots of memory use - provide ample cooling) and you should not be using it for anything else that is intensive at this time. Especially memory-intensive applications should be avoided because it can cause issues with the linker (memory fragmentation) resulting in a very unstable browser.

Strip/Package

After building is completed, you can take the resulting binaries for a test run in the object directory directly (see the on-screen instructions at the end of the build process) but it will not be complete yet. You need to strip and package the browser to integrate additional code and have a ready-to-use browser. You do this by running
./mach package

This will create a properly packaged .zip file in your object folder under the Pale Moon source folder. e.g.:
C:\palemoon-source\obj-i686-pc-mingw32\dist\palemoon-{version}.en-US.win32.zip (for x86)

Building a self-extracting installer

If you want to build a self-extracting installer, similar to the off-line installers offered in official builds, you will have to do the following after packaging as explained above:
  1. Go to your objdir, e.g. obj-i686-pc-mingw32
  2. Issue the following command. Pymake is required because that is what mach uses, "make" won't work here because of path formatting:
    ../build/pymake/make.py installer
This will create a self-extracting installer in your object folder under the Pale Moon source folder. e.g.:
C:\palemoon-source\obj-i686-pc-mingw32\dist\install\sea\palemoon-{version}.en-US.win32.installer.exe (for x86)
Last edited by Moonchild on Thu Jul 10, 2014 9:45 am, edited 8 times in total.
Reason: Added x64 instructions.
Please do not send me private messages for anything that could also be posted in the public boards.
User avatar
Moonchild
Pale Moon guru
Pale Moon guru
 
Posts: 9324
Joined: Sun Aug 28, 2011 5:27 pm
Location: Sweden

Re: Build instructions for Pale Moon (Windows + VS2012 Expre

Postby tribaljet » Mon Apr 28, 2014 6:10 pm

With this thread being continuously updated, it might help people do system-specific builds, such as SSE4.x and AVX builds. If such builds were to surface, would they be made available alongside the Atom-optimized builds?
Portuguese translator of Pale Moon
User avatar
tribaljet
Lunatic
Lunatic
 
Posts: 385
Joined: Wed Jun 06, 2012 7:45 pm
Location: Portugal

Re: Build instructions for Pale Moon (Windows + VS2012 Expre

Postby Moonchild » Mon Apr 28, 2014 11:18 pm

tribaljet wrote:With this thread being continuously updated, it might help people do system-specific builds, such as SSE4.x and AVX builds. If such builds were to surface, would they be made available alongside the Atom-optimized builds?

I welcome contributed builds. But people do have to go through the proper procedure to be allowed to distribute their builds with official Pale Moon branding; no rogue copies, thanks.
Please do not send me private messages for anything that could also be posted in the public boards.
User avatar
Moonchild
Pale Moon guru
Pale Moon guru
 
Posts: 9324
Joined: Sun Aug 28, 2011 5:27 pm
Location: Sweden

Re: Build instructions for Pale Moon (Windows + VS2012 Expre

Postby tribaljet » Mon Apr 28, 2014 11:58 pm

Moonchild wrote:I welcome contributed builds. But people do have to go through the proper procedure to be allowed to distribute their builds with official Pale Moon branding; no rogue copies, thanks.


But of course, nor would I ever think of not following proper procedure. Will the thread expand further in terms of instructions as to make it easier for people inexperienced with handling new builds?
Portuguese translator of Pale Moon
User avatar
tribaljet
Lunatic
Lunatic
 
Posts: 385
Joined: Wed Jun 06, 2012 7:45 pm
Location: Portugal

Re: Build instructions for Pale Moon (Windows + VS2012 Expre

Postby Accel » Tue Apr 29, 2014 11:49 am

I, myself interested to build pm for my own use using SSE4.1 / AVX.

may i know how to do this, MC? is this instruction right?

ac_add_options --enable-optimize="-O2 -GFLs -GS- -fp:precise -Qfast_transcendentals -Qpar -arch:SSE3 -QaxCORE-AVX2,CORE-AVX-I,AVX,SSE4.2,SSE4.1,SSSE3,SSE3,SSE2"
Accel
Fanatic
Fanatic
 
Posts: 104
Joined: Tue Sep 18, 2012 4:03 am
Location: Indonesia

Re: Build instructions for Pale Moon (Windows + VS2012 Expre

Postby Moonchild » Tue Apr 29, 2014 1:38 pm

You can't use those optimization flags. You have to use the optimization flags available in the Visual Studio compiler.
If you want to compile with a different compiler (I think the flags you quoted are for the Intel compiler?) then you'll have to look around for build instructions for that compiler on the 'net.

MSVC2012 however does support -arch:AVX which would automatically imply more advanced SSE instruction sets.
http://msdn.microsoft.com/en-us/library ... 10%29.aspx
Please do not send me private messages for anything that could also be posted in the public boards.
User avatar
Moonchild
Pale Moon guru
Pale Moon guru
 
Posts: 9324
Joined: Sun Aug 28, 2011 5:27 pm
Location: Sweden

Re: Build instructions for Pale Moon (Windows + VS2012 Expre

Postby Accel » Tue Apr 29, 2014 2:20 pm

thanks MC for your reply.. now it starts.. :)
Accel
Fanatic
Fanatic
 
Posts: 104
Joined: Tue Sep 18, 2012 4:03 am
Location: Indonesia

Re: Build instructions for Pale Moon (Windows + VS2012 Expre

Postby tribaljet » Tue Apr 29, 2014 8:19 pm

Will this tutorial include x64 build instructions as well in the future?
Portuguese translator of Pale Moon
User avatar
tribaljet
Lunatic
Lunatic
 
Posts: 385
Joined: Wed Jun 06, 2012 7:45 pm
Location: Portugal

Re: Build instructions for Pale Moon (Windows + VS2012 Expre

Postby Accel » Thu May 22, 2014 2:31 pm

is there an easy way to make palemoon installer?
Accel
Fanatic
Fanatic
 
Posts: 104
Joined: Tue Sep 18, 2012 4:03 am
Location: Indonesia

Re: Build instructions for Pale Moon (Windows + VS2012 Expre

Postby Moonchild » Thu May 22, 2014 4:20 pm

tribaljet wrote:Will this tutorial include x64 build instructions as well in the future?


Yup.

Accel wrote:is there an easy way to make palemoon installer?


I've added some instructions at the end to create an installer. I assume that is what you meant.
Please do not send me private messages for anything that could also be posted in the public boards.
User avatar
Moonchild
Pale Moon guru
Pale Moon guru
 
Posts: 9324
Joined: Sun Aug 28, 2011 5:27 pm
Location: Sweden

Next

Return to Tutorials/Howtos

Who is online

Users browsing this forum: No registered users and 1 guest