autoconf.info: Using System Type
Go backward to Canonicalizing
Go up to Manual Configuration
Go to the top op autoconf
Using the System Type
How do you use a canonical system type? Usually, you use it in one or
more `case' statements in `configure.ac' to select system-specific C
files. Then, using `AC_CONFIG_LINKS', link those files which have
names based on the system name, to generic names, such as `host.h' or
`target.c' (*note Configuration Links::). The `case' statement
patterns can use shell wild cards to group several cases together, like
in this fragment:
case $target in
i386-*-mach* | i386-*-gnu*)
obj_format=aout emulation=mach bfd_gas=yes ;;
i960-*-bout) obj_format=bout ;;
and later in `configure.ac', use:
Note that the above example uses `$target' because it's taken from a
tool which can be built on some architecture (`$build'), run on another
(`$host'), but yet handle data for a third architecture (`$target').
Such tools are usually part of a compiler suite, they generate code for
a specific `$target'.
However `$target' should be meaningless for most packages. If you
want to base a decision on the system where your program will be run,
make sure you use the `$host' variable, as in the following excerpt:
case $host in
*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
You can also use the host system type to find cross-compilation
tools. *Note Generic Programs::, for information about the
`AC_CHECK_TOOL' macro which does that.
Created Mon Nov 8 17:41:59 2004 on tillpc with info_to_html version 0.9.6.