Mozilla's getting a new look. What do you think? https://mzl.la/brandsurvey

Mozilla Build FAQ

See also:

General questions

 

 

Which systems are supported Mozilla build platforms?
There are multiple levels or tiers of Mozilla build "support".

Tier-1 platform refers to platforms that are the primary focus for development. Major problems on these platforms are considered showstoppers. These are also the platforms that show up on the SeaMonkey tinderbox page. The tier-1 platforms are:

  • linux/x86 (gcc)
  • win32/x86 (msvc)
  • OS X (gcc)

Tier-2 platforms are platforms for which a small varying subset of developers & contributors actively try to maintain but general development does not halt for problems on these platforms. These platforms are usually referred as the Ports as most of them reside on the SeaMonkey-Ports tinderbox page. The tier-2 platforms are:

  • aix 4.3 (aCC)
  • beos 5.0.3 (gcc)
  • bsdi 4.x (gcc)
  • hpux 10.x,11.x (HP cc)
  • irix 6.x/gcc (gcc/MIPSpro)
  • linux/ppc (gcc)
  • os/2 (gcc)
  • osf1 5.x (Compaq cc)
  • solaris (sparc & x86) 2.6+ (gcc/Forte)

Tier-3 platforms are those platforms which generally are not actively worked on by the main developers of the project but have fixes contributed by third parties. Tier 3 platforms are:

  • freebsd (gcc)
  • linux/alpha (gcc)
  • netbsd (gcc)
  • openvms (?)
  • ps2linux (gcc)
  • qnx 6 (gcc)
  • win32/x86 (gcc)

All other platforms are "unsupported" by the primary mozilla developers, where "unsupported" really means "not a priority and no one is actively working on it".

Most Mozilla developers do not have access to non-tier-1 platforms so any bugs reports against non-tier-1 platforms should be overflowing with information to help the owner of the bug determine the cause of the problem and the proper solution. If you can provide a patch and/or verify that the developer's patches work for your platform, that would help a lot towards getting your bugs fixed and checked into the tree.

 

What type of build system does Mozilla use?
Mozilla uses a thin GNU configure layer on top of a legacy Netscape recursive makefile build system on all platforms. Like most configure-based projects, it uses GNU autoconf to generate the configure script. GNU make is used to drive the build process.

 

Why use GNU make?
GNU make has been ported to a lot of systems. This makes porting Mozilla to those systems a bit easier. Using only the subset of make features that are supported by the native make program on 10 different platforms would make the build system unnecessarily complicated.

 

Will any other version of make work?
No. The Mozilla makefiles use GNU make specific features which will only work with gnu make.

 

Why aren't you using automake?
Part of Netscape's legacy system involved using GNU make's -include feature to include a common set of rules from a handful of files in every Makefile that needed to use them. With this centralized rule system, one of the primary selling points of automake was made inconsequential. Also, at the time, Mozilla's method of building libraries did not mesh well with libtool.

 

What happened to the nmake and CodeWarrior build systems?
They no longer exist in the current tree. nmake build support was dropped during the Mozilla 1.2a release cycle. The mac cfm build system was dropped along with OS9 support shortly after the Mozilla 1.3 release.

 

Why not ant, tmake, scons or insert your favorite build system here ?
Mainly, because no one has implemented these systems for Mozilla. When Mozilla was first open sourced, it only contained the legacy Netscape system. The autoconf layer was added on a branch and maintained in parallel for 6 months before it became the standard build system for the unix build.

 

If I wanted to implement my favorite build system for Mozilla, would Mozilla start using it? I don't want to waste my time if you aren't going to use it.
There's no guarantee that any code written for Mozilla will be accepted into the default tree. Any build system that is implemented would have to show that it's better overall than the current build system. Speed, flexibility, portability and the ability for a large group of developers who have 3+ years experience with the current build system to easily transition to the new system would be the major factors in deciding to switch. If you are serious and willing to do lots of work, contact User:Benjamin Smedberg to discuss the details of your proposal.

 

Why doesn't Mozilla support autoconf 2.5x?
Simply put, autoconf 2.5x does not offer anything to make the upgrade worth the effort. Autoconf 2.5x is not backwards compatible with autoconf 2.13 and the additional restrictions made by the newer versions of autoconf would require a major rewrite of the Mozilla build system for questionable gain.

Some of the 2.13 features, such as the ability to pass additional arguments to sub-configures, are not available in 2.5x. People have asked repeated about those features on the autoconf mailing list without any favorable response. Rewriting the configures of the sub-projects of Mozilla (NSPR & LDAP) is not an acceptible tradeoff. The sub-projects are also standalone projects and forking an entire codebase because of a build system incompatiblity is silly.

 

Why doesn't NSS use autoconf?
The NSS project is also used outside of the Mozilla project and the NSS project members did not feel that moving to autoconf was worth the cost. See bug 52990 for details.

 

Can I build multiple Mozilla-based projects from a single source tree?
Yes! Each project must be built in its own objdir.

 

What is an objdir?
An objdir build refers to the process of creating the output files in a different place than where the source lives. This is a standard feature of most configure-based projects. It allows you build for multiple configurations, including multiple platforms if you use a network filesystem, from a single source tree. It also avoid tainting your source tree so that you know that the files in your tree have not been modified by the build process.

If you run configure by hand, you can use the standard method of creating an empty directory any place on the disk, changing to that directory and running /path/to/mozilla/configure from there.

mkdir obj-debug
cd obj-debug
../mozilla/configure

If you use client.mk to build, you can add the following to your mozconfig file:

mk_add_options MOZ_OBJDIR=/path/to/objdir

 

Can I cross-compile Mozilla?
Yes, see the Cross-Compiling Mozilla document for details. No, Canadian Cross-Compiling is not supported.

 

Do parallel (make -j) builds work for Mozilla?
Yes. See the GNU Make Parallel Execution manual entry for optimal usage.

If you get obscure build errors when using parallel building (especially when using -j instead of -jN to run as many tasks in parallel as possible), try reducing the number of parallel tasks by decreasing N (or, if you used unlimited parallelism, add a small number N to -j).

Parallel building with -j4 and -j8 seems to work well.

 

How do I force the build system to pick up any of the changes made to my mozconfig file?
Touch any of the configure scripts in the tree. There is no explicit dependency upon the mozconfig file as the file can reside anywhere via the MOZCONFIG environment variable.

 

error: file '../../toolkit/locales/en-US/chrome/necko/contents.rdf' doesn't exist at ../../config/make-jars.pl line 418, <STDIN> line 9.
You are trying to build Firefox without following the instructions on Configuring Build Options. In particular, your mozconfig file must source the Firefox default mozconfig file:
. $topsrcdir/browser/config/mozconfig
# add your custom additional options here

 

Initial cvs checkout fails with the message: <tt>cvs [checkout aborted]: *PANIC* administration files missing</tt>
You cannot create a cvs tree under a directory named "CVS". This is a feature/bug of cvs. cvs expects to find certain administration files under the CVS directory and will complain if they are missing.

 

Error: ../coreconf/rules.mk:406: target `c' doesn't match the target pattern
You need make 3.80 and no other version like 3.81

 

Mac-specific questions

 

Can I build a Mozilla application as a Universal Binary?
Yes. See Mac OS X Universal Binaries for instructions.

 

Does Mozilla build on UFS?
Yes, since bug 157036 has been fixed.

 

Does Mozilla run on UFS?
Yes.

 

Can I use CodeWarrior to compile the Mach-O build?
No, CodeWarrior is dead. See bug 119589 for details.

 

After rebuilding e.g. layout, how do I make my FirefoxDebug.app reflect that change?
make -C browser/app.

For common Mac build errors and additional troubleshooting tips, see Troubleshooting in Mac OS X Build Prerequisites.

Win32-specific questions

 

 

Is there a Microsoft Visual Studio project file to build Mozilla?
No. You must use cygwin and GNU make.

 

Can I run the build commands from cmd.exe?
Yes. Make invokes the cygwin /bin/sh subshell to execute commands so it does not matter what shell is used to initially invoke make.

 

Which version of cygwin's autoconf package do I need to use?
Because of the incompatibilities between autoconf 2.1x and 2.5x, the cygwin maintainers wrote a wrapper script which will determine which version of autoconf your configure script needs and invoke that version of autoconf. You will need the autoconf(-wrapper) & autoconf-stable packages. See http://cygwin.com/ml/cygwin-announce.../msg00177.html for details.

 

Microsoft tools (CL, LINK, RC) gives file not found errors
The INCLUDE and LIB environment variables are used by the Microsoft Visual C++ tools. They are ordinarily set up in vcvars32.bat. Depending on which modules you build, you may or may not need MFC and ATL. Below are paths that work if Visual C++ is installed at "C:\msvs":
set INCLUDE=C:\msvs\VC98\Include;C:\msvs\VC98\MFC\Include;C:\msvs\VC98\ATL\Include
set LIB=C:\msvs\VC98\Lib;C:\msvs\VC98\MFC\Lib

 

cvs fails with the message:
cvs update: authorization failed: server XXXX rejected access
cvs update: used empty password; try "cvs login" with a real password

You are mixing wincvs and cygwin cvs. Use only one or the other.

 

cvs fails with the message:
cvs [checkout aborted]: cannot rename file CVS/Entries.Backup to CVS/Entries: Permission denied

As of cygwin 1.3.13, ntsec is enabled by default. ntsec is cygwin's attempt to get a more UNIX like permission structure based upon the security features of Windows NT. The error message indicates that there's a mapping discrepancy between the unix permissions listed in cygwin's /etc/passwd file and those used by Windows NT. As a workaround, you can add "nontsec" to your CYGWIN environment variable. The proper fix would be to fix the mapping problem.

 

Make spits out an error about not being able to find a .dtd file
You probably used WinZip to unpack the source archive. Don't do that. WinZip, by default, doesn't unpack 0 length files from tar.gz archives. Use another utility, or use the pull script to checkout the files that WinZip didn't extract.

 

nsinstall or another native win32 program complains about a file not being found
Check your cygwin mount table. Running the mount command should return something similar to:
c: on /cygdrive/c type user (binmode,noumount)
e: on /cygdrive/e type user (binmode,noumount)
c:\cygwin on / type system (textmode)
c:\cygwin\bin on /usr/bin type system (textmode)
c:\cygwin\lib on /usr/lib type system (textmode)

The build system expects that drive partitions are mounted using /cygdrive as the drive prefix. If c: or e: does not use /cygdrive as the drive prefix, then you cannot build Mozilla using those drives. You will need to manually mount the drive at the expected spot by using the command:

mount -s "e:\" /cygdrive/e

binmode (unix lineendings) or textmode (dos lineendings) don't matter as long as you use an editor (emacs, msdev) which can handle the appropriate line endings.

 

xpidl.exe crashes with an access violation
This usually occurs because of a mismatch between your compiler and your glib and/or libIDL libraries.

If you are building with Visual Studio .NET, then you must link against the VC7 built version of the glib & libIDL DLLs. For Visual Studio .NET 2003, use the VC7.1 versions. For Visual Studio 2005, use the VC8 versions.

The directory containing the versions of these libraries specific to your compiler must be in your PATH before any other version of those libraries. The .dll and .lib files must be executable (just chmod 755 them) or cygwin will not load them.

See Windows Build Prerequisites for more tips on building with VC7 and newer.

There are also some alternative static libraries available in bug 242870 that may be used instead of compiler specific libraries.

If you are building with VC6, then you must make sure that you are not using the VC7 libraries at buildtime or at runtime.

 

configure: error: the linker major version, , does not match the compiler suite version, 6.
The cygwin tool "link.exe" is being confused for an object linker. Make sure that the Microsoft tools are before cygwin in your PATH, or rename or remove /bin/link.exe

 

configure: error: installation or configuration problem: C compiler cannot create executables.
Try checking to make sure your PATH variable includes all the necessary directories. If you are using MS Visual Studio, run vcvars32.bat (which sets your PATH, LIB, and INCLUDE variables). If your build environment has changed, you may need to delete your config.cache file (in your mozilla or object directory) and then build again.

 

fatal error LNK1112: module machine type 'IA64' conflicts with target machine type 'X86'
Try changing the order of the directories in your PATH, LIB, and INCLUDE variables. Move any directories that include "win64" or "IA64" (or "AMD64") closer to the end.

 

LINK : fatal error LNK1104: cannot open file 'atlthunk.lib'
According to this Microsoft forum thread, there is a different version of the Active Template Library (ATL) in the free Platform Software Development Kit (PSDK) than in Visual Studio. The ATL in the PSDK does not support 32-bit code, only 64-bit, whereas the Visual Studio ATL supports both and does not require atlthunk.lib. Apparently the atlthunk.lib file is not available and cannot be built from freely available tools, including the Visual C++ Toolkit and Visual Studio Express. You can either upgrade to the full version of Visual Studio to use its version of ATL, or you can workaround this problem by changing some code in atlbase.h (in \include\atl under the PSDK directory) as follows.
--- atlbase.h.old       2006-06-08 08:20:26.671875000 -0400
+++ atlbase.h   2006-06-08 08:13:26.578125000 -0400
@@ -283,7 +283,7 @@
         }
 };
 #pragma pack(pop)
-
+/*
 PVOID __stdcall __AllocStdCallThunk(VOID);
 VOID  __stdcall __FreeStdCallThunk(PVOID);

@@ -291,6 +291,11 @@
 #define FreeStdCallThunk(p) __FreeStdCallThunk(p)

 #pragma comment(lib, "atlthunk.lib")
+*/
+
+// workaround for not having atlthunk.lib in PSDK or VC++ 2005 Express Edition
+#define AllocStdCallThunk() HeapAlloc(GetProcessHeap(),0,sizeof(_stdcallthunk))
+#define FreeStdCallThunk(p) HeapFree(GetProcessHeap(), 0, p)

 #elif defined (_M_AMD64)
 #pragma pack(push,2)

I also had to delete the object directory and compile from scratch in order for the compiler to pick up this change.

 

compiling or building an executable with cygwin and VS6.0 results in FIND: Parameter format not correct
There is confusion between System32 "find" and cygwin's /usr/bin/find. The desired find is cygwin's. This is caused by Path ordering. A few possible solutions are possible:
  • temporarily rename system32/find.exe
  • make sure cygwin path entry comes before system32 path entry

 

I packaged Firefox via the installer: <tt>make -C ${OBJ_DIR}/browser/installer installer</tt> without any problems. Executing the resulting installer asks for a missing mozz.dll; installation fails
Both Thunderbird and Firefox should be compiled with the --enable-static --disable-shared configure flags

 

 

build fails with the message:
shlibsign.exe - Entry Point Not Found
The procedure entry point CERT_GetFirstEmailAddress could not  
be located in the dynamic link library nss3.dll.

You may have multiple instances of nss3.dll on your machine and in your path. Run a seach on your machine for all instances of this file. Move any instances found outside of your firefox build tree aside during the build and rename them back when the build is done.</dd>

 

Unix-specific questions

 

Galeon needs libgtksuperwin.so but I don't have that file in my Mozilla gtk2 builds. Where is it?
Only the Mozilla gtk1 builds build libgtksuperwin.so. If you want to use galeon with a gtk2 build, you will need to use galeon2.

 

Why does configure say that it needs libIDL >= 0.6.3 when I have libIDL 0.8.x installed?
libIDL 0.8x can only be used when compiling against gtk2. Mozilla compiles against gtk1 by default. To use libIDL 0.8.x and gtk2, you must specify --enable-default-toolkit=gtk2 on the configure command line or in your mozconfig file. NOTE: This is an old issue which has been fixed for mozilla 1.8.

 

How do I build on Solaris 10 x86 (Seamonkey)?
I had to do the following to get a working environment
1. Install forte (free from Sun)
2. Install gmake (from blastwave)
3. mv /usr/ucb/cc /usr/ucb/cc.hold
4. CFLAGS="-xlibmil"; export CFLAGS
5. CXXFLAGS="-xlibmil -xlibmopt -features=tmplife -norunpath"; export CXXFLAGS
6. LDFLAGS='-R$ORIGIN -R/usr/sfw/lib -R/opt/sfw/lib -R/usr/local/lib -R/opt/csw/lib'; export LDFLAGS
7. PATH=$PATH:/opt/SUNWspro/bin:/opt/csw/bin:/opt/csw/sbin:/usr/ucb/bin:/usr/ccs/bin; export PATH
8. LD_LIBRARY_PATH=/opt/SUNWspro/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
9. Create a mozconfig file and build as normal
10. The building of the package (tar and gzip) failed so I just manually tarred up the resulting files in the dist directory

 

libxpcom_core.so: cannot restore segment prot after reloc: Permission denied</dt>
You are probably using Fedora Core 5, or some other Linux distrobution that has SELinux turned on. Use the command 'chcon -t chcon -t texrel_shlib_t lib*' in your dist/bin directory to fix it.</dd>

문서 태그 및 공헌자

 이 페이지의 공헌자: teoli, NoBrain
 최종 변경: teoli,