+2001-11-22 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ * doc/autoconf.texi (Using System Type): Add an example of `case
+ $host' usage so people quit using `case $target' everywhere.
+
2001-11-22 Akim Demaille <akim@epita.fr>
* doc/autoconf.texi (Installation Directory Variables): Englishoes
cases together, like in this fragment:
@example
-case "$target" in
+case $target in
i386-*-mach* | i386-*-gnu*)
obj_format=aout emulation=mach bfd_gas=yes ;;
i960-*-bout) obj_format=bout ;;
@end example
@noindent
-and in @file{configure.ac}, use:
+and later in @file{configure.ac}, use:
@example
AC_CONFIG_LINKS(host.h:config/$machine.h
object.h:config/$obj_format.h)
@end example
+Note that the above example uses @code{$target} because it's taken from
+a tool which can be built on some architecture (@code{$build}), run on
+another (@code{$host}), but yet handle data for a third architecture
+(@code{$target}). Such tools are usually part of a compiler suite, they
+generate code for a specific @code{$target}.
+
+However @code{$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 @code{$host} variable, as in the following
+excerpt:
+
+@example
+case $host in
+ *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
+ MUMBLE_INIT="mumble.ini"
+ ;;
+ *)
+ MUMBLE_INIT=".mumbleinit"
+ ;;
+esac
+AC_SUBST([MUMBLE_INIT])
+@end example
+
You can also use the host system type to find cross-compilation tools.
@xref{Generic Programs}, for information about the @code{AC_CHECK_TOOL}
macro which does that.