Move the documentation of `AC_OBSOLETE' from here, to...
(Old Macros): here.
* acspecific.m4 (AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV):
AU_DEFUN'd.
+2000-05-10 Akim Demaille <akim@epita.fr>
+
+ * doc/autoconf.texi (Obsolete Macros): Document `AU_DEFUN'.
+ Move the documentation of `AC_OBSOLETE' from here, to...
+ (Old Macros): here.
+ * acspecific.m4 (AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV):
+ AU_DEFUN'd.
+
2000-05-10 Akim Demaille <akim@epita.fr>
* acgeneral.m4 (AC_LIBOBJ_DECL, AC_LIBOBJ): New macros.
# AC_STRUCT_ST_BLKSIZE
# --------------------
-AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
-[AC_OBSOLETE([$0], [; replace it with
- AC_CHECK_MEMBERS((struct stat.st_blksize))
-Please note that it will define `HAVE_STRUCT_STAT_ST_BLKSIZE',
-and not `HAVE_ST_BLKSIZE'.])dnl
+AU_DEFUN(AC_STRUCT_ST_BLKSIZE,
+[AC_WARNING([$0:
+ your code should no longer depend upon `HAVE_ST_BLKSIZE', but
+ `HAVE_STRUCT_STAT_ST_BLKSIZE'. Remove this AC_WARNING and
+ the `AC_DEFINE' when you adjust the code.])
AC_CHECK_MEMBERS((struct stat.st_blksize),
[AC_DEFINE(HAVE_ST_BLKSIZE, 1,
[Define if your `struct stat' has
# AC_STRUCT_ST_RDEV
# -----------------
-AC_DEFUN(AC_STRUCT_ST_RDEV,
-[AC_OBSOLETE([$0], [; replace it with
- AC_CHECK_MEMBERS((struct stat.st_rdev))
-Please note that it will define `HAVE_STRUCT_STAT_ST_RDEV',
-and not `HAVE_ST_RDEV'.])dnl
+AU_DEFUN(AC_STRUCT_ST_RDEV,
+[AC_WARNING([$0:
+ your code should no longer depend upon `HAVE_ST_RDEV', but
+ `HAVE_STRUCT_STAT_ST_RDEV'. Remove this AC_WARNING and
+ the `AC_DEFINE' when you adjust the code.])
AC_CHECK_MEMBERS((struct stat.st_rdev),
[AC_DEFINE(HAVE_ST_RDEV, 1,
[Define if your `struct stat' has `st_rdev'.
ad-hoc approaches are systematized. This process has occurred in many
parts of Autoconf. One result is that some of the macros are now
considered @dfn{obsolete}; they still work, but are no longer considered
-the best thing to do. Autoconf provides the @code{AC_OBSOLETE} macro to
-warn users producing @code{configure} scripts when they use obsolete
-macros, to encourage them to modernize. A sample call is:
+the best thing to do, hence they should be replaced with more modern
+macros. Ideally, @code{autoupdate} should substitute the old macro calls
+with their modern implementation.
-@example
-AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead])dnl
-@end example
+Autoconf provides a simple means to obsolete a macro.
-@defmac AC_OBSOLETE (@var{this-macro-name}, @ovar{suggestion})
-@maindex OBSOLETE
-Make @code{m4} print a message on the standard error output warning that
-@var{this-macro-name} is obsolete, and giving the file and line number
-where it was called. @var{this-macro-name} should be the name of the
-macro that is calling @code{AC_OBSOLETE}. If @var{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 @var{this-macro-name}.
+@defmac AU_DEFUN (@var{old-macro}, @var{implementation}, @ovar{message})
+@maindex DEFUN
+@maindex AU_DEFUN
+Define @var{old-macro} as @var{implementation}. The only difference
+with @code{AC_DEFUN} is that the user will be warned that
+@var{old-macro} is now obsolete.
+
+If she then uses @code{autoupdate}, the call to @var{old-macro} will be
+replaced by the modern @var{implementation}. The additional
+@var{message} is then printed.
@end defmac
Supporting old macros can quickly become a maintenance nightmare, so the
@code{AC_TYPE_MODE_T}
@end defmac
+@defmac AC_OBSOLETE (@var{this-macro-name}, @ovar{suggestion})
+@maindex OBSOLETE
+Make @code{m4} print a message on the standard error output warning that
+@var{this-macro-name} is obsolete, and giving the file and line number
+where it was called. @var{this-macro-name} should be the name of the
+macro that is calling @code{AC_OBSOLETE}. If @var{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 @var{this-macro-name}.
+
+For instance
+
+@example
+AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead])dnl
+@end example
+
+You are encouraged to use @code{AU_DEFUN} instead, since it gives better
+services to the user.
+@end defmac
+
@defmac AC_OFF_T
@maindex OFF_T
@code{AC_TYPE_OFF_T}
# AC_STRUCT_ST_BLKSIZE
# --------------------
-AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
-[AC_OBSOLETE([$0], [; replace it with
- AC_CHECK_MEMBERS((struct stat.st_blksize))
-Please note that it will define `HAVE_STRUCT_STAT_ST_BLKSIZE',
-and not `HAVE_ST_BLKSIZE'.])dnl
+AU_DEFUN(AC_STRUCT_ST_BLKSIZE,
+[AC_WARNING([$0:
+ your code should no longer depend upon `HAVE_ST_BLKSIZE', but
+ `HAVE_STRUCT_STAT_ST_BLKSIZE'. Remove this AC_WARNING and
+ the `AC_DEFINE' when you adjust the code.])
AC_CHECK_MEMBERS((struct stat.st_blksize),
[AC_DEFINE(HAVE_ST_BLKSIZE, 1,
[Define if your `struct stat' has
# AC_STRUCT_ST_RDEV
# -----------------
-AC_DEFUN(AC_STRUCT_ST_RDEV,
-[AC_OBSOLETE([$0], [; replace it with
- AC_CHECK_MEMBERS((struct stat.st_rdev))
-Please note that it will define `HAVE_STRUCT_STAT_ST_RDEV',
-and not `HAVE_ST_RDEV'.])dnl
+AU_DEFUN(AC_STRUCT_ST_RDEV,
+[AC_WARNING([$0:
+ your code should no longer depend upon `HAVE_ST_RDEV', but
+ `HAVE_STRUCT_STAT_ST_RDEV'. Remove this AC_WARNING and
+ the `AC_DEFINE' when you adjust the code.])
AC_CHECK_MEMBERS((struct stat.st_rdev),
[AC_DEFINE(HAVE_ST_RDEV, 1,
[Define if your `struct stat' has `st_rdev'.