411 |
|
|
412 |
* Changed Quotation:: Broken code which used to work |
* Changed Quotation:: Broken code which used to work |
413 |
* New Macros:: Interaction with foreign macros |
* New Macros:: Interaction with foreign macros |
414 |
|
* Hosts and Cross-Compilation:: Bugward compatibility kludges |
415 |
|
|
416 |
Generating Test Suites with Autotest |
Generating Test Suites with Autotest |
417 |
|
|
3204 |
|
|
3205 |
@defmac AC_CHECK_TOOLS (@var{variable}, @var{progs-to-check-for}, @ovar{value-if-not-found}, @ovar{path}) |
@defmac AC_CHECK_TOOLS (@var{variable}, @var{progs-to-check-for}, @ovar{value-if-not-found}, @ovar{path}) |
3206 |
@acindex CHECK_TOOLS |
@acindex CHECK_TOOLS |
3207 |
Like @code{AC_CHECK_TOOL}, each of the tools in the list @var{progs-to-check-for} are |
Like @code{AC_CHECK_TOOL}, each of the tools in the list |
3208 |
checked with a prefix of the host type as determined by @code{AC_CANONICAL_HOST}, |
@var{progs-to-check-for} are checked with a prefix of the host type as |
3209 |
followed by a dash (@pxref{Canonicalizing}). If none of the tools can be found with a |
determined by @code{AC_CANONICAL_HOST}, followed by a dash |
3210 |
prefix, then the first one without a prefix is used. If a tool is found, set |
(@pxref{Canonicalizing}). If none of the tools can be found with a |
3211 |
@var{variable} to the name of that program. If none of the tools in the |
prefix, then the first one without a prefix is used. If a tool is found, |
3212 |
list are found, set @var{variable} to @var{value-if-not-found}; if |
set @var{variable} to the name of that program. If none of the tools in |
3213 |
|
the list are found, set @var{variable} to @var{value-if-not-found}; if |
3214 |
@var{value-if-not-found} is not specified, the value of @var{variable} |
@var{value-if-not-found} is not specified, the value of @var{variable} |
3215 |
is not changed. Calls @code{AC_SUBST} for @var{variable}. |
is not changed. Calls @code{AC_SUBST} for @var{variable}. |
3216 |
@end defmac |
@end defmac |
9568 |
Alternately, the user can specify the system type with command line |
Alternately, the user can specify the system type with command line |
9569 |
arguments to @command{configure}. Doing so is necessary when |
arguments to @command{configure}. Doing so is necessary when |
9570 |
cross-compiling. In the most complex case of cross-compiling, three |
cross-compiling. In the most complex case of cross-compiling, three |
9571 |
system types are involved. The options to specify them are@footnote{For |
system types are involved. The options to specify them are: |
|
backward compatibility, @command{configure} will accept a system type as an |
|
|
option by itself. Such an option will override the defaults for build, |
|
|
host and target system types. The following configure statement will |
|
|
configure a cross toolchain that will run on NetBSD/alpha but generate |
|
|
code for GNU Hurd/sparc, which is also the build platform. |
|
|
|
|
|
@example |
|
|
./configure --host=alpha-netbsd sparc-gnu |
|
|
@end example |
|
|
}: |
|
9572 |
|
|
9573 |
@table @option |
@table @option |
9574 |
@item --build=@var{build-type} |
@item --build=@var{build-type} |
9575 |
the type of system on which the package is being configured and |
the type of system on which the package is being configured and |
9576 |
compiled. |
compiled. It defaults to the result of running @command{config.guess}. |
9577 |
|
|
9578 |
@item --host=@var{host-type} |
@item --host=@var{host-type} |
9579 |
@ovindex cross_compiling |
@ovindex cross_compiling |
9580 |
the type of system on which the package will run. |
the type of system on which the package will run. By default it is the |
9581 |
|
same as the build machine. Specifying it enables the cross-compilation |
9582 |
|
mode. |
9583 |
|
|
9584 |
@item --target=@var{target-type} |
@item --target=@var{target-type} |
9585 |
the type of system for which any compiler tools in the package will |
the type of system for which any compiler tools in the package will |
9586 |
produce code (rarely needed). By default, it is the same as host. |
produce code (rarely needed). By default, it is the same as host. |
9587 |
@end table |
@end table |
9588 |
|
|
9589 |
They all default to the result of running @command{config.guess}, unless |
If you mean to override the result of @command{config.guess}, use |
9590 |
you specify either @option{--build} or @option{--host}. In this case, the |
@option{--build}, not @option{--host}, which enables cross-compilation. |
9591 |
default becomes the system type you specified. If you specify both, and |
For historical reasons, passing @option{--host} also changes the build |
9592 |
they're different, @command{configure} will enter cross compilation mode, |
type. Therefore, whenever you specify @code{--host}, be sure to specify |
9593 |
so it won't run any tests that require execution. |
@code{--build} too. This will be fixed in the future. |
|
|
|
|
Hint: if you mean to override the result of @command{config.guess}, prefer |
|
|
@option{--build} over @option{--host}. In the future, @option{--host} will |
|
|
not override the name of the build system type. Also, if you specify |
|
|
@option{--host}, but not @option{--build}, when @command{configure} performs |
|
|
the first compiler test it will try to run an executable produced by the |
|
|
compiler. If the execution fails, it will enter cross-compilation mode. |
|
|
Note, however, that it won't guess the build-system type, since this may |
|
|
require running test programs. Moreover, by the time the compiler test |
|
|
is performed, it may be too late to modify the build-system type: other |
|
|
tests may have already been performed. Therefore, whenever you specify |
|
|
@code{--host}, be sure to specify @code{--build} too. |
|
9594 |
|
|
9595 |
@example |
@example |
9596 |
./configure --build=i686-pc-linux-gnu --host=m68k-coff |
./configure --build=i686-pc-linux-gnu --host=m68k-coff |
9605 |
./configure CC=m68k-coff-gcc |
./configure CC=m68k-coff-gcc |
9606 |
@end example |
@end example |
9607 |
|
|
9608 |
|
@cindex @command{config.sub} |
9609 |
@command{configure} recognizes short aliases for many system types; for |
@command{configure} recognizes short aliases for many system types; for |
9610 |
example, @samp{decstation} can be used instead of |
example, @samp{decstation} can be used instead of |
9611 |
@samp{mips-dec-ultrix4.2}. @command{configure} runs a script called |
@samp{mips-dec-ultrix4.2}. @command{configure} runs a script called |
9612 |
@command{config.sub} to canonicalize system type aliases. |
@command{config.sub} to canonicalize system type aliases. |
9613 |
|
|
9614 |
|
This section deliberately omits the description of the obsolete |
9615 |
|
interface, see @ref{Hosts and Cross-Compilation}. |
9616 |
|
|
9617 |
|
|
9618 |
@node Canonicalizing |
@node Canonicalizing |
9671 |
If @option{--host} was specified, then @code{host} is the |
If @option{--host} was specified, then @code{host} is the |
9672 |
canonicalization of @code{host_alias} by @command{config.sub}, |
canonicalization of @code{host_alias} by @command{config.sub}, |
9673 |
otherwise it defaults to @code{build}. |
otherwise it defaults to @code{build}. |
|
|
|
|
For temporary backward-compatibility, when @option{--host} is specified |
|
|
by @option{--build} isn't, the build system will be assumed to be the |
|
|
same as @option{--host}, and @samp{build_alias} will be set to that |
|
|
value. Eventually, this historically incorrect behavior will go away. |
|
|
|
|
9674 |
@end defmac |
@end defmac |
9675 |
|
|
9676 |
@defmac AC_CANONICAL_TARGET |
@defmac AC_CANONICAL_TARGET |
9688 |
otherwise it defaults to @code{host}. |
otherwise it defaults to @code{host}. |
9689 |
@end defmac |
@end defmac |
9690 |
|
|
9691 |
|
Note that there can be artifacts due to the backward compatibility |
9692 |
|
code. @xref{Hosts and Cross-Compilation}, for more. |
9693 |
|
|
9694 |
@node Using System Type |
@node Using System Type |
9695 |
@section Using the System Type |
@section Using the System Type |
10003 |
If any of the options described below are given to @command{configure}, |
If any of the options described below are given to @command{configure}, |
10004 |
program names are transformed accordingly. Otherwise, if |
program names are transformed accordingly. Otherwise, if |
10005 |
@code{AC_CANONICAL_TARGET} has been called and a @option{--target} value |
@code{AC_CANONICAL_TARGET} has been called and a @option{--target} value |
10006 |
is given that differs from the host type (specified with @option{--host}), |
is given, the target type followed by a dash is used as a prefix. |
10007 |
the target type followed by a dash is used as a prefix. Otherwise, no |
Otherwise, no program name transformation is done. |
|
program name transformation is done. |
|
10008 |
@end defmac |
@end defmac |
10009 |
|
|
10010 |
@menu |
@menu |
11492 |
@menu |
@menu |
11493 |
* Changed Quotation:: Broken code which used to work |
* Changed Quotation:: Broken code which used to work |
11494 |
* New Macros:: Interaction with foreign macros |
* New Macros:: Interaction with foreign macros |
11495 |
|
* Hosts and Cross-Compilation:: Bugward compatibility kludges |
11496 |
@end menu |
@end menu |
11497 |
|
|
11498 |
@node Changed Quotation |
@node Changed Quotation |
11622 |
@end example |
@end example |
11623 |
|
|
11624 |
|
|
11625 |
|
@node Hosts and Cross-Compilation |
11626 |
|
@subsection Hosts and Cross-Compilation |
11627 |
|
|
11628 |
|
Based on the experience of compiler writers, and after long public |
11629 |
|
debates, many aspects of the cross-compilation chain have changed: |
11630 |
|
|
11631 |
|
@itemize @minus |
11632 |
|
@item |
11633 |
|
the relationship between the build, host, and target architecture types, |
11634 |
|
|
11635 |
|
@item |
11636 |
|
the command line interface for specifying them to @command{configure}, |
11637 |
|
|
11638 |
|
@item |
11639 |
|
the variables defined in @command{configure}, |
11640 |
|
|
11641 |
|
@item |
11642 |
|
the enabling of cross-compilation mode. |
11643 |
|
@end itemize |
11644 |
|
|
11645 |
|
@sp 1 |
11646 |
|
|
11647 |
|
The relationship between build, host, and target have been cleaned up: |
11648 |
|
the chain of default is now simply: target defaults to host, host to |
11649 |
|
build, and build to the result of @command{config.guess}. Nevertheless, |
11650 |
|
in order to ease the transition from 2.13 to 2.50, the following |
11651 |
|
transition scheme is implemented. @emph{Do not rely on it}, as it will |
11652 |
|
be completely disabled in a couple of releases (we cannot keep it, as it |
11653 |
|
proves to cause more problems than to cure). |
11654 |
|
|
11655 |
|
They all default to the result of running @command{config.guess}, unless |
11656 |
|
you specify either @option{--build} or @option{--host}. In this case, |
11657 |
|
the default becomes the system type you specified. If you specify both, |
11658 |
|
and they're different, @command{configure} will enter cross compilation |
11659 |
|
mode, so it won't run any tests that require execution. |
11660 |
|
|
11661 |
|
Hint: if you mean to override the result of @command{config.guess}, |
11662 |
|
prefer @option{--build} over @option{--host}. In the future, |
11663 |
|
@option{--host} will not override the name of the build system type. |
11664 |
|
Whenever you specify @code{--host}, be sure to specify @code{--build} |
11665 |
|
too. |
11666 |
|
|
11667 |
|
@sp 1 |
11668 |
|
|
11669 |
|
For backward compatibility, @command{configure} will accept a system |
11670 |
|
type as an option by itself. Such an option will override the defaults |
11671 |
|
for build, host and target system types. The following configure |
11672 |
|
statement will configure a cross toolchain that will run on NetBSD/alpha |
11673 |
|
but generate code for GNU Hurd/sparc, which is also the build platform. |
11674 |
|
|
11675 |
|
@example |
11676 |
|
./configure --host=alpha-netbsd sparc-gnu |
11677 |
|
@end example |
11678 |
|
|
11679 |
|
@sp 1 |
11680 |
|
|
11681 |
|
In Autoconf, the variables @code{build}, @code{host}, and @code{target} |
11682 |
|
had a different semantics before and after the invocation of |
11683 |
|
@code{AC_CANONICAL_BUILD} etc. Now, the argument of @option{--build} is |
11684 |
|
strictly copied into @code{build_alias}, and is left empty otherwise. |
11685 |
|
After the @code{AC_CANONICAL_BUILD}, @code{build} is set to the |
11686 |
|
canonicalized build type. To ease the transition, before, its contents |
11687 |
|
is the same as that of @code{build_alias}. Do @emph{not} rely on this |
11688 |
|
broken feature. |
11689 |
|
|
11690 |
|
For consistency with the backward compatibility scheme exposed above, |
11691 |
|
when @option{--host} is specified by @option{--build} isn't, the build |
11692 |
|
system will be assumed to be the same as @option{--host}, and |
11693 |
|
@samp{build_alias} will be set to that value. Eventually, this |
11694 |
|
historically incorrect behavior will go away. |
11695 |
|
|
11696 |
|
@sp 1 |
11697 |
|
|
11698 |
|
The former scheme to enable cross-compilation proved to cause more harm |
11699 |
|
than good, in particular, it used to be triggered too easily, leaving |
11700 |
|
regular end users puzzled in front of cryptic error messages. |
11701 |
|
@command{configure} could even enter cross-compilation mode, only |
11702 |
|
because the compiler was not functional. This is mainly because |
11703 |
|
@command{configure} used to try to detect cross-compilation, instead of |
11704 |
|
waiting for an explicit flag from the user. |
11705 |
|
|
11706 |
|
Now, @command{configure} enters cross-compilation mode iff |
11707 |
|
@option{--host} is passed. |
11708 |
|
|
11709 |
|
That's the short documentation. To ease the transition between 2.13 and |
11710 |
|
its successors, a more complicated scheme is implemented. @emph{Do not |
11711 |
|
rely on the following}, as it will be removed in a near future. |
11712 |
|
|
11713 |
|
If you specify @option{--host}, but not @option{--build}, when |
11714 |
|
@command{configure} performs the first compiler test it will try to run |
11715 |
|
an executable produced by the compiler. If the execution fails, it will |
11716 |
|
enter cross-compilation mode. This is fragile. Moreover, by the time |
11717 |
|
the compiler test is performed, it may be too late to modify the |
11718 |
|
build-system type: other tests may have already been performed. |
11719 |
|
Therefore, whenever you specify @code{--host}, be sure to specify |
11720 |
|
@code{--build} too. |
11721 |
|
|
11722 |
|
@example |
11723 |
|
./configure --build=i686-pc-linux-gnu --host=m68k-coff |
11724 |
|
@end example |
11725 |
|
|
11726 |
|
@noindent |
11727 |
|
will enter cross-compilation mode. The former interface, which |
11728 |
|
consisted in setting the compiler to a cross-compiler without informing |
11729 |
|
@command{configure} is obsolete. For instance, @command{configure} will |
11730 |
|
fail if it can't run the code generated by the specified compiler if you |
11731 |
|
configure as follows: |
11732 |
|
|
11733 |
|
@example |
11734 |
|
./configure CC=m68k-coff-gcc |
11735 |
|
@end example |
11736 |
|
|
11737 |
|
|
11738 |
@c ============================= Generating Test Suites with Autotest |
@c ============================= Generating Test Suites with Autotest |
11739 |
|
|
11740 |
@node Using Autotest |
@node Using Autotest |