Here are the steps I followed to compile XULRunner on MS Windows (using
MSVC++7.1) with LDAP support enabled.
You need the Cygwin environment (a collection of GNU tools used by the build
process). Download the Cygwin installer at ftp://ftp.osuosl.org/pub/cygwin/set....
During the installation, choose the "DOS" style line ending. Install the
- ash -- UNIX-like command line interpreter shell (Base category)
- coreutils -- GNU core utilities (includes fileutils, sh-utils, and
textutils) (Base category)
- diffutils -- file comparison utility (Base category)
- findutils (Base category)
- sed -- a search and replace language (Base category)
- grep -- text search tool (Base category)
- gawk -- pattern matching language (Base and Interpretors categories)
- perl -- a scripting language used to control parts of the build
- patchutils -- a small collection of programs that operate on patch files
- libiconv -- GNU character set conversion library and utilities (Devel
- unzip -- zip file extraction (Archive category)
- zip -- zip file creation (Archive category)
XULRunner 126.96.36.199 needs make 3.80, which is not available in the latest
Cygwin installer. You need to get it here: http://cygwin.paracoda.com/release/...,
or from my local copy if the link is
dead. To extract the archive, put it in your root cygwin directory, then launch
a Cygwin window (from the Cygwin icon on your desktop or in the start menu).
tar xjvf make-3.80-1.tar.bz2
This will install make 3.80 on your cygwin tree. You can check if everything
is ok by running
$ make -v
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
There is a conflict with the Cygwin linker and the MSVC linker, so you have
to rename the Cygwin linker, which can be found in
%CYGWINBASE%\bin\link.exe. You can run in Cygwin:
mv /bin/link.exe /bin/link-bak.exe
GLib and libIDL for VC7.1
You need GLib and libIDL compiled with your compiler. I found them here:
GLib for VC7.1 and
libIDL for VC7.1. Extract them in a directory not included in cygwin. For
Make the DLLs executable, by running in Cygwin:
chmod 755 /cygdrive/c/moztools-vc71bin/bin/*
Netscape's Wintools is a collection of tools needed to build Mozilla
software on Windows. You can get it here: http://ftp.mozilla.org/pub/mozilla.....
Extract the archive into a temporary directory, then install it using a
Microsoft command-line window (run "cmd" in the run dialog of the start
Of course C:\moztools is my case, you can change it (it is created by the
install.bat program if needed).
Get the Mozilla source
Get the xulrunner 188.8.131.52 source code here:
ftp://ftp.mozilla.org/pub/mozilla.o.... Take care to extract it into a
directory not containing spaces in its path.
Configure the build process
Once you have extracted the source tarball, you have to configure the build
options. Create a file named .mozconfig at the root of the "mozilla" source
directory, and containing:
--enable-ldap enables LDAP support, and
--disable-javaxpcom disables Java XPCom bridge, since it needs a
Java development environment, which I have not.
Then, create a file initializing your build environment, named for example
env.cmd, and containing:
rem --- Set HOME so that cvs and ssh work correctly
rem --- cvs uses HOME to locate your .cvspass file, and ssh to locate your .ssh file
rem --- if you are using ssh, your HOME should match the home directory specified in /etc/passwd. See http://www.cygwin.com/faq/faq0.html.
rem --- Set VCVARS to wherever the MSVC vcvars.bat file is found
set VCVARS=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\VCVARS32.BAT
rem --- Set MSSDK to wherever the MS SDK is installed
rem --- The separate SDK is only required for MSVC6
set MSSDK=C:\Program Files\Microsoft Platform SDK
rem --- Set MOZ_TOOLS to wherever you have the moztools packaged installed
rem --- Set CYGWINBASE to wherever cygwin is installed
rem --- Do not use CYGWIN or else cygserver, cygrunsrv, and other cygwin services will not function properly.
rem --- The CYGWIN variable is also used to sort of change the behaviour of Cygwin.
rem --- Make sure Cygwin does not print out a DOS style path warning
rem --- If you are using VC7 or VC7.1, you must set GLIB_PREFIX and LIBIDL_PREFIX
rem --- Prepend Cygwin 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.
rem --- Set MSVC environment vars
rem --- Prepend SDK paths
rem --- Only required for MSVC6
rem --- Add glib/libidl to build environment
rem --- Only needed for VC7 or 7.1
rem -- moztools comes last after glib/libIDL
rem --- Now the PATH variable contains:
rem MS-SDK; MSVC; Cygwin; Windows; glib/libIDL; Moztools
rem --- Typically the last thing the script does is launch a cygwin shell
rem --- WARNING: This may reset your carefully setup path! Check your /etc/profile and ~/.profile files.
bash --login -i
Launch a Cygwin window. In the Cygwin environment, your C hard disk can be
found in the
/cygdrive/c/ directory. Run your
script. Then move to your mozilla source directory. On my system it's:
You can launch the build by running:
make -f client.mk build
XULRunner is now being built. You can experience xpidl.exe crashes. In my
case, the reason was that I wasn't using the right Glib and libIDL DLL for my
compiler. Also, don't forget to make your GLib and libIDL executable.
Now that you have built XULRunner, you can package it by running in the
make -C xpinstall/packager
This will create an archive of XULRunner in the
directory. That you can install on another computer. Here is mine: http://techblog.beretti.org/public/....