<html>
<head>
<title>Configuring egcs</title>
</head>
<body>
<h1 align="center">Configuring egcs</h1>

<p>Like most GNU software, egcs must be configured before it can be built.
This document attempts to describe the recommended configuration procedure
for both native and cross targets.

<p>We use <i>srcdir</i> to refer to the toplevel source directory for
egcs; we use <i>objdir</i> to refer to the toplevel build/object
directory for egcs.

<p>First, we <b>highly</b> recommend that egcs be built into a
separate directory than the sources which does <b>not</b> reside
within the source tree.  This is how we generally build egcs; building
where <i>srcdir</i> == <i>objdir</i> should still work, but doesn't
get extensive testing; building where <i>objdir</i> is a subdirectory
of <i>srcdir</i> is unsupported.

<p>Second, when configuring a native system, either "cc" or "gcc" must be in
your path or you must set CC in your environment before running configure.
Otherwise the configuration scripts may fail.

<p>To configure egcs:

<blockquote>
<tt>
  <br>% mkdir <i>objdir</i>
  <br>% cd <i>objdir</i>
  <br>% <i>srcdir</i>/configure <b>[target]</b> <b>[options]</b>
</tt>
</blockquote>


<p><b>target specification</b>
<ul>
  <li> egcs has code to correctly determine the correct value for
  <b>target</b> for nearly all native systems.  Therefore, we highly
  recommend you not provide a configure target when configuring a
  native compiler.

  <li> <b>target</b> must be specified when configuring a cross compiler;
  examples of valid targets would be i960-rtems, m68k-coff, sh-elf, etc.
</ul>


<p><b> options specification</b>

<p>Use <b>options</b> to override several configure time options for
egcs.  A partial list of supported <tt>options</tt>:

<ul>
  <li> <tt>--prefix=</tt><i>dirname</i> -- Specify the toplevel installation
  directory.  This is the recommended way to install the tools into a directory
  other than the default.  The toplevel installation directory defaults to
  /usr/local.

  <p> We <b>highly</b> recommend against <i>prefix</i> being the same or a
  subdirectory of <i>objdir</i> or vice versa.

  <p>These additional options control where certain parts of the distribution
  are installed.  Normally you should not need to use these options.
  <ul>
     <li> <tt>--with-local-prefix=</tt><i>dirname</i> -- Specify the installation
     directory for local include files.  The default is /usr/local.

     <li> <tt>--with-gxx-include-dir=</tt><i>dirname</i> -- Specify the installation
     directory for g++ header files.  The default is /usr/local/include/g++.
  </ul>

  <li> <tt>--enable-shared</tt> -- Build shared versions of the C++ runtime
  libraries if supported <tt>--disable-shared</tt> is the default.

  <li> <tt>--enable-haifa</tt> -- Enable the new Haifa instruction scheduler
  in the compiler; the new scheduler can significantly improve code on some
  targets.
  <br>For egcs-1.0.x releases <tt>--disable-haifa</tt> is the default on all
  platforms except the HPPA.
  <br>For newer releases <tt>--disable-haifa</tt> is the default on all
  platforms except the alpha, hppa, powerpc, rs6000, SPARC and m32r.

  <li> <tt>--with-gnu-as</tt> -- Specify that the compiler should assume the GNU
  assembler (aka gas) is available. 

  <li> <tt>--with-gnu-ld</tt> -- Specify that the compiler should assume the GNU
  linker (aka gld) is available. 

  <li> <tt>--with-stabs</tt> -- Specify that stabs debugging information should be used
  instead of whatever format the host normally uses.  Normally GCC uses the
  same debug format as the host system. 

  <li> <tt>--enable-multilib</tt> -- Specify that multiple target libraries
  should be built to support different target variants, calling conventions,
  etc.  This is the default. 

  <li> <tt>--enable-threads</tt> -- Specify that the target supports threads.
  This only effects the Objective-C compiler and runtime library.

  <li> <tt>--enable-threads=</tt><i>lib</i> -- Specify that <i>lib</i> is the
  thread support library.  This only effects the Objective-C compiler  and
  runtime library.

  <li> <tt>--with-cpu=</tt><i>cpu</i> -- Specify which cpu variant the
  compiler should generate code for by default.  This is currently
  only supported on the some ports, specifically arm, powerpc, and
  SPARC. If configure does not recognize the model name (e.g. arm700,
  603e, or ultrasparc) you provide, please check the configure script
  for a complete list of supported models.

  <li> <tt>--enable-target-optspace</tt> -- Specify that target libraries should  be optimzied for code space instead of code speed.  This is the default for
  the m32r platform.

  <li> <tt>--enable-cpp</tt> -- Specify that a shell script which emulates
  traditional cpp functionality should be installed.

  <li> <tt>--enable-cpplib</tt> -- Specify that the functionality of CPP should
  be integrated into the compiler itself.  This is still under development, but
  may be useful in limited situations.  This option is never enabled by default.

  <li> <tt>--with-fast-fixincludes</tt> -- Specify that a newer and faster
  method of fixing the system header files should be used.  This feature is
  still under development, but we are interested in feedback from folks that
  want to try it.  This option is never enabled by default..

  <li> <tt>--enable-version-specific-runtime-libs</tt> -- Specify that runtime
  libraries should be installed in the compiler specific subdirectory
  (<tt>${libsubdir}</tt>) rather than the usual places.
  In addition, libstdc++'s include files will be installed in
  <tt>${libsubdir}/include/g++</tt> unless you overruled it by using
  <tt>--with-gxx-include-dir=</tt><i>dirname</i>.
  Using this option is particularly useful if you intend to use several
  versions of egcs/gcc in parallel. This is currently supported by <tt>libf2c</tt>
  and <tt>libstdc++</tt>.

  <li> <tt>--enable-languages=</tt><i>lang1</i><tt>,</tt><i>lang2</i><tt>,...</tt>
  -- Specify that only a particular subset of compilers and their runtime libraries
  should be built. For a list of valid values for <i>lang</i><t>x</t> you can issue
  the following command in the <tt>gcc</tt> directory of your egcs source tree:<br>
  <tt>
  grep language= */config-lang.in
  </tt><br>
  Currently, you can use any of the following: <tt>CHILL</tt>, <tt>c++</tt>,
  <tt>f77</tt>, <tt>java</tt> and <tt>objc</tt>. Please note, that this switch
  will only work with recent snapshots (for instance, newer snapshots than
  19981126 should do); it does not work with any egcs releases up to and
  including 1.1.1, though!<br>
  If you do not pass this flag, all languages available in the <tt>gcc</tt> sub-tree
  will be configured.  Re-defining LANGUAGES when calling <tt>make bootstrap</tt>
  <b>*does not*</b> work anymore, as those language sub-directories might not have been
  configured!
  <li> <tt>--with-dwarf2</tt> -- Specify that the compiler should use DWARF2
  debugging information as the default.

</ul>

<p>Some options which only apply to building cross compilers:
<ul>
  <li> <tt>--with-headers=</tt><i>dir</i> -- Specifies a directory which has
  target include files.  These include files will be copied into the egcs
  install directory.  Fixincludes will be run on these files to make them
  compatible with egcs.
  <li> <tt>--with-libs=</tt><i>dirs</i> -- Specifies a list of directories
  which contain the target runtime libraries.  These libraries will be
  copied into the egcs install directory.
  <li> <tt>--with-newlib</tt> -- Specifies that "newlib" is being used as the target
  C library.   This causes __eprintf to be omitted from libgcc.a on the
  assumption that it will be provided by newlib.
</ul>
 
<p>Note that each <tt>--enable</tt> option has a corresponding <tt>--disable</tt> option and
that each <tt>--with</tt> option has a corresponding <tt>--without</tt> option.


<p>
<hr>
<i>Last modified on Dec   6, 1998.</i>

</body>
</html>
