2006-12-19 Paolo Bonzini <bonzini@gnu.org>

* configure.texi: Fix botched commit.
This commit is contained in:
Paolo Bonzini 2006-12-19 14:01:25 +00:00
parent a8ea5eede5
commit 24fa638dbd
2 changed files with 166 additions and 64 deletions

View File

@ -1,3 +1,7 @@
2006-12-19 Paolo Bonzini <bonzini@gnu.org>
* configure.texi: Fix botched commit.
2006-05-31 Daniel Jacobowitz <dan@codesourcery.com> 2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
* texi2pod.pl: Correct handling of absolute @include. * texi2pod.pl: Correct handling of absolute @include.

View File

@ -300,6 +300,12 @@ machine dependent files such as executables.
The default for @samp{--prefix} is @file{/usr/local}. The default for The default for @samp{--prefix} is @file{/usr/local}. The default for
@samp{--exec-prefix} is the value used for @samp{--prefix}. @samp{--exec-prefix} is the value used for @samp{--prefix}.
The convention used in Cygnus releases is to use a @samp{--prefix}
option of @file{/usr/cygnus/@var{release}}, where @var{release} is the
name of the release, and to use a @samp{--exec-prefix} option of
@file{/usr/cygnus/@var{release}/H-@var{host}}, where @var{host} is the
configuration name of the host system (@pxref{Configuration Names}).
Do not use either the source or the object directory as the installation Do not use either the source or the object directory as the installation
directory. That will just lead to confusion. directory. That will just lead to confusion.
@ -1670,9 +1676,12 @@ the autoconf documentation for @samp{AC_ARG_PROGRAM}.
@section Cross Tools in the Cygnus Tree @section Cross Tools in the Cygnus Tree
The Cygnus tree is used for various packages including gdb, the GNU The Cygnus tree is used for various packages including gdb, the GNU
binutils, and egcs. In the Cygnus tree, the top level @file{Makefile.in} binutils, and egcs. It is also, of course, used for Cygnus releases.
In the Cygnus tree, the top level @file{configure} script uses the old
Cygnus configure system, not autoconf. The top level @file{Makefile.in}
is written to build packages based on what is in the source tree, and is written to build packages based on what is in the source tree, and
supports building and bootstrapping a large number of tools in a single supports building a large number of tools in a single
@samp{configure}/@samp{make} step. @samp{configure}/@samp{make} step.
The Cygnus tree may be configured with a @samp{--target} option. The The Cygnus tree may be configured with a @samp{--target} option. The
@ -2123,26 +2132,27 @@ lines with a trailing backslash as a continuation character).
@example @example
mkdir linux-x-cygwin32 mkdir linux-x-cygwin32
cd linux-x-cygwin32 cd linux-x-cygwin32
@var{srcdir}/configure --target i386-cygwin32 --prefix=@var{installdir} @var{srcdir}/configure --target i386-cygwin32 --prefix=@var{installdir} \
--exec-prefix=@var{installdir}/H-i386-linux
make make
make install make install
cd .. cd ..
mkdir linux-x-mips-elf mkdir linux-x-mips-elf
cd linux-x-mips-elf cd linux-x-mips-elf
@var{srcdir}/configure --target mips-elf --prefix=@var{installdir} @var{srcdir}/configure --target mips-elf --prefix=@var{installdir} \
--exec-prefix=@var{installdir}/H-i386-linux
make make
make install make install
cd .. cd ..
mkdir cygwin32-x-mips-elf mkdir cygwin32-x-mips-elf
cd cygwin32-x-mips-elf cd cygwin32-x-mips-elf
@var{srcdir}/configure --build=i386-linux-gnu --host=i386-cygwin32 \ @var{srcdir}/configure --build=i386-linux-gnu --host=i386-cygwin32 \
--target=mips-elf --prefix=@var{wininstalldir} --target=mips-elf --prefix=@var{wininstalldir} \
--exec-prefix=@var{wininstalldir}/H-i386-cygwin32
make make
make install make install
@end example @end example
Note that we specify a different prefix in the last build, because this
does not contain Linux executables, but rather Windows executables.
You would then copy the contents of @var{wininstalldir} over to the You would then copy the contents of @var{wininstalldir} over to the
Windows machine, and run the resulting programs. Windows machine, and run the resulting programs.
@ -2253,63 +2263,152 @@ crucial.
The gcc @file{Makefile.in} shows a complex situation in which certain The gcc @file{Makefile.in} shows a complex situation in which certain
files, such as @file{rtl.c}, must be compiled into both subsidiary files, such as @file{rtl.c}, must be compiled into both subsidiary
programs run on the build system and into the final program. This programs run on the build system and into the final program. This
approach may be of interest for advanced build system hackers. approach may be of interest for advanced build system hackers. Note
that the build system compiler is rather confusingly called
@samp{HOST_CC}.
@node Top level Configure @node Cygnus Configure
@chapter Top level Configure @chapter Cygnus Configure
@cindex top level configure @cindex cygnus configure
The top level configure script detects the tools that are used in the The Cygnus configure script predates autoconf. All of its interesting
Cygnus tree. This script is a rewrite of the Cygnus configure script, features have been incorporated into autoconf. No new programs should
which predated autoconf. be written to use the Cygnus configure script.
The script includes all the logic to detect the host and target tools, However, the Cygnus configure script is still used in a few places: at
and to customize the @file{Makefile} to support the special needs of the top of the Cygnus tree and in a few target libraries in the Cygnus
some systems. tree. Until those uses have been replaced with autoconf, some brief
notes are appropriate here. This is not complete documentation, but it
should be possible to use this as a guide while examining the scripts
themselves.
A particularly delicate point is finding the target tools--these include @menu
the assembler, the linker, and the other @command{binutils} such as * Cygnus Configure Basics:: Cygnus Configure Basics.
@command{nm} or @command{ar}. Some of these need to be invoked by GCC; * Cygnus Configure in C++ Libraries:: Cygnus Configure in C++ Libraries.
others, such as @command{objdump}, are necessary during configuration, in @end menu
order to detect the set of features supported by the assembler and linker.
In general, the top level configure tries to follow these lines in order @node Cygnus Configure Basics
to detect the target tools: @section Cygnus Configure Basics
@table @itemize Cygnus configure does not use any generated files; there is no program
@item try to detect a consistent set of tools corresponding to @samp{autoconf}. Instead, there is a single shell
script named @samp{configure} which may be found at the top of the
Cygnus tree. This shell script was written by hand; it was not
generated by autoconf, and it is incorrect, and indeed harmful, to run
@samp{autoconf} in the top level of a Cygnus tree.
@item try to detect the same tools that the installed GCC will use Cygnus configure works in a particular directory by examining the file
@end table @file{configure.in} in that directory. That file is broken into four
separate shell scripts.
To achieve the first goal, we use the same search criterion for all tools, The first is the contents of @file{configure.in} up to a line that
even those that the compiler never invokes. starts with @samp{# per-host:}. This is the common part.
To achieve the second goal when the @samp{build} and @samp{host} systems The second is the rest of @file{configure.in} up to a line that starts
are the same, we search the same directories that the installed compiler with @samp{# per-target:}. This is the per host part.
will search. This is overridden if the assembler and linker are being
compiled together with GCC, because after installation GCC
will find the tools that were just compiled.
To achieve the second goal when cross compiling (the @samp{build} and The third is the rest of @file{configure.in} up to a line that starts
the @samp{host} systems are different, we ask the installed GCC for the with @samp{# post-target:}. This is the per target part.
name of the tool it uses. This is because the only good choice for a
compiler is the same GCC version that is being installed (@pxref{Cross
Cygnus CCross: Building a Cross Program}), and we assume that on the
host system we'll have not only the same GCC version, but also the same
binutils version.
The location of the target tools can also be specified using the The fourth is the remainder of @file{configure.in}. This is the post
@option{--with-build-time-tools} option to the top level configure target part.
If any of these comment lines are missing, the corresponding shell
script is empty.
Cygnus configure will first execute the common part. This must set the
shell variable @samp{srctrigger} to the name of a source file, to
confirm that Cygnus configure is looking at the right directory. This
may set the shell variables @samp{package_makefile_frag} and
@samp{package_makefile_rules_frag}.
Cygnus configure will next set the @samp{build} and @samp{host} shell
variables, and execute the per host part. This may set the shell
variable @samp{host_makefile_frag}.
Cygnus configure will next set the @samp{target} variable, and execute
the per target part. This may set the shell variable
@samp{target_makefile_frag}.
Any of these scripts may set the @samp{subdirs} shell variable. This
variable is a list of subdirectories where a @file{Makefile.in} file may
be found. Cygnus configure will automatically look for a
@file{Makefile.in} file in the current directory. The @samp{subdirs}
shell variable is not normally used, and I believe that the only
directory which uses it at present is @file{newlib}.
For each @file{Makefile.in}, Cygnus configure will automatically create
a @file{Makefile} by adding definitions for @samp{make} variables such
as @samp{host} and @samp{target}, and automatically editing the values
of @samp{make} variables such as @samp{prefix} if they are present.
Also, if any of the @samp{makefile_frag} shell variables are set, Cygnus
configure will interpret them as file names relative to either the
working directory or the source directory, and will read the contents of
the file into the generated @file{Makefile}. The file contents will be
read in after the first line in @file{Makefile.in} which starts with
@samp{####}.
These @file{Makefile} fragments are used to customize behaviour for a
particular host or target. They serve to select particular files to
compile, and to define particular preprocessor macros by providing
values for @samp{make} variables which are then used during compilation.
Cygnus configure, unlike autoconf, normally does not do feature tests,
and normally requires support to be added manually for each new host.
The @file{Makefile} fragment support is similar to the autoconf
@samp{AC_SUBST_FILE} macro.
After creating each @file{Makefile}, the post target script will be run
(i.e., it may be run several times). This script may further customize
the @file{Makefile}. When it is run, the shell variable @samp{Makefile}
will hold the name of the @file{Makefile}, including the appropriate
directory component.
Like an autoconf generated @file{configure} script, Cygnus configure
will create a file named @file{config.status} which, when run, will
automatically recreate the configuration. The @file{config.status} file
will simply execute the Cygnus configure script again with the
appropriate arguments.
Any of the parts of @file{configure.in} may set the shell variables
@samp{files} and @samp{links}. Cygnus configure will set up symlinks
from the names in @samp{links} to the files named in @samp{files}. This
is similar to the autoconf @samp{AC_LINK_FILES} macro.
Finally, any of the parts of @file{configure.in} may set the shell
variable @samp{configdirs} to a set of subdirectories. If it is set,
Cygnus configure will recursively run the configure process in each
subdirectory. If the subdirectory uses Cygnus configure, it will
contain a @file{configure.in} file but no @file{configure} file, in
which case Cygnus configure will invoke itself recursively. If the
subdirectory has a @file{configure} file, Cygnus configure assumes that
it is an autoconf generated @file{configure} script, and simply invokes
it directly.
@node Cygnus Configure in C++ Libraries
@section Cygnus Configure in C++ Libraries
@cindex @file{libstdc++} configure
@cindex @file{libio} configure
@cindex @file{libg++} configure
The C++ library configure system, written by Per Bothner, deserves
special mention. It uses Cygnus configure, but it does feature testing
like that done by autoconf generated @file{configure} scripts. This
approach is used in the libraries @file{libio}, @file{libstdc++}, and
@file{libg++}.
Most of the @file{Makefile} information is written out by the shell
script @file{libio/config.shared}. Each @file{configure.in} file sets
certain shell variables, and then invokes @file{config.shared} to create
two package @file{Makefile} fragments. These fragments are then
incorporated into the resulting @file{Makefile} by the Cygnus configure
script. script.
If no target-specific tools are found, the top level configure script The file @file{_G_config.h} is created in the @file{libio} object
will try to use the host tools if suitable. directory by running the shell script @file{libio/gen-params}. This
shell script uses feature tests to define macros and typedefs in
The script and the accompanying Makefile support building programs @file{_G_config.h}.
and libraries for either the build, the host or the target system.
The target libraries, however, need to help in order to support
@samp{multilibs}.
@node Multilibs @node Multilibs
@chapter Multilibs @chapter Multilibs
@ -2329,9 +2428,7 @@ called @dfn{multilibs}.
Multilibs are not really part of the GNU configure and build system, but Multilibs are not really part of the GNU configure and build system, but
we discuss them here since they require support in the @file{configure} we discuss them here since they require support in the @file{configure}
scripts and @file{Makefile}s used for target libraries. It is expected scripts and @file{Makefile}s used for target libraries.
that in the future the toplevel will coordinate the building of the
various multilibs, but this has not been implemented yet.
@menu @menu
* Multilibs in gcc:: Multilibs in gcc. * Multilibs in gcc:: Multilibs in gcc.
@ -2479,16 +2576,17 @@ not defined by @samp{autoconf}. You may be using an old version of
newly installled @samp{autoconf} is first on your @samp{PATH}. Also, newly installled @samp{autoconf} is first on your @samp{PATH}. Also,
see the next question. see the next question.
@cindex @samp{AM_GNU_GETTEXT} in @file{configure} @cindex @samp{CY_GNU_GETTEXT} in @file{configure}
@cindex @samp{AM_PROG_LIBTOOL} in @file{configure} @cindex @samp{AM_PROG_LIBTOOL} in @file{configure}
@item My @file{configure} script has stuff like @samp{AM_GNU_GETTEXT} in it. @item My @file{configure} script has stuff like @samp{CY_GNU_GETTEXT} in it.
This means that you have macros in your @file{configure.in} which should This means that you have macros in your @file{configure.in} which should
be defined in your @file{aclocal.m4} file, but aren't. This usually be defined in your @file{aclocal.m4} file, but aren't. This usually
means that @samp{aclocal} was not able to appropriate definitions of the means that @samp{aclocal} was not able to appropriate definitions of the
macros. Make sure that you have installed all the packages you need. macros. Make sure that you have installed all the packages you need.
In particular, make sure that you have installed libtool (this is where In particular, make sure that you have installed libtool (this is where
@samp{AM_PROG_LIBTOOL} is defined) and gettext (this is where @samp{AM_PROG_LIBTOOL} is defined) and gettext (this is where
@samp{AM_GNU_GETTEXT} is defined). @samp{CY_GNU_GETTEXT} is defined, at least in the Cygnus version of
gettext).
@cindex @file{Makefile}, garbage characters @cindex @file{Makefile}, garbage characters
@item My @file{Makefile} has @samp{@@} characters in it. @item My @file{Makefile} has @samp{@@} characters in it.
@ -2513,16 +2611,16 @@ regenerate all files (@file{Makefile}, @file{config.h}, etc.) based on
the results of the configure script. The two cases are separate because the results of the configure script. The two cases are separate because
it isn't always necessary to regenerate all the files after running it isn't always necessary to regenerate all the files after running
@samp{config.status --recheck}. The @file{Makefile} targets generated @samp{config.status --recheck}. The @file{Makefile} targets generated
by automake will use command-line arguments to only regenerate files by automake will use the environment variables @samp{CONFIG_FILES} and
as they are needed. @samp{CONFIG_HEADERS} to only regenerate files as they are needed.
@item What is the Cygnus tree? @item What is the Cygnus tree?
The Cygnus tree is used for various packages including gdb, the GNU The Cygnus tree is used for various packages including gdb, the GNU
binutils, and egcs. It is a derivative of the build system which was binutils, and egcs. It is also, of course, used for Cygnus releases.
developed at Cygnus, using the Cygnus configure script. It permits It is the build system which was developed at Cygnus, using the Cygnus
building and bootstrapping many different packages with a single configure configure script. It permits building many different packages with a
and make. The configure scripts in the tree have been converted to single configure and make. The configure scripts in the tree are being
autoconf, but the general build structure remains intact. converted to autoconf, but the general build structure remains intact.
@item Why do I have to keep rebuilding and reinstalling the tools? @item Why do I have to keep rebuilding and reinstalling the tools?
I know, it's a pain. Unfortunately, there are bugs in the tools I know, it's a pain. Unfortunately, there are bugs in the tools