[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: detecting OS
From: |
Alexandre Duret-Lutz |
Subject: |
Re: detecting OS |
Date: |
22 Nov 2001 10:14:52 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 |
>>> "Ralf" == Ralf Corsepius <address@hidden> writes:
Ralf> Am Sam, 2001-11-17 um 04.29 schrieb Harlan Stenn:
>> AC_CANONICAL_TARGET and then
>>
>> case "$target" in
>> *-*-linux*)
>> ...
>> ;;
>> *-*-freebsd*)
>> ...
>> ;;
>> ...
>> esac
>>
>> ("$target" doesn't need the quotes, but I do them anyway.)
Ralf> Sorry, $target is meant to be used for cross-tools, $host is what you
Ralf> normally want to use instead.
Index: ChangeLog
from Alexandre Duret-Lutz <address@hidden>
* doc/autoconf.texi (Using System Type): Add an example of `case
$host' usage so people quit using `case $target' everywhere.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvs/autoconf/doc/autoconf.texi,v
retrieving revision 1.563
diff -u -r1.563 autoconf.texi
--- doc/autoconf.texi 2001/11/16 20:10:52 1.563
+++ doc/autoconf.texi 2001/11/22 09:11:09
@@ -9498,11 +9498,34 @@
@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)
address@hidden 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:
+
address@hidden
+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.
--
Alexandre Duret-Lutz
- Re: detecting OS,
Alexandre Duret-Lutz <=