[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When AutoGen starts, it tries to determine several names from the
operating environment and put them into environment variables for use in
both #ifdef
tests in the definitions files and in shell scripts
with environment variable tests. __autogen__
is always defined.
For other names, AutoGen will first try to use the POSIX version of the
sysinfo(2)
system call. Failing that, it will try for the POSIX
uname(2)
call. If neither is available, then only
"__autogen__
" will be inserted into the environment.
If sysinfo(2)
is available, the strings associated with
SI_SYSNAME
(e.g., "__sunos__")
SI_HOSTNAME
(e.g., "__ellen__")
SI_ARCHITECTURE
(e.g., "__sparc__")
SI_HW_PROVIDER
(e.g., "__sun_microsystems__")
SI_PLATFORM
(e.g., "__sun_ultra_5_10__")
SI_MACHINE
(e.g., "__sun4u__")
For Linux and other operating systems that only support the
uname(2)
call, AutoGen will use these values:
sysname
(e.g., "__linux__")
machine
(e.g., "__i586__")
nodename
(e.g., "__bach__")
By testing these pre-defines in my definitions, you can select
pieces of the definitions without resorting to writing shell
scripts that parse the output of uname(1)
. You can also
segregate real C code from autogen definitions by testing for
"__autogen__
".
#ifdef __bach__ location = home; #else location = work; #endif |