Several macros are obsoleted in Autoconf, for various reasons (typically they failed to quote properly, couldn't be extended for more recent issues, etc.). They are still supported, but deprecated: their use should be avoided.
During the jump from Autoconf version 1 to version 2, most of the macros were renamed to use a more uniform and descriptive naming scheme, but their signature did not change. See Macro Names, for a description of the new naming scheme. Below, if there is just the mapping from old names to new names for these macros, the reader is invited to refer to the definition of the new macro for the signature and the description.
This macro is a platform-specific subset of
AC_USE_SYSTEM_EXTENSIONS
(see AC_USE_SYSTEM_EXTENSIONS).
If the C compiler supports a working
long double
type with more range or precision than thedouble
type, defineHAVE_LONG_DOUBLE
.You should use
AC_TYPE_LONG_DOUBLE
orAC_TYPE_LONG_DOUBLE_WIDER
instead. See Particular Types.
Determine the system type and set output variables to the names of the canonical system types. See Canonicalizing, for details about the variables this macro sets.
The user is encouraged to use either
AC_CANONICAL_BUILD
, orAC_CANONICAL_HOST
, orAC_CANONICAL_TARGET
, depending on the needs. UsingAC_CANONICAL_TARGET
is enough to run the two other macros (see Canonicalizing).
Autoconf, up to 2.13, used to provide this version of
AC_CHECK_TYPE
, deprecated because of its flaws. First, although it is a member of theCHECK
clan, it does more than just checking. Secondly, missing types are defined using#define
, nottypedef
, and this can lead to problems in the case of pointer types.This use of
AC_CHECK_TYPE
is obsolete and discouraged; see Generic Types, for the description of the current macro.If the type type is not defined, define it to be the C (or C++) builtin type default, e.g., ‘short int’ or ‘unsigned int’.
This macro is equivalent to:
AC_CHECK_TYPE([type], [], [AC_DEFINE_UNQUOTED([type], [default], [Define to `default' if <sys/types.h> does not define.])])In order to keep backward compatibility, the two versions of
AC_CHECK_TYPE
are implemented, selected using these heuristics:
- If there are three or four arguments, the modern version is used.
- If the second argument appears to be a C or C++ type, then the obsolete version is used. This happens if the argument is a C or C++ builtin type or a C identifier ending in ‘_t’, optionally followed by one of ‘[(* ’ and then by a string of zero or more characters taken from the set ‘[]()* _a-zA-Z0-9’.
- If the second argument is spelled with the alphabet of valid C and C++ types, the user is warned and the modern version is used.
- Otherwise, the modern version is used.
You are encouraged either to use a valid builtin type, or to use the equivalent modern code (see above), or better yet, to use
AC_CHECK_TYPES
together with#ifndef HAVE_LOFF_T typedef loff_t off_t; #endif
AC_MSG_NOTICE([checking feature-description...]See AC_MSG_NOTICE.
This is an obsolete version of
AC_TRY_COMPILE
itself replaced byAC_COMPILE_IFELSE
(see Running the Compiler), with the addition that it prints ‘checking for echo-text’ to the standard output first, if echo-text is non-empty. UseAC_MSG_CHECKING
andAC_MSG_RESULT
instead to print messages (see Printing Messages).
Check for the Cygwin environment in which case the shell variable
CYGWIN
is set to ‘yes’. Don't use this macro, the dignified means to check the nature of the host is usingAC_CANONICAL_HOST
(see Canonicalizing). As a matter of fact this macro is defined as:AC_REQUIRE([AC_CANONICAL_HOST])[]dnl case $host_os in *cygwin* ) CYGWIN=yes;; * ) CYGWIN=no;; esacBeware that the variable CYGWIN has a special meaning when running Cygwin, and should not be changed. That's yet another reason not to use this macro.
AC_CHECK_DECLS([sys_siglist], [], [], [#include <signal.h> /* NetBSD declares sys_siglist in unistd.h. */ #ifdef HAVE_UNISTD_H # include <unistd.h> #endif ])See AC_CHECK_DECLS.
Like calling
AC_FUNC_CLOSEDIR_VOID
(see AC_FUNC_CLOSEDIR_VOID) andAC_HEADER_DIRENT
(see AC_HEADER_DIRENT), but defines a different set of C preprocessor macros to indicate which header file is found:
Header Old Symbol New Symbol dirent.h DIRENT
HAVE_DIRENT_H
sys/ndir.h SYSNDIR
HAVE_SYS_NDIR_H
sys/dir.h SYSDIR
HAVE_SYS_DIR_H
ndir.h NDIR
HAVE_NDIR_H
If on DYNIX/ptx, add -lseq to output variable
LIBS
. This macro used to be defined asAC_CHECK_LIB([seq], [getmntent], [LIBS="-lseq $LIBS"])now it is just
AC_FUNC_GETMNTENT
(see AC_FUNC_GETMNTENT).
Defined the output variable
EXEEXT
based on the output of the compiler, which is now done automatically. Typically set to empty string if Posix and ‘.exe’ if a DOS variant.
Similar to
AC_CYGWIN
but checks for the EMX environment on OS/2 and setsEMXOS2
. Don't use this macro, the dignified means to check the nature of the host is usingAC_CANONICAL_HOST
(see Canonicalizing).
This is an obsolete version of
AC_ARG_ENABLE
that does not support providing a help string (see AC_ARG_ENABLE).
Do nothing. Formerly, this macro checked whether
setvbuf
takes the buffering type as its second argument and the buffer pointer as the third, instead of the other way around, and definedSETVBUF_REVERSED
. However, the last systems to have the problem were those based on SVR2, which became obsolete in 1987, and the macro is no longer needed.
If
wait3
is found and fills in the contents of its third argument (a ‘struct rusage *’), which HP-UX does not do, defineHAVE_WAIT3
.These days portable programs should use
waitpid
, notwait3
, aswait3
has been removed from Posix.
This macro is a platform-specific subset of
AC_USE_SYSTEM_EXTENSIONS
(see AC_USE_SYSTEM_EXTENSIONS).
This macro is equivalent to calling
AC_CHECK_LIB
with a function argument ofmain
. In addition, library can be written as any of ‘foo’, -lfoo, or ‘libfoo.a’. In all of those cases, the compiler is passed -lfoo. However, library cannot be a shell variable; it must be a literal name. See AC_CHECK_LIB.
Formerly
AC_INIT
used to have a single argument, and was equivalent to:AC_INIT AC_CONFIG_SRCDIR(unique-file-in-source-dir)See AC_INIT and AC_CONFIG_SRCDIR.
If the C type
int
is 16 bits wide, defineINT_16_BITS
. Use ‘AC_CHECK_SIZEOF(int)’ instead (see AC_CHECK_SIZEOF).
If on irix (Silicon Graphics Unix), add -lsun to output
LIBS
. If you were using it to getgetmntent
, useAC_FUNC_GETMNTENT
instead. If you used it for the NIS versions of the password and group functions, use ‘AC_CHECK_LIB(sun, getpwnam)’. Up to Autoconf 2.13, it used to beAC_CHECK_LIB([sun], [getmntent], [LIBS="-lsun $LIBS"])now it is defined as
AC_FUNC_GETMNTENT AC_CHECK_LIB([sun], [getpwnam])See AC_FUNC_GETMNTENT and AC_CHECK_LIB.
This macro adds -lcposix to output variable
LIBS
if necessary for Posix facilities. Sun dropped support for the obsolete interactive Systems Corporation Unix on 2006-07-23. New programs need not use this macro. It is implemented asAC_SEARCH_LIBS([strerror], [cposix])
(see AC_SEARCH_LIBS).
Select the language that is saved on the top of the stack, as set by
AC_LANG_SAVE
, remove it from the stack, and callAC_LANG(
language)
. See Language Choice, for the preferred way to change languages.
Remember the current language (as set by
AC_LANG
) on a stack. The current language does not change.AC_LANG_PUSH
is preferred (see AC_LANG_PUSH).
This is an obsolete version of
AC_CONFIG_LINKS
(see AC_CONFIG_LINKS. An updated version of:AC_LINK_FILES(config/$machine.h config/$obj_format.h, host.h object.h)is:
AC_CONFIG_LINKS([host.h:config/$machine.h object.h:config/$obj_format.h])
Define
LONG_64_BITS
if the C typelong int
is 64 bits wide. Use the generic macro ‘AC_CHECK_SIZEOF([long int])’ instead (see AC_CHECK_SIZEOF).
If the C compiler supports a working
long double
type with more range or precision than thedouble
type, defineHAVE_LONG_DOUBLE
.You should use
AC_TYPE_LONG_DOUBLE
orAC_TYPE_LONG_DOUBLE_WIDER
instead. See Particular Types.
Used to define
NEED_MEMORY_H
if themem
functions were defined in memory.h. Today it is equivalent to ‘AC_CHECK_HEADERS([memory.h])’ (see AC_CHECK_HEADERS). Adjust your code to depend uponHAVE_MEMORY_H
, notNEED_MEMORY_H
; see Standard Symbols.
Similar to
AC_CYGWIN
but checks for the MinGW compiler environment and setsMINGW32
. Don't use this macro, the dignified means to check the nature of the host is usingAC_CANONICAL_HOST
(see Canonicalizing).
This macro is a platform-specific subset of
AC_USE_SYSTEM_EXTENSIONS
(see AC_USE_SYSTEM_EXTENSIONS).
Defined the output variable
OBJEXT
based on the output of the compiler, after .c files have been excluded. Typically set to ‘o’ if Posix, ‘obj’ if a DOS variant. Now the compiler checking macros handle this automatically.
Make M4 print a message to the standard error output warning that this-macro-name is obsolete, and giving the file and line number where it was called. this-macro-name should be the name of the macro that is calling
AC_OBSOLETE
. If suggestion is given, it is printed at the end of the warning message; for example, it can be a suggestion for what to use instead of this-macro-name.For instance
AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead])dnlYou are encouraged to use
AU_DEFUN
instead, since it gives better services to the user (see AU_DEFUN).
The use of
AC_OUTPUT
with arguments is deprecated. This obsoleted interface is equivalent to:AC_CONFIG_FILES(file...) AC_CONFIG_COMMANDS([default], extra-cmds, init-cmds) AC_OUTPUTSee AC_CONFIG_FILES, AC_CONFIG_COMMANDS, and AC_OUTPUT.
Specify additional shell commands to run at the end of config.status, and shell commands to initialize any variables from configure. This macro may be called multiple times. It is obsolete, replaced by
AC_CONFIG_COMMANDS
(see AC_CONFIG_COMMANDS).Here is an unrealistic example:
fubar=27 AC_OUTPUT_COMMANDS([echo this is extra $fubar, and so on.], [fubar=$fubar]) AC_OUTPUT_COMMANDS([echo this is another, extra, bit], [echo init bit])Aside from the fact that
AC_CONFIG_COMMANDS
requires an additional key, an important difference is thatAC_OUTPUT_COMMANDS
is quoting its arguments twice, unlikeAC_CONFIG_COMMANDS
. This means thatAC_CONFIG_COMMANDS
can safely be given macro calls as arguments:AC_CONFIG_COMMANDS(foo, [my_FOO()])Conversely, where one level of quoting was enough for literal strings with
AC_OUTPUT_COMMANDS
, you need two withAC_CONFIG_COMMANDS
. The following lines are equivalent:AC_OUTPUT_COMMANDS([echo "Square brackets: []"]) AC_CONFIG_COMMANDS([default], [[echo "Square brackets: []"]])
This macro was renamed
AC_SYS_RESTARTABLE_SYSCALLS
. However, these days portable programs should usesigaction
withSA_RESTART
if they want restartable system calls. They should not rely onHAVE_RESTARTABLE_SYSCALLS
, since nowadays whether a system call is restartable is a dynamic issue, not a configuration-time issue.
Replaced by
AC_TYPE_SIGNAL
(see AC_TYPE_SIGNAL), which itself is obsolete when assuming C89 or better.
If on SCO Unix, add -lintl to output variable
LIBS
. This macro used to do this:AC_CHECK_LIB([intl], [strftime], [LIBS="-lintl $LIBS"])Now it just calls
AC_FUNC_STRFTIME
instead (see AC_FUNC_STRFTIME).
If
struct stat
contains anst_blksize
member, defineHAVE_STRUCT_STAT_ST_BLKSIZE
. The former name,HAVE_ST_BLKSIZE
is to be avoided, as its support will cease in the future. This macro is obsoleted, and should be replaced byAC_CHECK_MEMBERS([struct stat.st_blksize])See AC_CHECK_MEMBERS.
If
struct stat
contains anst_rdev
member, defineHAVE_STRUCT_STAT_ST_RDEV
. The former name for this macro,HAVE_ST_RDEV
, is to be avoided as it will cease to be supported in the future. Actually, even the new macro is obsolete and should be replaced by:AC_CHECK_MEMBERS([struct stat.st_rdev])See AC_CHECK_MEMBERS.
If the system automatically restarts a system call that is interrupted by a signal, define
HAVE_RESTARTABLE_SYSCALLS
. This macro does not check whether system calls are restarted in general—it checks whether a signal handler installed withsignal
(but notsigaction
) causes system calls to be restarted. It does not check whether system calls can be restarted when interrupted by signals that have no handler.These days portable programs should use
sigaction
withSA_RESTART
if they want restartable system calls. They should not rely onHAVE_RESTARTABLE_SYSCALLS
, since nowadays whether a system call is restartable is a dynamic issue, not a configuration-time issue.
This macro was renamed
AC_DECL_SYS_SIGLIST
. However, even that name is obsolete, as the same functionality is now acheived viaAC_CHECK_DECLS
(see AC_CHECK_DECLS).
This macro was renamed
AC_TRY_CPP
, which in turn was replaced byAC_PREPROC_IFELSE
(see AC_PREPROC_IFELSE).
This macro was renamed
AC_TRY_RUN
, which in turn was replaced byAC_RUN_IFELSE
(see AC_RUN_IFELSE).
AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[includes]], [[function-body]])], [action-if-true], [action-if-false])See Running the Compiler.
This macro double quotes both includes and function-body.
For C and C++, includes is any
#include
statements needed by the code in function-body (includes is ignored if the currently selected language is Fortran or Fortran 77). The compiler and compilation flags are determined by the current language (see Language Choice).
AC_PREPROC_IFELSE( [AC_LANG_SOURCE([[input]])], [action-if-true], [action-if-false])This macro double quotes the input.
AC_LINK_IFELSE( [AC_LANG_PROGRAM([[includes]], [[function-body]])], [action-if-true], [action-if-false])See Running the Compiler.
This macro double quotes both includes and function-body.
Depending on the current language (see Language Choice), create a test program to see whether a function whose body consists of function-body can be compiled and linked. If the file compiles and links successfully, run shell commands action-if-found, otherwise run action-if-not-found.
This macro double quotes both includes and function-body.
For C and C++, includes is any
#include
statements needed by the code in function-body (includes is ignored if the currently selected language is Fortran or Fortran 77). The compiler and compilation flags are determined by the current language (see Language Choice), and in additionLDFLAGS
andLIBS
are used for linking.
AC_LINK_IFELSE([AC_LANG_CALL([], [function])], [action-if-found], [action-if-not-found])See AC_LINK_IFELSE.
AC_RUN_IFELSE( [AC_LANG_SOURCE([[program]])], [action-if-true], [action-if-false], [action-if-cross-compiling])See Runtime.
If signal.h declares
signal
as returning a pointer to a function returningvoid
, defineRETSIGTYPE
to bevoid
; otherwise, define it to beint
. These days, it is portable to assume C89, and that signal handlers returnvoid
, without needing to use this macro orRETSIGTYPE
.When targetting older K&R C, it is possible to define signal handlers as returning type
RETSIGTYPE
, and omit a return statement:RETSIGTYPE hup_handler () { ... }
Define
USG
if the BSD string functions are defined in strings.h. You should no longer depend uponUSG
, but onHAVE_STRING_H
; see Standard Symbols.
If the cache file is inconsistent with the current host, target and build system types, it used to execute cmd or print a default error message. This is now handled by default.
This macro was renamed
AC_FUNC_WAIT3
. However, these days portable programs should usewaitpid
, notwait3
, aswait3
has been removed from Posix.
This is an obsolete version of
AC_ARG_WITH
that does not support providing a help string (see AC_ARG_WITH).
This macro used to add -lx to output variable
LIBS
if on Xenix. Also, if dirent.h is being checked for, added -ldir toLIBS
. Now it is merely an alias ofAC_HEADER_DIRENT
instead, plus some code to detect whether running xenix on which you should not depend:AC_MSG_CHECKING([for Xenix]) AC_EGREP_CPP([yes], [#if defined M_XENIX && !defined M_UNIX yes #endif], [AC_MSG_RESULT([yes]); XENIX=yes], [AC_MSG_RESULT([no]); XENIX=])Don't use this macro, the dignified means to check the nature of the host is using
AC_CANONICAL_HOST
(see Canonicalizing).
This macro was renamed
AC_DECL_YYTEXT
, which in turn was integrated intoAC_PROG_LEX
(see AC_PROG_LEX).