Build:Configure System Rewrite

From MozillaWiki
Jump to: navigation, search

The Mozilla build system is currently configured using a configure script generated by autoconf (2.13). This system is barely adequate for Mozilla's needs and creates significant pain for both new hackers and experienced maintainers. Therefore we are proposing to gradually rewrite just the configuration portions of the Mozilla build system.

What We're Not Doing

We are not rewriting the make-driven recursive build system (yet). We may rework portions of that build system in the future, but the focus of this effort is entirely on the configuration system.

What Are We Solving?

  • The Mozilla build system can be used to produce a large variety of products with many features. The main build system should not need to know about each product and its features when configuring the build.
  • The autoconf build system deals poorly with Windows compilers, and has poor support for multiple sets of build flags, e.g., for building dylibs, plugin dylibs, executable files, etc.

Proposed Solution

Gradually rewrite pieces of the configure system in python instead of M4/shell scripting. The goal is to have this be a gradual process, rather than having to rewrite all 7900+ lines of configure scripts at once. This will be approached in two directions:

  • Replace individual subshell scripts and M4 macros with python scripts and functions.
    • This can start with simple external scripts such as config.guess and config.sub
    • Continue with more complex scripts such as config.status and replacing configure macros such as AC_CHECK_HEADERS with calls external python modules
  • Replace the autoconf M4 scripts with M4 scripts that produce a python script for configure

Other notes

  • The configure script will require python 2.4
  • For initial "getting it to work" we will ignore cross-compiling (keeping it in mind in terms of design)
  • Unit-tests will be producing an autoconf.mk that is identical with the old system
  • Development is targeted at Mozilla 2 and will take place in an Hg repository

Milestones

Developing milestones for this effort is very hard because it's not clear from which direction we will approach each individual autoconf macro. The overall goal is to be done by the end of December 2007. The following sub-milestones are pretty variable:

  • July 2007 - Create the Hg repository and import autoconf sources into it for hackery, create a test framework (using a VMWare team?)
  • August-Sep 2007
  • Sep-Oct 2007 - Replace custom shell scripting with custom parameterized M4 macros which can produce python and shell equivalents
  • Sep-Oct 2007 - Replace AC_INIT/AC_CANONICAL_SYSTEM
  • Nov 2007 - Make M4 macros produce a native python script instead of a shell script
  • Dec 2007 - Clean up poor python scripting produced by the change