Files
firestorm/build-env
a57be4bd12 Add sync-from-windows.sh to pull build outputs back from the build machine
sync-to-windows.sh pushes sources out; there was no inverse, so every build
had to be retrieved by hand. This pulls back only GENERATED artefacts:
the linked output dirs (rel/dbg/pro/arm/ice.bin), the per-project VC6
intermediates, packed Resource/*.mw4 + *.dep, the MW4/ deploy, the binaries
deployed into Gameleap/mw4, and the build logs. Source, content and assets
are never pulled, so a stale copy on the build machine cannot clobber local
edits made since the last push.

Two things it has to get right, both found by running it:

It does not use rsync -a. The CIFS mount reports every file as 755 while git
tracks these as 100644, so preserving permissions would flip the exec bit on
every file pulled -- a spurious mode change on ~2000 paths. It uses
-rlt --chmod=F664,D775 instead. Verified: 1994 files pulled, 0 mode changes.

It excludes dgVoodoo2 from the MW4/ deploy (DDraw/D3D8/D3D9/D3DImm.dll,
dgVoodoo.conf, dgVoodooCpl.exe). That is a Win10/11-only prerequisite which
must never enter the repo because it breaks the XP pods; it was removed
deliberately in 0ceba9c7. A naive pull dragged all six straight back in.
This was being stripped by hand before every push back.

--delete is opt-in rather than default: a pull with --delete can destroy
mirrored history if the build machine is missing something. Excluded files
are protected from deletion, so Resource/*.tga and *.nfo cannot be removed
by it. There is also a --dry-run, and a warning if the pull targets already
hold uncommitted work.

Co-authored-by: Claude Opus 5 (Anthropic) <noreply@anthropic.com>
Co-authored-by: GitHub Copilot <copilot@github.com>
2026-08-09 17:54:38 -05:00
..
2026-06-26 10:55:33 -05:00
2026-06-26 10:55:33 -05:00

build-env — Extracted MW4 / FireStorm build toolchain

Everything here was extracted from the original build machine's disk image (mounted at E:\). It is self-contained — no external installs required to compile the game. Build user on the original machine was jeff.

Contents

Folder Source on image Purpose
VisualStudio6/ E:\Program Files\Microsoft Visual Studio Visual C++ 6.0 — compiler (VC98\Bin\CL.EXE, LINK.EXE, NMAKE.EXE), IDE (Common\MSDev98\Bin\MSDEV.EXE), headers, libs, MFC/ATL. 204 MB.
dx7asdk/ E:\Code\dx7asdk DirectX 7.0a SDKinclude\ (ddraw.h DIRECTDRAW_VERSION 0x0700, d3d.h immediate mode, dinput.h, dsound.h) + lib\ (ddraw.lib, dinput.lib, dsound.lib, d3dim.lib …). Matches GameOS GOS_REQUIRES_DX7A.
DXMedia/ E:\Code\DXMedia DirectX Media 6.0 SDK — DirectShow headers (amstream.h, control.h, strmif.h) + libs (strmiids.lib, quartz.lib, strmbase.lib …). Needed by GameOS for video.
CommonFiles-MSShared/ E:\Program Files\Common Files\Microsoft Shared\{VS98,MSDesigners98} Shared VS components referenced by the HKLM registration (help/designer DLLs).
setup-mw4-build.bat (generated) Sets PATH/INCLUDE/LIB for command-line builds — exact original ordering.
vc6-directories.reg (generated) HKCU import — exact original Tools→Options→Directories (rebased) so headers resolve DX7-correctly.
vc6-hklm-registration.reg (generated) HKLM import — VC6 install registration (rebased + redirected under Wow6432Node) so msdev.exe runs from the copy.
_raw_visualstudio6.reg, _raw_devstudio6.reg exported from image software hive Untransformed source exports (provenance; not for import).

Not copied (intentionally)

  • EAX SDK — not required as a separate install; eax.h is bundled in the repo (Gameleap\code/CoreTech/Libraries/GameOS/Eax.h) and no eax.lib exists on the image (EAX is resolved at runtime, not statically linked).
  • DirectX 8 SDKd3d8.lib/d3dx8.lib are NOT on the image. Only a few standalone tools (Gos2Light, Gos2Text, HighTide) link DX8; the game and editor build entirely on DX7, so their absence does not block the main build.

Exact original directory ordering (recovered from jeff's NTUSER.DAT)

Source key: HKCU\Software\Microsoft\DevStudio\6.0\Build System\Components\Platforms\Win32 (x86)\Directories

  • Include: DXMedia\include → dx7asdk\include → VC98\INCLUDE → VC98\MFC\INCLUDE → VC98\ATL\INCLUDE
  • Library: VC98\LIB → VC98\MFC\LIB (only VC98 — see below)

Two non-obvious but verified facts that make this work:

  1. DXMedia\include has no core DX headers (only DirectShow: amstream/control/strmif), so listing it first does NOT override DirectDraw. ddraw.h still resolves from dx7asdk (next in line) — satisfying GameOS\pch.hpp's #if DIRECTDRAW_VERSION != 0x0700 → #error DirectX 7 SDK is required — before VC98's older ddraw.h (last) is ever reached.
  2. Library Dirs lists only VC98 because the DirectX/DirectShow .libs (ddraw, dinput, dsound, dxguid, strmiids, quartz, strmbase, amstrmid) were copied into VC98\Lib on the original machine. They're pulled in via #pragma comment(lib,...) (e.g. GameOS\guids.cpp), not via the link line. Our copied VC98 tree already contains them.

How to build

stlnative/ — native headers STLport wraps (now in-tree)

STLport (mw4\Libraries\stlport) wraps a 27 MB snapshot of the VC98 + Platform SDK headers (974 files). It used to require a hardcoded C:\stlnative; it now lives here at build-env\stlnative\, and the 3 macros in stl_inc_find.hpp point at <c:\VWE\firestorm\build-env\stlnative/##x>. No external C:\stlnative is needed — the build is self-contained under c:\VWE\firestorm. (If you ever relocate the working tree, update those 3 macro lines to the new absolute path.)

One-time setup: register VC6 + the directory paths

Run elevated (HKLM write needs admin; do both in the same shell):

reg import c:\VWE\firestorm\build-env\vc6-hklm-registration.reg
reg import c:\VWE\firestorm\build-env\vc6-directories.reg
  • vc6-hklm-registration.reg → registers the VC6 install (ProductDir/InstallDir, environment packages) under HKLM\SOFTWARE\Wow6432Node\Microsoft\{VisualStudio,DevStudio}\6.0 so 32-bit msdev.exe finds itself when launched from the copied tree.
  • vc6-directories.reg → HKCU; the exact original include/lib/path ordering.

Wow6432Node, why: on 64-bit Windows a 32-bit process (msdev.exe) reads HKLM\SOFTWARE\Microsoft\... redirected to HKLM\SOFTWARE\Wow6432Node\Microsoft\..., so the HKLM keys are placed there. HKCU\Software is not redirected, so the directories key stays at its normal path.

Option A — IDE (most faithful to original)

  1. Launch VisualStudio6\Common\MSDev98\Bin\MSDEV.EXE.
  2. (Directories are already set by the .reg import — verify under Tools → Options → Directories if desired.)
  3. Open c:\VWE\firestorm\Gameleap\code\mw4\Code\MechWarrior4.dsw, set MW4Application as the Active Project, pick a config, Build.

Option B — command line (scriptable)

cd c:\VWE\firestorm\build-env
setup-mw4-build.bat
cd c:\VWE\firestorm\Gameleap\code\mw4\Code
msdev MechWarrior4.dsw /MAKE "MW4Application - Win32 Release"

msdev /MAKE reads include/lib dirs from the registry (the .reg above), not from %INCLUDE%. The setup-mw4-build.bat env vars matter only if you drive cl/nmake directly. Run the .reg import once and either path works. Caveat: msdev.exe run from a copied tree may still expect its HKLM install registration; if it misbehaves, use the IDE (Option A) or install VC6 from the image.