@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-@c 1999, 2000, 2001 Free Software Foundation, Inc.
+@c 1999, 2000, 2001, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@chapter Makefile Fragments
@cindex makefile fragment
-When you configure GCC using the @file{configure} script,
-it will construct the file @file{Makefile} from
-the template file @file{Makefile.in}. When it does this, it will
-incorporate makefile fragment files from the @file{config} directory,
-named @file{t-@var{target}} and @file{x-@var{host}}. If these files do
-not exist, it means nothing needs to be added for a given target or
-host.
+When you configure GCC using the @file{configure} script, it will
+construct the file @file{Makefile} from the template file
+@file{Makefile.in}. When it does this, it can incorporate makefile
+fragments from the @file{config} directory. These are used to set
+Makefile parameters that are not amenable to being calculated by
+autoconf. The list of fragments to incorporate is set by
+@file{config.gcc} (and occasionally @file{config.build}
+and @file{config.host}); @xref{System Config}.
+
+Fragments are named either @file{t-@var{target}} or @file{x-@var{host}},
+depending on whether they are relevant to configuring GCC to produce
+code for a particular target, or to configuring GCC to run on a
+particular host. Here @var{target} and @var{host} are mnemonics
+which usually have some relationship to the canonical system name, but
+no formal connection.
+
+If these files do not exist, it means nothing needs to be added for a
+given target or host. Most targets need a few @file{t-@var{target}}
+fragments, but needing @file{x-@var{host}} fragments is rare.
@menu
-* Target Fragment:: Writing the @file{t-@var{target}} file.
-* Host Fragment:: Writing the @file{x-@var{host}} file.
+* Target Fragment:: Writing @file{t-@var{target}} files.
+* Host Fragment:: Writing @file{x-@var{host}} files.
@end menu
@node Target Fragment
-@section The Target Makefile Fragment
+@section Target Makefile Fragments
@cindex target makefile fragment
@cindex @file{t-@var{target}}
-The target makefile fragment, @file{t-@var{target}}, defines special
-target dependent variables and targets used in the @file{Makefile}:
+Target makefile fragments can set these Makefile variables.
@table @code
@findex LIBGCC2_CFLAGS
case, set @code{MULTILIB_EXCEPTIONS} to be all of the switch exceptions
in shell case syntax that should not be built.
-For example, in the PowerPC embedded ABI support, it is not desirable
-to build libraries compiled with the @option{-mcall-aix} option
-and either of the @option{-fleading-underscore} or @option{-mlittle} options
-at the same time. Therefore @code{MULTILIB_EXCEPTIONS} is set to
+For example the ARM processor cannot execute both hardware floating
+point instructions and the reduced size THUMB instructions at the same
+time, so there is no need to build libraries with both of these
+options enabled. Therefore @code{MULTILIB_EXCEPTIONS} is set to:
@smallexample
-*mcall-aix/*fleading-underscore* *mlittle/*mcall-aix*
+*mthumb/*mhard-float*
@end smallexample
@findex MULTILIB_EXTRA_OPTS
Sometimes it is desirable that when building multiple versions of
@file{libgcc.a} certain options should always be passed on to the
compiler. In that case, set @code{MULTILIB_EXTRA_OPTS} to be the list
-of options to be used for all builds.
+of options to be used for all builds. If you set this, you should
+probably set @code{CRTSTUFF_T_CFLAGS} to a dash followed by it.
+
+@findex NATIVE_SYSTEM_HEADER_DIR
+@item NATIVE_SYSTEM_HEADER_DIR
+If the default location for system headers is not @file{/usr/include},
+you must set this to the directory containing the headers. This value
+should match the value of the @code{SYSTEM_INCLUDE_DIR} macro.
+
+@findex SPECS
+@item SPECS
+Unfortunately, setting @code{MULTILIB_EXTRA_OPTS} is not enough, since
+it does not affect the build of target libraries, at least not the
+build of the default multilib. One possible work-around is to use
+@code{DRIVER_SELF_SPECS} to bring options from the @file{specs} file
+as if they had been passed in the compiler driver command line.
+However, you don't want to be adding these options after the toolchain
+is installed, so you can instead tweak the @file{specs} file that will
+be used during the toolchain build, while you still install the
+original, built-in @file{specs}. The trick is to set @code{SPECS} to
+some other filename (say @file{specs.install}), that will then be
+created out of the built-in specs, and introduce a @file{Makefile}
+rule to generate the @file{specs} file that's going to be used at
+build time out of your @file{specs.install}.
+
+@item T_CFLAGS
+These are extra flags to pass to the C compiler. They are used both
+when building GCC, and when compiling things with the just-built GCC@.
+This variable is deprecated and should not be used.
@end table
@node Host Fragment
-@section The Host Makefile Fragment
+@section Host Makefile Fragments
@cindex host makefile fragment
@cindex @file{x-@var{host}}
-The host makefile fragment, @file{x-@var{host}}, defines special host
-dependent variables and targets used in the @file{Makefile}:
-
-@table @code
-@findex CC
-@item CC
-The compiler to use when building the first stage.
-
-@findex INSTALL
-@item INSTALL
-The install program to use.
-@end table
+The use of @file{x-@var{host}} fragments is discouraged. You should only
+use it for makefile dependencies.