# How to set up a SeaMonkey tinderbox with Microsoft Visual C++ 6.0

#### by Robert Kaiser <kairo@kairo.at>

This document tries to describe all I have done to build the tpol tinderbox (as seen in the Mozilla1.8-SeaMonkey tree). I hope I didn't forget anything important in this doc...

1. Install Windows XP Professional SP2 and all available updates
2. Install Visual C++ 6.0 ("VC6")
3. Install Visual C++ Service Pack 5 and Visual C++ Processor Pack
4. Install the Microsoft Platform SDK ("PSDK") with the following components:
• Windows Core SDK
• Tools
• Build Environment - also select the subcomponent "x86 32-bit"
• Redistributable Components
• Web Workshop (IE) SDK
• Tools
• Build Environment
5. Install MSASM32.
6. Install moztools ("Netscape wintools"):
• Unzip moztools to a temporary directory, open a Windows command prompt and enter the following:
```SET MOZ_TOOLS=C:\moztools
cd buildtools\windows
install.bat```
7. Install Blat (needed by tinderbox):
• Copy the Blat executable files into `C:\moztools\bin`
• Configure Blat:
`blat -install <mailserver> <sender's addr> 5`
8. Install Cygwin:
• Set the package location to a location that won't be overwritten. The location is irrelevant to getting a working build, but it'll make updating your Cygwin environment easier in the future should you choose to do so.
• Install for "All Users" with a default text file type of "Unix" (both should be default options).
• In the package list dialog, click on "View" once to enter View All mode.
• Select the following packages (click a line in the "New" column to chenge your selection):
• `ash`, `cvs`, `coreutils`, `diffutils`, `findutils`, `gawk`, `grep`, `patch`, `perl`, `sed`, `unzip`, `zip` (as provided)
• `make`: select version 3.79.1-7, because make 3.80 may break the build (?)
• `openssh`, `rsync` (needed by tinderbox)
NOTE: You may use ActiveState perl instead of the perl package in cygwin if you prefer, but I had problems getting tinderbox to run with that, so I went back to cygwin perl.
9. In a new `C:\moz` directory, create a `buildsetup.bat` with the following content:
```@ECHO OFF
SET MOZ_TOOLS=C:\moztools
SET MASM=C:\masm32
SET VSTUDIO=%ProgramFiles%\Microsoft Visual Studio
SET VCPATH=%VSTUDIO%\VC98
SET PSDK=%ProgramFiles%\Microsoft Platform SDK

SET PATH=%VCPATH%\Bin;%PSDK%\Bin
SET PATH=%PATH%;%VSTUDIO%\Common\MSDev98\Bin
SET PATH=%PATH%;%VSTUDIO%\Common\Tools
SET PATH=%PATH%;%MOZ_TOOLS%\bin;C:\cygwin\bin
SET PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\wbem
SET PATH=%PATH%;%MASM%\BIN

SET LIB=%VCPATH%\Lib;%PSDK%\Lib
SET LIB=%LIB%;%VCPATH%\MFC\Lib
SET LIB=%LIB%;%MASM%\LIB

SET INCLUDE=%VCPATH%\include;%PSDK%\Include
SET INCLUDE=%INCLUDE%;%VCPATH%\ATL\Include
SET INCLUDE=%INCLUDE%;%VCPATH%\MFC\Include
SET INCLUDE=%INCLUDE%;%MASM%\INCLUDE

SET CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
SET HOME=C:\moz
SET CVS_RSH=ssh
SET MOZILLA_OFFICIAL=1
SET BUILD_OFFICIAL=1
ECHO Installation environment variables set!
@ECHO ON```
10. Install tinderbox in `C:\tinderbox\SeaMonkey` and set up a fitting `tinder-config.pl` there:
• Create a `C:\tinderbox` directory, open a command prompt there and run
```C:\moz\buildsetup.bat
cvs co mozilla/tools/tinderbox
cvs co mozilla/tools/performance/startup/startup-test.html```
NOTE: you might get a note about a missing .cvspass file. In this case, run `touch C:\moz\.cvspass`.
• Create a `C:\tinderbox\SeaMonkey` directory and copy the following files from `C:\tinderbox\mozilla\tools\tinderbox` in there: `bloatdiff.pl`, `build-seamonkey-util.pl`, `build-seamonkey.pl`, `gettime.pl`, `post-mozilla-rel.pl`, `post-mozilla.pl`, `reportdata.pl`, `tinder-config.pl`, `tinder-defaults.pl`, `tinderbox`
• Copy the `startup-test.html` you checked out into that dir as well.
• Edit `tinder-config.pl`, with the following non-default options (adjust as wanted/needed):
```\$BuildAdministrator = "yourname\@yourdomain.tld";
\$CleanProfile             = 1;
\$ProductName              = "SeaMonkey";
\$DHTMLPerformanceTest     = 1;  # Tdhtml
\$XULWindowOpenTest        = 1;  # Txul
\$StartupPerformanceTest   = 1;  # Ts
\$Make          = 'make';       # Must be GNU make
\$use_blat       = 1;
\$ObjDir = '../build/';
\$BuildNameExtra = 'SeaMonkey-1.0';
\$BuildName = 'mymachine';
\$BuildTag = 'MOZILLA_1_8_BRANCH';
\$BinaryName = 'seamonkey.exe';
\$ReleaseBuild  = 0;
\$clean_objdir = 1; # remove objdir when starting release cycle?
\$clean_srcdir = 0; # remove srcdir when starting release cycle?
\$milestone     = "mozilla1.8";
\$ENV{MOZILLA_OFFICIAL} = 1;
\$ENV{BUILD_OFFICIAL} = 1;
```
NOTE: it's important you use `make` and the correct `\$BinaryName` ending in "`.exe`". The `\$ENV{}` statements are needed as it seems that tinderbox doesn't use the `export`s made by the `mozconfig` (see below).
• If your Windows has a different language than English, edit `build-seamonkey-util.pl` line 1116 from "`if (\$ENV{USERPROFILE}) {`" to "`if (\$ENV{USERPROFILE} && -d \$ENV{USERPROFILE}."\\Application Data") {`" (see bug 318403)
11. Create a `mozconfig` in `C:\tinderbox\SeaMonkey` with the following content:
```# tpol tinderbox config

# these are done in tinder-config.pl since this doesn't seem to work:
export MOZILLA_OFFICIAL=1
export BUILD_OFFICIAL=1

12. Run tinderbox: Go to `C:\tinderbox\SeaMonkey` in a command prompt and run
```c:\moz\buildsetup.bat
NOTE: Instead of the perl command, you can also use the tinderbox start script to run it, which needs to be run through bash, but completely runs tinderbox in the background. For this, run the following command after loading `buildsetup.bat`:
`  bash -c "./tinderbox depend start"`