]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Using System Type): Add an example of `case
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 22 Nov 2001 18:07:56 +0000 (18:07 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 22 Nov 2001 18:07:56 +0000 (18:07 +0000)
$host' usage so people quit using `case $target' everywhere.

ChangeLog
doc/autoconf.texi

index 932f636df7ec96adc6f506a9ad83be8a31b112d6..ef15542de81147992704cdb44632d5b350835d45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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
index 6bafd4def9a214fe60d60f6750b3560ffbe95d93..3d01620edef4a28d9347105a6cb9eb3b9b0be13c 100644 (file)
@@ -9490,7 +9490,7 @@ as @file{host.h} or @file{target.c} (@pxref{Configuration Links}).  The
 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 ;;
@@ -9498,13 +9498,36 @@ esac
 @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.