[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.5 Pre-defined Names

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

are used. The associated names are converted to lower case, surrounded by doubled underscores and non-symbol characters are replaced with underscores. For example, for Solaris on a sparc platform, you would get these definitions:

For Linux and other operating systems that only support the uname(2) call, AutoGen will use these values:

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



This document was generated by Bruce Korb on February, 4 2002 using texi2html