* Types:: Types that might be missing
* Compilers and Preprocessors:: Checking for compiling programs
* System Services:: Operating system services
-* UNIX Variants:: Special kludges for specific UNIX variants
+* Unix Variants:: Special kludges for specific Unix variants
Common Behavior
Autoconf is a tool for producing shell scripts that automatically
configure software source code packages to adapt to many kinds of
-@sc{unix}-like systems. The configuration scripts produced by Autoconf
+Unix-like systems. The configuration scripts produced by Autoconf
are independent of Autoconf when they are run, so their users do not
need to have Autoconf.
(Before each check, they print a one-line message stating what they are
checking for, so the user doesn't get too bored while waiting for the
script to finish.) As a result, they deal well with systems that are
-hybrids or customized from the more common @sc{unix} variants. There is
+hybrids or customized from the more common Unix variants. There is
no need to maintain files that list the features supported by each
-release of each variant of @sc{unix}.
+release of each variant of Unix.
For each software package that Autoconf is used with, it creates a
configuration script from a template file that lists the system features
@code{#if} in C programs (@pxref{Preprocessor Symbol Index}).
Autoconf requires @acronym{GNU} M4 in order to generate the scripts. It uses
-features that some @sc{unix} versions of M4, including @acronym{GNU} M4 1.3,
+features that some Unix versions of M4, including @acronym{GNU} M4 1.3,
do not have. You must use version 1.4 or later of @acronym{GNU} M4.
@xref{Autoconf 1}, for information about upgrading from version 1.
* Types:: Types that might be missing
* Compilers and Preprocessors:: Checking for compiling programs
* System Services:: Operating system services
-* UNIX Variants:: Special kludges for specific UNIX variants
+* Unix Variants:: Special kludges for specific Unix variants
@end menu
@node Common Behavior
@c @fuindex getmntent
@prindex @code{getmntent}
Check for @code{getmntent} in the @file{sun}, @file{seq}, and @file{gen}
-libraries, for @sc{irix} 4, PTX, and Unixware, respectively. Then, if
+libraries, for @sc{irix} 4, PTX, and UnixWare, respectively. Then, if
@code{getmntent} is available, define @code{HAVE_GETMNTENT}.
@end defmac
@cvindex HAVE_STRFTIME
@c @fuindex strftime
@prindex @code{strftime}
-Check for @code{strftime} in the @file{intl} library, for SCO @sc{unix}.
+Check for @code{strftime} in the @file{intl} library, for SCO Unix.
Then, if @code{strftime} is available, define @code{HAVE_STRFTIME}.
@end defmac
@samp{yes}. If not, set the variable to @samp{no}.
@end defmac
-@node UNIX Variants
-@section UNIX Variants
+@node Unix Variants
+@section Unix Variants
The following macros check for certain operating systems that need
special treatment for some programs, due to exceptional oddities in
by users.
The @href{http://bhami.com/rosetta.html, Rosetta Stone for Unix}
-contains a lot of interesting crossed information on various Unices.
+contains a lot of interesting crossed information on various Unix variants.
@table @asis
@item Darwin
@item Unix version 7
@cindex Unix version 7
@cindex V7
+Officially this was called the ``Seventh Edition'' of ``the @sc{unix}
+time-sharing system'' but we use the more-common name ``Unix version 7''.
Documentation is available in the
@href{http://plan9.bell-labs.com/7thEdMan/index.html, V7 Manual}.
+Previous versions of Unix are called ``Unix version 6'', etc., but
+they were not as widely used.
@end table
@section Multiple Cases
Some operations are accomplished in several possible ways, depending on
-the @sc{unix} variant. Checking for them essentially requires a ``case
+the Unix variant. Checking for them essentially requires a ``case
statement''. Autoconf does not directly provide one; however, it is
easy to simulate by using a shell variable to keep track of whether a
way to perform the operation has been found yet.
@item FUNC
Functions in libraries.
@item GROUP
-@sc{unix} group owners of files.
+Unix group owners of files.
@item HEADER
Header files.
@item LIB
techniques you should avoid in order to make your code portable. The
Bourne shell and upward-compatible shells like the Korn shell and Bash
have evolved over the years, but to prevent trouble, do not take
-advantage of features that were added after @sc{unix} version 7, circa
+advantage of features that were added after Unix version 7, circa
1977 (@pxref{Systemology}).
You should not use shell functions, aliases, negated character
important thing to remember when building a portable configure script,
as @command{autoconf} uses a .in suffix for template files.
-This is perfectly OK on Unices:
+This is perfectly OK on Unix variants:
@example
AC_CONFIG_HEADERS([config.h])
One of the most famous shell-portability issues is related to
@samp{"$@@"}. When there are no positional arguments, @acronym{POSIX} says
that @samp{"$@@"} is supposed to be equivalent to nothing, but the
-original Unix Version 7 Bourne shell treated it as equivalent to
+original Unix version 7 Bourne shell treated it as equivalent to
@samp{""} instead, and this behavior survives in later implementations
like Digital Unix 5.0.
@item @command{!}
@prindex @command{!}
-You can't use @command{!}; you'll have to rewrite your code.
+The Unix version 7 shell did not support
+negating the exit status of commands with @command{!}, and this feature
+is still absent from more modern shells (e.g., Solaris 9 @command{/bin/sh}).
+Shell code like this:
+
+@example
+if ! cmp file1 file2 >/dev/null 2>&1; then
+ echo files differ or trouble
+fi
+@end example
+
+is therefore not portable in practice. Typically it is easy to rewrite
+such code, e.g.:
+
+@example
+cmp file1 file2 >/dev/null 2>&1 || echo files differ or trouble
+@end example
@item @command{break}
@noindent
This is extremely unfortunate, since you are likely to use this code to
-handle @sc{unix} or @sc{ms-dos} absolute paths. To work around this
+handle Unix or @sc{ms-dos} absolute paths. To work around this
bug, always put the backslash first:
@example
variable marked as exported.
Alas, many shells, such as Solaris 2.5, @sc{irix} 6.3, @sc{irix} 5.2,
-@acronym{AIX} 4.1.5, and Digital @sc{unix} 4.0, forget to
+@acronym{AIX} 4.1.5, and Digital Unix 4.0, forget to
@command{export} the environment variables they receive. As a result,
two variables coexist: the environment variable and the shell
variable. The following code demonstrates this failure:
tests for this feature with @code{AC_PROG_CC_C_O}.
When a compilation such as @samp{cc -o foo foo.c} fails, some compilers
-(such as @sc{cds} on Reliant @sc{unix}) leave a @file{foo.o}.
+(such as @sc{cds} on Reliant Unix) leave a @file{foo.o}.
HP-UX @command{cc} doesn't accept @file{.S} files to preprocess and
assemble. @samp{cc -c foo.S} will appear to succeed, but in fact does
@end example
@acronym{GNU}/Linux and @acronym{POSIX}.2-1992 return the empty string
-for this case, but traditional @sc{unix} returns @samp{0} (Solaris is
+for this case, but traditional Unix returns @samp{0} (Solaris is
one such example). In @acronym{POSIX}.1-2001, the specification has
-been changed to match traditional @sc{unix}'s behavior (which is
+been changed to match traditional Unix's behavior (which is
bizarre, but it's too late to fix this). Please note that the same
problem does arise when the empty string results from a computation,
as in:
@c
@c # telnet dim
@c [...]
-@c UNIX System V (TWG-TCP/IP) (dim.blilly.com)
+@c Unix System V (TWG-TCP/IP) (dim.blilly.com)
@c [...]
@c $ mkdir foo
@c $ cd foo
@c /bin/ls:
@c fndcmd:fndcmd.sl 1.68
@c $ uname -a
-@c UNIX dim SYSTEM5 3.51m mc68k
+@c Unix dim SYSTEM5 3.51m mc68k
@c
@c It's an AT&T 3B1. See http://www.faqs.org/faqs/3b1-faq/ or any
@c mirror of the 3B1 FAQ. It's actually SVR2.2.
@cindex Moving open files
The only portable options are @option{-f} and @option{-i}.
-Moving individual files between file systems is portable (it was in V6),
+Moving individual files between file systems is portable (it was in Unix
+version 6),
but it is not always atomic: when doing @samp{mv new existing}, there's
a critical section where neither the old nor the new version of
@file{existing} actually exists.
Contrary to yet another urban legend, you may portably use @samp{&} in
the replacement part of the @code{s} command to mean ``what was
-matched''. All descendants of Bell Lab's V7 @command{sed} (at least; we
+matched''. All descendants of Bell Lab's Unix version 7 @command{sed}
+(at least; we
don't have first hand experience with older @command{sed}s) have
supported it.
@defmac AC_IRIX_SUN
@acindex{IRIX_SUN}
-If on @sc{irix} (Silicon Graphics @sc{unix}), add @option{-lsun} to output
+If on @sc{irix} (Silicon Graphics Unix), add @option{-lsun} to output
@code{LIBS}. If you were using it to get @code{getmntent}, use
@code{AC_FUNC_GETMNTENT} instead. If you used it for the NIS versions
of the password and group functions, use @samp{AC_CHECK_LIB(sun,
@defmac AC_SCO_INTL
@acindex{SCO_INTL}
@ovindex LIBS
-If on SCO UNIX, add @option{-lintl} to output variable @code{LIBS}. This
+If on SCO Unix, add @option{-lintl} to output variable @code{LIBS}. This
macro used to
@example
@table @asis
@item command line arguments
@c akim s/to consist in/to consist of/
-A very bad Unix habit which is unfortunately wide spread consists of
+A very bad Unix habit which is unfortunately widespread consists of
setting environment variables before the command, such as in
@samp{CC=my-home-grown-cc ./testsuite}. This results in the test suite
not knowing this change, hence (i) it can't report it to you, and (ii)
Since my @command{configure} scripts determine the system's capabilities
automatically, with no interactive user intervention, I decided to call
the program that generates them Autoconfig. But with a version number
-tacked on, that name would be too long for old @sc{unix} file systems,
+tacked on, that name would be too long for old Unix file systems,
so I shortened it to Autoconf.
In the fall of 1991 I called together a group of fellow questers after
@command{configure} scripts reported problems they encountered.
Autoconf turned out to be a good torture test for M4 implementations.
-@sc{unix} M4 started to dump core because of the length of the
+Unix M4 started to dump core because of the length of the
macros that Autoconf defined, and several bugs showed up in @acronym{GNU}
M4 as well. Eventually, we realized that we needed to use some
features that only @acronym{GNU} M4 has. 4.3@acronym{BSD} M4, in