Here are the steps I followed to compile XULRunner on MS Windows (using
MSVC++7.1) with LDAP support enabled.
Prerequisites
Cygwin
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
following packages:
- 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
(Interpreters category)
- patchutils -- a small collection of programs that operate on patch files
(Devel category)
- libiconv -- GNU character set conversion library and utilities (Devel
category)
- unzip -- zip file extraction (Archive category)
- zip -- zip file creation (Archive category)
XULRunner 1.8.0.4 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).
Then enter:
cd /
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:
$ 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
PARTICULAR PURPOSE.
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
example:
C:\moztools-vc71bin\
Make the DLLs executable, by running in Cygwin:
chmod 755 /cygdrive/c/moztools-vc71bin/bin/*
Netscape Wintools
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
menu):
set MOZ_TOOLS=C:\moztools
cd YOURTEMPDIR\buildtools\windows
install.bat
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 1.8.0.4 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:
. $topsrcdir/xulrunner/config/mozconfig
ac_add_options --enable-ldap
ac_add_options --disable-javaxpcom
--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.
set HOME=C:\home
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
set MOZ_TOOLS=C:\moztools
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.
set CYGWINBASE=C:\cygwin
rem --- Make sure Cygwin does not print out a DOS style path warning
set CYGWIN=nodosfilewarning
rem --- If you are using VC7 or VC7.1, you must set GLIB_PREFIX and LIBIDL_PREFIX
set GLIB_PREFIX=C:\moztools-vc71bin
set LIBIDL_PREFIX=C:\moztools-vc71bin
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 PATH=%CYGWINBASE%\bin;%PATH%
rem --- Set MSVC environment vars
call "%VCVARS%"
rem --- Prepend SDK paths
rem --- Only required for MSVC6
set PATH=%MSSDK%\bin;%PATH%
set INCLUDE=%MSSDK%\include;%INCLUDE%
set LIB=%MSDDK%\lib;%LIB%
rem --- Add glib/libidl to build environment
rem --- Only needed for VC7 or 7.1
set PATH=%PATH%;%GLIB_PREFIX%;%GLIB_PREFIX%\bin
set INCLUDE=%GLIB_PREFIX%\include;%INCLUDE%
set LIB=%GLIB_PREFIX%\lib;%LIB%
rem -- moztools comes last after glib/libIDL
set PATH=%PATH%;%MOZ_TOOLS%\bin
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 env.cmd
script. Then move to your mozilla source directory. On my system it's:
cd /cygdrive/c/mozilla-src/mozilla/
Build
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.
Package
Now that you have built XULRunner, you can package it by running in the
mozilla directory:
make -C xpinstall/packager
This will create an archive of XULRunner in the dist/
directory. That you can install on another computer. Here is mine: http://techblog.beretti.org/public/....