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. the section called “Macro Names”, for a description of the new naming scheme. Below, 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.
function>AC_ALLOCA/function> AC_FUNC_ALLOCA
function>AC_ARG_ARRAY/function> removed because of limited usefulness
function>AC_C_CROSS/function> This macro is obsolete; it does nothing.
function>AC_CANONICAL_SYSTEM/function> Determine the system type and set output variables to the names of the canonical system types. the section called “Getting the Canonical System Type”, for details about the variables this macro sets.
The user is encouraged to use either AC_CANONICAL_BUILD, or AC_CANONICAL_HOST, or AC_CANONICAL_TARGET, depending on the needs. Using AC_CANONICAL_TARGET is enough to run the two other macros.
function>AC_CHAR_UNSIGNED/function> AC_C_CHAR_UNSIGNED
function>AC_CHECK_TYPE/function> (type, default) Autoconf, up to 2.13, used to provide this version of AC_CHECK_TYPE, deprecated because of its flaws. Firstly, although it is a member of the CHECK clan, singular sub-family, it does more than just checking. Second, missing types are not typedef'd, they are #define'd, which can lead to incompatible code in the case of pointer types.
This use of AC_CHECK_TYPE is obsolete and discouraged, see the section called “Generic Type Checks”, 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 or unsigned.
This macro is equivalent to:
AC_CHECK_TYPE([type], [AC_DEFINE([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 by a simple 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
#if !HAVE_LOFF_T typedef loff_t off_t; #endif
function>AC_CHECKING/function> (feature-description) Same as AC_MSG_NOTICE([checking feature-description…].
function>AC_COMPILE_CHECK/function> (echo-text, includes, function-body, action-if-found, [action-if-not-found]) This is an obsolete version of AC_TRY_LINK (the section called “Examining Libraries”), with the addition that it prints checking for echo-text to the standard output first, if echo-text is non-empty. Use AC_MSG_CHECKING and AC_MSG_RESULT instead to print messages (the section called “Printing Messages”).
function>AC_CONST/function> AC_C_CONST
function>AC_CROSS_CHECK/function> Same as AC_C_CROSS, which is obsolete too, and does nothing :-).
function>AC_CYGWIN/function> 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 using AC_CANONICAL_HOST. 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;; esac
Beware that the variable CYGWIN has a very special meaning when running CygWin32, and should not be changed. That's yet another reason not to use this macro.
function>AC_DECL_YYTEXT/function> Does nothing, now integrated in AC_PROG_LEX.
function>AC_DIR_HEADER/function> Like calling AC_FUNC_CLOSEDIR_VOID andAC_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 |
function>AC_DYNIX_SEQ/function> If on Dynix/PTX (Sequent unix), add -lseq to output variable LIBS. This macro used to be defined as
AC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS")
now it is just AC_FUNC_GETMNTENT.
function>AC_EXEEXT/function> Defined the output variable EXEEXT based on the output of the compiler, which is now done automatically. Typically set to empty string if Unix and .exe if Win32 or OS/2.
function>AC_EMXOS2/function> Similar to AC_CYGWIN but checks for the EMX environment on OS/2 and sets EMXOS2.
function>AC_ERROR/function> AC_MSG_ERROR
function>AC_FIND_X/function> AC_PATH_X
function>AC_FIND_XTRA/function> AC_PATH_XTRA
function>AC_FUNC_CHECK/function> AC_CHECK_FUNC
function>AC_FUNC_WAIT3/function> If wait3 is found and fills in the contents of its third argument (a struct rusage *), which HP-UX does not do, define HAVE_WAIT3.
These days portable programs should use waitpid, not wait3, as wait3 is being removed from the Open Group standards, and will not appear in the next revision of POSIX.
function>AC_GCC_TRADITIONAL/function> AC_PROG_GCC_TRADITIONAL
function>AC_GETGROUPS_T/function> AC_TYPE_GETGROUPS
function>AC_GETLOADAVG/function> AC_FUNC_GETLOADAVG
function>AC_HAVE_FUNCS/function> AC_CHECK_FUNCS
function>AC_HAVE_HEADERS/function> AC_CHECK_HEADERS
function>AC_HAVE_LIBRARY/function> (library, [action-if-found], [action-if-not-found], [other-libraries]) This macro is equivalent to calling AC_CHECK_LIB with a function argument of main. 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.
function>AC_HAVE_POUNDBANG/function> AC_SYS_INTERPRETER (different calling convention)
function>AC_HEADER_CHECK/function> AC_CHECK_HEADER
function>AC_HEADER_EGREP/function> AC_EGREP_HEADER
function>AC_INIT/function> (unique-file-in-source-dir) Formerly AC_INIT used to have a single argument, and was equivalent to:
AC_INIT AC_CONFIG_SRCDIR(unique-file-in-source-dir)
function>AC_INLINE/function> AC_C_INLINE
function>AC_INT_16_BITS/function> If the C type int is 16 bits wide, define INT_16_BITS. Use AC_CHECK_SIZEOF(int) instead.
function>AC_IRIX_SUN/function> If on IRIX (Silicon Graphics unix), add -lsun to output LIBS. If you were using it to get getmntent, use AC_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 be
AC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS")
now it is defined as
AC_FUNC_GETMNTENT AC_CHECK_LIB(sun, getpwnam)
function>AC_LANG_C/function> Same as AC_LANG(C).
function>AC_LANG_CPLUSPLUS/function> Same as AC_LANG(C++).
function>AC_LANG_FORTRAN77/function> Same as AC_LANG(Fortran 77).
function>AC_LANG_RESTORE/function> Select the language that is saved on the top of the stack, as set by AC_LANG_SAVE, remove it from the stack, and call AC_LANG(language).
function>AC_LANG_SAVE/function> Remember the current language (as set by AC_LANG) on a stack. The current language does not change. AC_LANG_PUSH is preferred.
function>AC_LINK_FILES/function> (source…, dest…) This is an obsolete version of 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)
function>AC_LN_S/function> AC_PROG_LN_S
function>AC_LONG_64_BITS/function> Define LONG_64_BITS if the C type long int is 64 bits wide. Use the generic macro AC_CHECK_SIZEOF([long int]) instead.
function>AC_LONG_DOUBLE/function> AC_C_LONG_DOUBLE
function>AC_LONG_FILE_NAMES/function> AC_SYS_LONG_FILE_NAMES
function>AC_MAJOR_HEADER/function> AC_HEADER_MAJOR
function>AC_MEMORY_H/function> Used to define NEED_MEMORY_H if the mem functions were defined in memory.h. Today it is equivalent to AC_CHECK_HEADERS(memory.h). Adjust your code to depend upon HAVE_MEMORY_H, not NEED_MEMORY_H, see the section called “Standard Symbols”.
function>AC_MINGW32/function> Similar to AC_CYGWIN but checks for the MingW32 compiler environment and sets MINGW32.
function>AC_MINUS_C_MINUS_O/function> AC_PROG_CC_C_O
function>AC_MMAP/function> AC_FUNC_MMAP
function>AC_MODE_T/function> AC_TYPE_MODE_T
function>AC_OBJEXT/function> Defined the output variable OBJEXT based on the output of the compiler, after .c files have been excluded. Typically set to o if Unix, obj if Win32. Now the compiler checking macros handle this automatically.
function>AC_OBSOLETE/function> (this-macro-name, [suggestion]) 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])dnl
You are encouraged to use AU_DEFUN instead, since it gives better services to the user.
function>AC_OFF_T/function> AC_TYPE_OFF_T
function>AC_OUTPUT/function> ([file]…, [extra-cmds], [init-cmds]) The use of AC_OUTPUT with argument is deprecated, this obsoleted interface is equivalent to:
AC_CONFIG_FILES(file…) AC_CONFIG_COMMANDS([default], extra-cmds, init-cmds) AC_OUTPUT
function>AC_OUTPUT_COMMANDS/function> (extra-cmds, [init-cmds]) 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.
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 that AC_OUTPUT_COMMANDS is quoting its arguments twice, while AC_CONFIG_COMMANDS. This means that AC_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 with AC_CONFIG_COMMANDS. The following lines are equivalent:
AC_OUTPUT_COMMANDS([echo "Square brackets: []"]) AC_CONFIG_COMMANDS([default], [[echo "Square brackets: []"]])
function>AC_PID_T/function> AC_TYPE_PID_T
function>AC_PREFIX/function> AC_PREFIX_PROGRAM
function>AC_PROG_CC_STDC/function> This macro has been integrated into AC_PROG_CC_STDC.
function>AC_PROGRAMS_CHECK/function> AC_CHECK_PROGS
function>AC_PROGRAMS_PATH/function> AC_PATH_PROGS
function>AC_PROGRAM_CHECK/function> AC_CHECK_PROG
function>AC_PROGRAM_EGREP/function> AC_EGREP_CPP
function>AC_PROGRAM_PATH/function> AC_PATH_PROG
function>AC_REMOTE_TAPE/function> removed because of limited usefulness
function>AC_RESTARTABLE_SYSCALLS/function> AC_SYS_RESTARTABLE_SYSCALLS
function>AC_RETSIGTYPE/function> AC_TYPE_SIGNAL
function>AC_RSH/function> Removed because of limited usefulness.
function>AC_SCO_INTL/function> If on SCO UNIX, add -lintl to output variable LIBS. This macro used to
AC_CHECK_LIB(intl, strftime, LIBS="-lintl $LIBS")
now it just calls AC_FUNC_STRFTIME instead.
function>AC_SETVBUF_REVERSED/function> AC_FUNC_SETVBUF_REVERSED
function>AC_SET_MAKE/function> AC_PROG_MAKE_SET
function>AC_SIZEOF_TYPE/function> AC_CHECK_SIZEOF
function>AC_SIZE_T/function> AC_TYPE_SIZE_T
function>AC_STAT_MACROS_BROKEN/function> AC_HEADER_STAT
function>AC_STDC_HEADERS/function> AC_HEADER_STDC
function>AC_STRCOLL/function> AC_FUNC_STRCOLL
function>AC_ST_BLKSIZE/function> AC_STRUCT_ST_BLKSIZE
function>AC_ST_BLOCKS/function> AC_STRUCT_ST_BLOCKS
function>AC_ST_RDEV/function> AC_STRUCT_ST_RDEV
function>AC_SYS_RESTARTABLE_SYSCALLS/function> If the system automatically restarts a system call that is interrupted by a signal, define HAVE_RESTARTABLE_SYSCALLS. This macro does not check if system calls are restarted in general-it tests whether a signal handler installed with signal (but not sigaction) causes system calls to be restarted. It does not test if system calls can be restarted when interrupted by signals that have no handler.
These days portable programs should use sigaction with SA_RESTART if they want restartable system calls. They should not rely on HAVE_RESTARTABLE_SYSCALLS, since nowadays whether a system call is restartable is a dynamic issue, not a configuration-time issue.
function>AC_SYS_SIGLIST_DECLARED/function> AC_DECL_SYS_SIGLIST
function>AC_TEST_CPP/function> AC_TRY_CPP
function>AC_TEST_PROGRAM/function> AC_TRY_RUN
function>AC_TIMEZONE/function> AC_STRUCT_TIMEZONE
function>AC_TIME_WITH_SYS_TIME/function> AC_HEADER_TIME
function>AC_UID_T/function> AC_TYPE_UID_T
function>AC_UNISTD_H/function> Same as AC_CHECK_HEADERS(unistd.h).
function>AC_USG/function> Define USG if the bsd string functions are defined in strings.h. You should no longer depend upon USG, but on HAVE_STRING_H, see the section called “Standard Symbols”.
function>AC_UTIME_NULL/function> AC_FUNC_UTIME_NULL
function>AC_VALIDATE_CACHED_SYSTEM_TUPLE/function> ([cmd]) 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.
function>AC_VERBOSE/function> (result-description) AC_MSG_RESULT.
function>AC_VFORK/function> AC_FUNC_VFORK
function>AC_VPRINTF/function> AC_FUNC_VPRINTF
function>AC_WAIT3/function> AC_FUNC_WAIT3
function>AC_WARN/function> AC_MSG_WARN
function>AC_WORDS_BIGENDIAN/function> AC_C_BIGENDIAN
function>AC_XENIX_DIR/function> This macro used to add -lx to output variable LIBS if on Xenix. Also, if dirent.h is being checked for, added -ldir to LIBS. Now it is merely an alias of AC_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=])