configure.in

  • Revision slug: configure.in
  • Revision title: configure.in
  • Revision id: 287135
  • Created:
  • Creator: Nickolay
  • Is current revision? No
  • Comment minor markup tweaks

Revision Content

The Mozilla {{ Source("configure") }} script is a standard method of determining compiler and system capabilities and options for Linux-based software. Mozilla uses <tt>configure</tt> on all platforms. <tt>configure</tt> is a shell script generated from an template file {{ Source("configure.in") }}, using Autoconf.

Here's an example of how to add a configure option to the build. Please consult the build system owner (Benjamin Smedberg) before adding configure options. New options will only be accepted if they are going to be maintained and tested appropriately.

MOZ_ARG_ENABLE_BOOL(foo,
[  --enable-foo     Insert some documentation here. Try to keep the spacing lined up right.],
    MOZ_FOO=1,
    MOZ_FOO=)

dnl AC_SUBST will replace @MOZ_FOO@ in makefiles.
AC_SUBST(MOZ_FOO)

dnl If you need to use #ifdef MOZ_FOO in C/C++ code, use AC_DEFINE. In most cases this
dnl is unnecessary, as Makefile ifdefs are sufficient.
if test -n "$MOZ_FOO"; then
  AC_DEFINE(MOZ_FOO)
fi

After editing <tt>configure.in</tt>, regenerate <tt>configure</tt> by running Autoconf 2.13. On most systems, the command is <tt>autoconf-2.13</tt>.

Autoconf 2.5x will not work. See {{ Bug(104642) }} for details.

In {{ Source("config/autoconf.mk.in") }}, add the MOZ_FOO variable to the list of substituted variables:

MOZ_FOO = @MOZ_FOO@

Since <tt>autoconf.mk</tt> is included at the top of every Mozilla Makefile, the MOZ_FOO variable will be available to every makefile.

Revision Source

<p>The Mozilla {{ Source("configure") }} script is a standard method of determining compiler and system capabilities and options for Linux-based software. Mozilla uses <tt>configure</tt> on all platforms. <tt>configure</tt> is a shell script generated from an template file {{ Source("configure.in") }}, using <a class="external" href="http://www.gnu.org/software/autoconf/">Autoconf</a>.
</p><p>Here's an example of how to add a configure option to the <a href="en/How_Mozilla's_build_system_works">build</a>. Please consult the build system owner (<a href="User:Benjamin_Smedberg">Benjamin Smedberg</a>) before adding configure options. New options will only be accepted if they are going to be maintained and tested appropriately.
</p>
<pre class="eval">MOZ_ARG_ENABLE_BOOL(foo,
[  --enable-foo     Insert some documentation here. Try to keep the spacing lined up right.],
    MOZ_FOO=1,
    MOZ_FOO=)

dnl AC_SUBST will replace @MOZ_FOO@ in makefiles.
AC_SUBST(MOZ_FOO)

dnl <b>If you need to use #ifdef MOZ_FOO in C/C++ code, use AC_DEFINE. In most cases this</b>
dnl <b>is unnecessary, as Makefile ifdefs are sufficient.</b>
if test -n "$MOZ_FOO"; then
  AC_DEFINE(MOZ_FOO)
fi
</pre>
<p>After editing <tt>configure.in</tt>, regenerate <tt>configure</tt> by running Autoconf 2.13. On most systems, the command is <tt>autoconf-2.13</tt>.
</p>
<div class="note">Autoconf 2.5x will not work. See {{ Bug(104642) }} for details.</div>
<p>In {{ Source("config/autoconf.mk.in") }}, add the <code>MOZ_FOO</code> variable to the list of substituted variables:
</p>
<pre class="eval">MOZ_FOO = @MOZ_FOO@
</pre>
<p>Since <tt>autoconf.mk</tt> is <a href="en/Standard_Makefile_Header">included at the top of every Mozilla Makefile</a>, the <code>MOZ_FOO</code> variable will be available to every makefile.
</p>
Revert to this revision