Visit Mozilla.org

Building on Windows with SFU (Interix)

From MDC


Contents

[edit] Introduction

These notes are meant to supplement the existing Windows Build Documentation. Windows Services for Unix (SFU, or Interix) is not a supported build platform, but it can be made to work with enough patience. Updating a CVS tree to the trunk takes me only 8 minutes using the Interix cvs client compared to 24 minutes for the MSYS cvs client. For a depend-only build (i.e. verifying that the previous build completed) it is roughly 20% faster than MSYS. For a -j3 parallel clean build (excluding checkout and configure) it is only 3.7% faster. By comparison a -j3 SFU build is 25% faster than a -j1 SFU build.

[edit] Software Requirements

The following software needs to be installed for a standard Windows build using SFU.

[edit] Windows Services for Unix

Windows Services for UNIX version provides a full range of cross-platform services for integrating Windows into existing UNIX-based environments.

Download the self-extracting archive of the Windows Services for UNIX 3.5 product from here.

Once you have installed SFU, you will then need to register and log into the Interix Tools Warehouse. First download the Bootstrap installer, then install the following packages using pkg_update -L:

  • bash (optional)
  • cvs
  • gmake
  • m4_gnu
  • unzip
  • zip

You will also need to use pkg_add to install the autoconf-2.13 package. There is a bug in the package and it will only correctly install from the SFU root directory. The autoconf macros do not work correctly with Microsoft C so you need some patches. (It may be possible to build a POSIX executable with gcc but you would also need to compile updated versions of some libraries such as pango.)

$ cd /
$ pkg_add ftp://ftp.interopsystems.com/pkgs/3.5-prev/autoconf-2.13-bin.tgz

[edit] Netscape wintools

  • Most of the programs in MOZ_TOOLS/bin are obsolete, see Bug 255460. Also, the include files in the original archive have corrupted End-of-Line sequences. Instead, grab the new moztools.zip archive from Bug 274221 attachment 189071 and extract it in a convenient location (e.g. C:\); it will create a "moztools" directory tree wherever you extract it.
  • Be sure to set the MOZ_TOOLS environment variable to point to the installation, and add MOZ_TOOLS/bin to your path.

[edit] glib/libIDL

You may need to compile glib and libIDL manually. The glib 1.2.10 sources for Interix can be found at Interix tools warehouse. Use configure --host=interix as indicated in the Interix readme at the same place. libIDL source code can be fond on mozilla.org (configure as --host=i586-pc-interix3 or similar). It is necessary to modify lexer.l to use strtoq instead of sscanf as Interix sscanf does not support 64-bit integers.

[edit] Compiler & Linker

This procedure has only been tested with the Microsoft Visual C++ suite.

[edit] Configure the Enviroment

  • Because standard autoconf does not correctly detect SFU you need to add mk_add_options RUN_AUTOCONF_LOCALLY=1 to your .mozconfig
  • SFU uses its own copy of the environment. It is simplest if you add the necessary environment variables to your SFU ~/.profile

[edit] Patches

After checking out the build for the first time, a number of patches are required before you can build.

  • SFU cannot start Windows executables unless the .exe is specified, this also affects autoconf because its .exe detection doesn't specify .exe! Be extra careful if you specify case-sensitivity when you install SFU.
  • Cygwin cygpath and cd accept both Windows and Unix paths. SFU only provides winpath2unix and unixpath2win, so I couldn't figure out how to support WIN_TOP_SRC, win_srcdir or abspath type variables
  • mddepend.pl doesn't understand Windows paths
  • client.mk doesn't regenerate nspr/ldap configures
  • configure.in doesn't know that Interix is a Windows platform
  • configure.in doesn't detect the .exe extension
  • configure.in thinks Interix Perl is AS Perl
  • add-chrome.pl doesn't know that Interix is a Windows platform
  • make-jars.pl doesn't know that Interix is a Windows platform
  • rules.mk assumes that it knows the full path name in .pp files
  • cygwin_wrapper assumes that the mountpoints are stored in a root folder (SFU uses /dev/fs/C)
  • ldap nests cygwin_wrapper for rc
  • nspr doesn't use cygwin_wrapper for linking
  • security/coreconf doesn't use cygwin_wrapper
  • security/coreconf likes to use \s on Windows
  • SFU doesn't have cp -a