To create a K-Meleon distribution, you need
the Gecko engine, K-Meleon's executable file and its plugins, and the chrome files.
In addition, K-Meleon's standard distribution uses an installer created using NSIS.
This document covers these four sections:

Getting a command prompt for building GRE 1.9.1.x

Either VC7.1 (Visual Studio 2003), VC8 (Visual Studio 2005) or VC9 (Visual Studio 2008) are used to build GRE 1.9.1.x. When the prerequisites are set up, launch one of the batch files from the c:\mozilla-build directory:

start-msvc71.bat (VS 2003)

start-msvc8.bat (VS 2005)

start-msvc9.bat (VS 2008)

The batch file will automatically display a MSYS command prompt window with all the needed environment variables set, provided the software requirements were met. To paste commands into this window, you must right-click on the window's title bar to open its context menu.

Lets move to partition C:/ and create a directory called c:/projects to work there.

cd c: // go to c:/ which is a directory for bash

"mkdir projects" // create the directory projects.

"cd projects" // go inside projects

Create a text file with an text editor with the extension bat called clone.bat and write inside:

The two commands will get us the needed source int the subfolder C:/projects/191src.
The last part of the first line "> .clone.log 2>&1" creates a log so that we can check whether all was done or if we had errors.

Lets start the batch file via the command prompt:

"clone.bat"

Your firewall will prompt You that CVS wants to access the net. Allow it. The process will get You the Mozilla source.

The batch file will automatically display a MSYS command prompt window with all the needed environment variables set, provided the software requirements were met. To paste commands into this window, you must right-click on the window's title bar to open its context menu.

SeaMonkey 1.0.x is based on the Mozilla 1.8.0 branch, which does not support VC8 (VS 2005).

For those requirements, your total download size will be around 50 MB.

If you are using Windows 9x, you probably need to give the DOS environment more memory space by running:

command /E:4096

Unzip the Source

Create a directory where everything will go.
Say, C:\projects.
Create two more in there, one named mozilla and the other kmeleon.
Now, unzip the respective source code packages with your favorite archive program in their respective directories.

How to Configure

You'll need a batch file in your projects directory to set up the environment prior to compiling:

rem --- Set VCVARS to wherever the MSVC vcvars.bat file is found
set VCVARS=C:\Program Files\Microsoft Visual Studio 6\VC98\Bin\VCVARS32.BAT
rem --- Set MOZ_TOOLS to wherever you have the moztools packaged installed
set MOZ_TOOLS=C:\moztools
rem --- Set CYGWINBASE to wherever cygwin is installed
set CYGWINBASE=C:\cygwin
rem --- Prepend Cygwin path and append moztools path
rem --- This is necessary so that cygwin find is ahead of windows find.exe in the PATH, but cygwin link is after MSVC link.exe.
set PATH=%CYGWINBASE%\bin;%PATH%;%MOZ_TOOLS%
rem --- Set MSVC environment vars
call "%VCVARS%"

Build the Mozilla Source Code

Open a command prompt, and go to the projects directory with it.
Run your batch file.
Next, enter the mozilla directory, and use the following command to start building:

make -f client.mk build

Depending on the speed of your PC, this might take anywhere from half an hour to several hours.

Building K-Meleon

There is a detailed build instruction in BuildKMeleon.
Because you have built Mozilla, you don't need to download the SDK anymore.
If you follow the previous section, the Mozilla include files would be in
C:\projects\mozilla\seamonkey\dist\include\.

Creating the Chrome Package

Note: This section is outdated.

%kmeleon% is the directory of an existing version of K-Meleon (the binary release).