Clean up the macros for testing members of aggregates.
* acgeneral.m4 (AC_CHECK_MEMBER): FATAL if $1 has no dot in it.
Use AC_INCLUDE_DEFAULTS.
(AC_C_STRUCT_MEMBER): Removed.
* acspecific.m4 (AC_STRUCT_TIMEZONE): Adapted to AC_CHECK_MEMBERS.
(AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Adapted to
AC_CHECK_MEMBERS and obsoleted.
(AC_STRUCT_ST_BLOCKS): Adapted to AC_CHECK_MEMBERS.
* autoconf.texi (AC_STRUCT_ST_BLKSIZE, HAVE_STRUCT_STAT_ST_RDEV):
Explain they are obsoleted, and how to migrate.
(AC_STRUCT_ST_BLOCKS, AC_STRUCT_TIMEZONE): Explain that the
AC_DEFINE changed (but the former #defines remain defined
currently).
(AC_C_STRUCT_MEMBER): Removed, replaced by the definitions of
AC_CHECK_MEMBER and AC_CHECK_MEMBERS.
+1999-11-01 Akim Demaille <akim@epita.fr>
+
+ Clean up the macros for testing members of aggregates.
+
+ * acgeneral.m4 (AC_CHECK_MEMBER): FATAL if $1 has no dot in it.
+ Use AC_INCLUDE_DEFAULTS.
+ (AC_C_STRUCT_MEMBER): Removed.
+ * acspecific.m4 (AC_STRUCT_TIMEZONE): Adapted to AC_CHECK_MEMBERS.
+ (AC_STRUCT_ST_BLKSIZE, AC_STRUCT_ST_RDEV): Adapted to
+ AC_CHECK_MEMBERS and obsoleted.
+ (AC_STRUCT_ST_BLOCKS): Adapted to AC_CHECK_MEMBERS.
+ * autoconf.texi (AC_STRUCT_ST_BLKSIZE, HAVE_STRUCT_STAT_ST_RDEV):
+ Explain they are obsoleted, and how to migrate.
+ (AC_STRUCT_ST_BLOCKS, AC_STRUCT_TIMEZONE): Explain that the
+ AC_DEFINE changed (but the former #defines remain defined
+ currently).
+ (AC_C_STRUCT_MEMBER): Removed, replaced by the definitions of
+ AC_CHECK_MEMBER and AC_CHECK_MEMBERS.
+
1999-11-01 Akim Demaille <akim@epita.fr>
Install a uniform set of default includes.
dnl Extract the aggregate name, and the member name
AC_VAR_IF_INDIR([$1],
[AC_FATAL([$0: requires manifest arguments])],
-[pushdef(AC_Member_Aggregate, [patsubst([$1], [\.[^.]*])])dnl
+[ifelse(regexp([$1], [\.]), -1,
+ [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
+pushdef(AC_Member_Aggregate, [patsubst([$1], [\.[^.]*])])dnl
pushdef(AC_Member_Member, [patsubst([$1], [.*\.])])])dnl
AC_CACHE_CHECK([for $1], ac_Member,
-[AC_TRY_COMPILE(m4_default([$4
-], [#include <stdio.h>
-#include <sys/types.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
-]),
+[AC_TRY_COMPILE(AC_INCLUDES_DEFAULT([$4]),
ac_Member_Aggregate foo;
foo.ac_Member_Member;,
-AC_VAR_SET(ac_Member, yes), AC_VAR_SET(ac_Member, no))])
+ AC_VAR_SET(ac_Member, yes),
+ AC_VAR_SET(ac_Member, no))])
AC_SHELL_IFELSE(test AC_VAR_GET(ac_Member) = yes,
[$2], [$3])dnl
popdef([AC_Member_Member])dnl
[$4])])])
-dnl Check if a particular structure member exists.
-dnl AC_C_STRUCT_MEMBER(VARIABLE, INCLUDES, TYPE, MEMBER)
-AC_DEFUN(AC_C_STRUCT_MEMBER,
-[AC_CACHE_CHECK([for member $4 in aggregate type $3],ac_cv_c_struct_member_$1,
- [AC_TRY_COMPILE([$2], [$3 foo; foo.$4;],
- ac_cv_c_struct_member_$1=yes,ac_cv_c_struct_member_$1=no)])
-$1="$ac_cv_c_struct_member_$1"])
-
dnl ### Default headers.
dnl ------------------
AC_DEFUN(AC_STRUCT_TIMEZONE,
[AC_REQUIRE([AC_STRUCT_TM])dnl
-AC_C_STRUCT_MEMBER(tm_zone, [#include <sys/types.h>
+AC_CHECK_MEMBERS((struct tm.tm_zone),,,[#include <sys/types.h>
#include <$ac_cv_struct_tm>
-], [struct tm], tm_zone)
-if test "$ac_cv_c_struct_member_tm_zone" = yes; then
+])
+if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
AC_DEFINE(HAVE_TM_ZONE, 1,
- [Define if your `struct tm' has `tm_zone'.])
+ [Define if your `struct tm' has `tm_zone'. Deprecated, use
+ `HAVE_STRUCT_TM_TM_ZONE' instead.])
else
AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
[AC_TRY_LINK(
])dnl AC_STRUCT_TIMEZONE
+
+dnl FIXME: The following three macros should no longer be supported in the
+dnl future. They made sense when there was no means to directly check for
+dnl members of aggregates. In the future, they will be remove, that's why
+dnl they are obsoleted.
+
+
dnl AC_STRUCT_ST_BLKSIZE
dnl --------------------
AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
-[AC_C_STRUCT_MEMBER(st_blksize, [#include <sys/types.h>
+[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
+AC_CHECK_MEMBERS((struct stat.st_blksize),
+ [AC_DEFINE(HAVE_ST_BLKSIZE, 1,
+ [Define if your `struct stat' has
+ `st_blksize'. Deprecated, use
+ `HAVE_STRUCT_STAT_ST_BLKSIZE' instead.])],,
+ [#include <sys/types.h>
#include <sys/stat.h>
-], [struct stat], st_blksize)
-if test $ac_cv_c_struct_member_st_blksize = yes; then
- AC_DEFINE(HAVE_ST_BLKSIZE, 1,
- [Define if your `struct stat' has `st_blksize'.])
-fi
+])dnl
])dnl AC_STRUCT_ST_BLKSIZE
dnl AC_STRUCT_ST_BLOCKS
dnl -------------------
+dnl If `struct stat' contains an `st_blocks' member, define
+dnl HAVE_STRUCT_STAT_ST_BLOCKS. Otherwise, add `fileblocks.o' to the
+dnl output variable LIBOBJS. We still define HAVE_ST_BLOCKS for backward
+dnl compatibility. In the future, we will activate specializations for
+dnl this macro, so don't obsolete it right now.
+dnl
+dnl AC_OBSOLETE([$0], [; replace it with
+dnl AC_CHECK_MEMBERS((struct stat.st_blocks), LIBOBJS="$LIBOBJS fileblocks.${ac_objext}")
+dnl Please note that it will define `HAVE_STRUCT_STAT_ST_BLOCKS',
+dnl and not `HAVE_ST_BLOCKS'.])dnl
+dnl
AC_DEFUN(AC_STRUCT_ST_BLOCKS,
-[AC_C_STRUCT_MEMBER(st_blocks, [#include <sys/types.h>
+[AC_CHECK_MEMBERS((struct stat.st_blocks),
+ [AC_DEFINE(HAVE_ST_BLOCKS, 1,
+ [Define if your `struct stat' has
+ `st_blocks'. Deprecated, use
+ `HAVE_STRUCT_STAT_ST_BLOCKS' instead.])],
+ [LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
+AC_SUBST(LIBOBJS)],
+ [#include <sys/types.h>
#include <sys/stat.h>
-], [struct stat], st_blocks)
-if test $ac_cv_c_struct_member_st_blocks = yes; then
- AC_DEFINE(HAVE_ST_BLOCKS, 1,
- [Define if your `struct stat' has `st_blocks'.])
-else
- LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
-fi
-AC_SUBST(LIBOBJS)dnl
+])dnl
])dnl AC_STRUCT_ST_BLOCKS
dnl AC_STRUCT_ST_RDEV
dnl -----------------
AC_DEFUN(AC_STRUCT_ST_RDEV,
-[AC_C_STRUCT_MEMBER(st_rdev, [#include <sys/types.h>
+[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
+AC_CHECK_MEMBERS((struct stat.st_rdev),
+ [AC_DEFINE(HAVE_ST_RDEV, 1,
+ [Define if your `struct stat' has `st_rdev'.
+ Deprecated, use
+ `HAVE_STRUCT_STAT_ST_RDEV' instead.])],,
+ [#include <sys/types.h>
#include <sys/stat.h>
-], [struct stat], st_rdev)
-if test $ac_cv_c_struct_member_st_rdev = yes; then
- AC_DEFINE(HAVE_ST_RDEV, 1,
- [Define if your `struct stat' has `st_rdev'.])
-fi
+])dnl
])dnl AC_STRUCT_ST_RDEV
@defmac AC_STRUCT_ST_BLKSIZE
@maindex STRUCT_ST_BLKSIZE
+@cvindex HAVE_STRUCT_STAT_ST_BLKSIZE
@cvindex HAVE_ST_BLKSIZE
If @code{struct stat} contains an @code{st_blksize} member, define
-@code{HAVE_ST_BLKSIZE}.
+@code{HAVE_STRUCT STAT_ST_BLKSIZE}. The former name,
+@code{HAVE_ST_BLKSIZE} is to be avoided, as its support will cease in
+the future. This macro is obsoleted, and should be replaced by
+@example
+AC_CHECK_MEMBERS((struct stat.st_blksize))
+@end example
+
@end defmac
@defmac AC_STRUCT_ST_BLOCKS
@maindex STRUCT_ST_BLOCKS
+@cvindex HAVE_STRUCT_STAT_ST_BLOCKS
@cvindex HAVE_ST_BLOCKS
@ovindex LIBOBJS
If @code{struct stat} contains an @code{st_blocks} member, define
-@code{HAVE_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o} to the
-output variable @code{LIBOBJS}.
+@code{HAVE_STRUCT STAT_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o}
+to the output variable @code{LIBOBJS}. The former name,
+@code{HAVE_ST_BLOCKS} is to be avoided, as its support will cease in the
+future.
@end defmac
@defmac AC_STRUCT_ST_RDEV
@maindex STRUCT_ST_RDEV
@cvindex HAVE_ST_RDEV
+@cvindex HAVE_STRUCT_STAT_ST_RDEV
If @code{struct stat} contains an @code{st_rdev} member, define
-@code{HAVE_ST_RDEV}.
+@code{HAVE_STRUCT_STAT_ST_RDEV}. The former name, @code{HAVE_ST_RDEV}
+is to be avoided, as its support will cease in the future.
+
+This macro is obsoleted, and should be replaced by
+@example
+AC_CHECK_MEMBERS((struct stat.st_rdev))
+@end example
+
@end defmac
@defmac AC_STRUCT_TM
@cvindex HAVE_TM_ZONE
@cvindex HAVE_TZNAME
Figure out how to get the current timezone. If @code{struct tm} has a
-@code{tm_zone} member, define @code{HAVE_TM_ZONE}. Otherwise, if the
-external array @code{tzname} is found, define @code{HAVE_TZNAME}.
+@code{tm_zone} member, define @code{HAVE_STRUCT_TM_TM_ZONE} (and the
+obsoleted @code{HAVE_TM_ZONE}). Otherwise, if the external array
+@code{tzname} is found, define @code{HAVE_TZNAME}.
@end defmac
@node Generic Structures, , Particular Structures, Structures
These macros are used to find structure members not covered by the
particular test macros.
-@defmac AC_C_STRUCT_MEMBER (@var{variable}, @var{includes}, @var{type}, @var{member})
-@maindex C_STRUCT_MEMBER
-Check whether @var{member} is a member of the C aggregate @var{type}.
-The value of @var{type} may be the name of any legitimate C data type
-including the keywords @code{struct} and @code{union}. @var{includes} is
-any @code{#include} statements needed to obtain the definition of the
-aggregate type. If @var{member} is present, set @var{variable} to
-@samp{yes}, otherwise @samp{no}. An example:
+@defmac AC_CHECK_MEMBER (@var{aggregate}.@var{member}, @ovar{action-if-found}, @ovar{action-if-not-found}, @ovar{includes})
+@maindex CHECK_MEMBER
+Check whether @var{member} is a member of the aggregate @var{aggregate}.
+FIXME: Default @var{includes} are provided.
@example
-AC_C_STRUCT_MEMBER(pw_gecos,
- [#include <pwd.h>], [struct passwd], pw_gecos)
+AC_CHECK_MEMBER(struct passwd.pw_gecos,,
+ [AC_FATAL([We need `struct passwd.pw_gecos'!])],
+ [#include <pwd.h>])
@end example
@end defmac
+@defmac AC_CHECK_MEMBERS ((@var{aggregate}.@var{member}, @dots{}), @ovar{action-if-found}, @ovar{action-if-not-found}, @ovar{includes})
+@maindex CHECK_MEMBERS
+Check for the existence of each aggregate members using the previous
+macro. When @var{member} belong to @var{aggregate}, define
+@code{HAVE_@var{aggregate}_@var{member}} (in all capitals, with spaces
+and dot replaced by underscore).
+
+This macro uses m4 lists:
+@example
+AC_CHECK_MEMBERS((struct stat.st_rdev, struct stat.st_blksize))
+@end example
+@end defmac
+
+
@node Typedefs, C Compiler Characteristics, Structures, Existing Tests
@section Typedefs
@defmac AC_STRUCT_ST_BLKSIZE
@maindex STRUCT_ST_BLKSIZE
+@cvindex HAVE_STRUCT_STAT_ST_BLKSIZE
@cvindex HAVE_ST_BLKSIZE
If @code{struct stat} contains an @code{st_blksize} member, define
-@code{HAVE_ST_BLKSIZE}.
+@code{HAVE_STRUCT STAT_ST_BLKSIZE}. The former name,
+@code{HAVE_ST_BLKSIZE} is to be avoided, as its support will cease in
+the future. This macro is obsoleted, and should be replaced by
+@example
+AC_CHECK_MEMBERS((struct stat.st_blksize))
+@end example
+
@end defmac
@defmac AC_STRUCT_ST_BLOCKS
@maindex STRUCT_ST_BLOCKS
+@cvindex HAVE_STRUCT_STAT_ST_BLOCKS
@cvindex HAVE_ST_BLOCKS
@ovindex LIBOBJS
If @code{struct stat} contains an @code{st_blocks} member, define
-@code{HAVE_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o} to the
-output variable @code{LIBOBJS}.
+@code{HAVE_STRUCT STAT_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o}
+to the output variable @code{LIBOBJS}. The former name,
+@code{HAVE_ST_BLOCKS} is to be avoided, as its support will cease in the
+future.
@end defmac
@defmac AC_STRUCT_ST_RDEV
@maindex STRUCT_ST_RDEV
@cvindex HAVE_ST_RDEV
+@cvindex HAVE_STRUCT_STAT_ST_RDEV
If @code{struct stat} contains an @code{st_rdev} member, define
-@code{HAVE_ST_RDEV}.
+@code{HAVE_STRUCT_STAT_ST_RDEV}. The former name, @code{HAVE_ST_RDEV}
+is to be avoided, as its support will cease in the future.
+
+This macro is obsoleted, and should be replaced by
+@example
+AC_CHECK_MEMBERS((struct stat.st_rdev))
+@end example
+
@end defmac
@defmac AC_STRUCT_TM
@cvindex HAVE_TM_ZONE
@cvindex HAVE_TZNAME
Figure out how to get the current timezone. If @code{struct tm} has a
-@code{tm_zone} member, define @code{HAVE_TM_ZONE}. Otherwise, if the
-external array @code{tzname} is found, define @code{HAVE_TZNAME}.
+@code{tm_zone} member, define @code{HAVE_STRUCT_TM_TM_ZONE} (and the
+obsoleted @code{HAVE_TM_ZONE}). Otherwise, if the external array
+@code{tzname} is found, define @code{HAVE_TZNAME}.
@end defmac
@node Generic Structures, , Particular Structures, Structures
These macros are used to find structure members not covered by the
particular test macros.
-@defmac AC_C_STRUCT_MEMBER (@var{variable}, @var{includes}, @var{type}, @var{member})
-@maindex C_STRUCT_MEMBER
-Check whether @var{member} is a member of the C aggregate @var{type}.
-The value of @var{type} may be the name of any legitimate C data type
-including the keywords @code{struct} and @code{union}. @var{includes} is
-any @code{#include} statements needed to obtain the definition of the
-aggregate type. If @var{member} is present, set @var{variable} to
-@samp{yes}, otherwise @samp{no}. An example:
+@defmac AC_CHECK_MEMBER (@var{aggregate}.@var{member}, @ovar{action-if-found}, @ovar{action-if-not-found}, @ovar{includes})
+@maindex CHECK_MEMBER
+Check whether @var{member} is a member of the aggregate @var{aggregate}.
+FIXME: Default @var{includes} are provided.
@example
-AC_C_STRUCT_MEMBER(pw_gecos,
- [#include <pwd.h>], [struct passwd], pw_gecos)
+AC_CHECK_MEMBER(struct passwd.pw_gecos,,
+ [AC_FATAL([We need `struct passwd.pw_gecos'!])],
+ [#include <pwd.h>])
@end example
@end defmac
+@defmac AC_CHECK_MEMBERS ((@var{aggregate}.@var{member}, @dots{}), @ovar{action-if-found}, @ovar{action-if-not-found}, @ovar{includes})
+@maindex CHECK_MEMBERS
+Check for the existence of each aggregate members using the previous
+macro. When @var{member} belong to @var{aggregate}, define
+@code{HAVE_@var{aggregate}_@var{member}} (in all capitals, with spaces
+and dot replaced by underscore).
+
+This macro uses m4 lists:
+@example
+AC_CHECK_MEMBERS((struct stat.st_rdev, struct stat.st_blksize))
+@end example
+@end defmac
+
+
@node Typedefs, C Compiler Characteristics, Structures, Existing Tests
@section Typedefs
dnl Extract the aggregate name, and the member name
AC_VAR_IF_INDIR([$1],
[AC_FATAL([$0: requires manifest arguments])],
-[pushdef(AC_Member_Aggregate, [patsubst([$1], [\.[^.]*])])dnl
+[ifelse(regexp([$1], [\.]), -1,
+ [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
+pushdef(AC_Member_Aggregate, [patsubst([$1], [\.[^.]*])])dnl
pushdef(AC_Member_Member, [patsubst([$1], [.*\.])])])dnl
AC_CACHE_CHECK([for $1], ac_Member,
-[AC_TRY_COMPILE(m4_default([$4
-], [#include <stdio.h>
-#include <sys/types.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
-]),
+[AC_TRY_COMPILE(AC_INCLUDES_DEFAULT([$4]),
ac_Member_Aggregate foo;
foo.ac_Member_Member;,
-AC_VAR_SET(ac_Member, yes), AC_VAR_SET(ac_Member, no))])
+ AC_VAR_SET(ac_Member, yes),
+ AC_VAR_SET(ac_Member, no))])
AC_SHELL_IFELSE(test AC_VAR_GET(ac_Member) = yes,
[$2], [$3])dnl
popdef([AC_Member_Member])dnl
[$4])])])
-dnl Check if a particular structure member exists.
-dnl AC_C_STRUCT_MEMBER(VARIABLE, INCLUDES, TYPE, MEMBER)
-AC_DEFUN(AC_C_STRUCT_MEMBER,
-[AC_CACHE_CHECK([for member $4 in aggregate type $3],ac_cv_c_struct_member_$1,
- [AC_TRY_COMPILE([$2], [$3 foo; foo.$4;],
- ac_cv_c_struct_member_$1=yes,ac_cv_c_struct_member_$1=no)])
-$1="$ac_cv_c_struct_member_$1"])
-
dnl ### Default headers.
dnl ------------------
AC_DEFUN(AC_STRUCT_TIMEZONE,
[AC_REQUIRE([AC_STRUCT_TM])dnl
-AC_C_STRUCT_MEMBER(tm_zone, [#include <sys/types.h>
+AC_CHECK_MEMBERS((struct tm.tm_zone),,,[#include <sys/types.h>
#include <$ac_cv_struct_tm>
-], [struct tm], tm_zone)
-if test "$ac_cv_c_struct_member_tm_zone" = yes; then
+])
+if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
AC_DEFINE(HAVE_TM_ZONE, 1,
- [Define if your `struct tm' has `tm_zone'.])
+ [Define if your `struct tm' has `tm_zone'. Deprecated, use
+ `HAVE_STRUCT_TM_TM_ZONE' instead.])
else
AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
[AC_TRY_LINK(
])dnl AC_STRUCT_TIMEZONE
+
+dnl FIXME: The following three macros should no longer be supported in the
+dnl future. They made sense when there was no means to directly check for
+dnl members of aggregates. In the future, they will be remove, that's why
+dnl they are obsoleted.
+
+
dnl AC_STRUCT_ST_BLKSIZE
dnl --------------------
AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
-[AC_C_STRUCT_MEMBER(st_blksize, [#include <sys/types.h>
+[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
+AC_CHECK_MEMBERS((struct stat.st_blksize),
+ [AC_DEFINE(HAVE_ST_BLKSIZE, 1,
+ [Define if your `struct stat' has
+ `st_blksize'. Deprecated, use
+ `HAVE_STRUCT_STAT_ST_BLKSIZE' instead.])],,
+ [#include <sys/types.h>
#include <sys/stat.h>
-], [struct stat], st_blksize)
-if test $ac_cv_c_struct_member_st_blksize = yes; then
- AC_DEFINE(HAVE_ST_BLKSIZE, 1,
- [Define if your `struct stat' has `st_blksize'.])
-fi
+])dnl
])dnl AC_STRUCT_ST_BLKSIZE
dnl AC_STRUCT_ST_BLOCKS
dnl -------------------
+dnl If `struct stat' contains an `st_blocks' member, define
+dnl HAVE_STRUCT_STAT_ST_BLOCKS. Otherwise, add `fileblocks.o' to the
+dnl output variable LIBOBJS. We still define HAVE_ST_BLOCKS for backward
+dnl compatibility. In the future, we will activate specializations for
+dnl this macro, so don't obsolete it right now.
+dnl
+dnl AC_OBSOLETE([$0], [; replace it with
+dnl AC_CHECK_MEMBERS((struct stat.st_blocks), LIBOBJS="$LIBOBJS fileblocks.${ac_objext}")
+dnl Please note that it will define `HAVE_STRUCT_STAT_ST_BLOCKS',
+dnl and not `HAVE_ST_BLOCKS'.])dnl
+dnl
AC_DEFUN(AC_STRUCT_ST_BLOCKS,
-[AC_C_STRUCT_MEMBER(st_blocks, [#include <sys/types.h>
+[AC_CHECK_MEMBERS((struct stat.st_blocks),
+ [AC_DEFINE(HAVE_ST_BLOCKS, 1,
+ [Define if your `struct stat' has
+ `st_blocks'. Deprecated, use
+ `HAVE_STRUCT_STAT_ST_BLOCKS' instead.])],
+ [LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
+AC_SUBST(LIBOBJS)],
+ [#include <sys/types.h>
#include <sys/stat.h>
-], [struct stat], st_blocks)
-if test $ac_cv_c_struct_member_st_blocks = yes; then
- AC_DEFINE(HAVE_ST_BLOCKS, 1,
- [Define if your `struct stat' has `st_blocks'.])
-else
- LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
-fi
-AC_SUBST(LIBOBJS)dnl
+])dnl
])dnl AC_STRUCT_ST_BLOCKS
dnl AC_STRUCT_ST_RDEV
dnl -----------------
AC_DEFUN(AC_STRUCT_ST_RDEV,
-[AC_C_STRUCT_MEMBER(st_rdev, [#include <sys/types.h>
+[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
+AC_CHECK_MEMBERS((struct stat.st_rdev),
+ [AC_DEFINE(HAVE_ST_RDEV, 1,
+ [Define if your `struct stat' has `st_rdev'.
+ Deprecated, use
+ `HAVE_STRUCT_STAT_ST_RDEV' instead.])],,
+ [#include <sys/types.h>
#include <sys/stat.h>
-], [struct stat], st_rdev)
-if test $ac_cv_c_struct_member_st_rdev = yes; then
- AC_DEFINE(HAVE_ST_RDEV, 1,
- [Define if your `struct stat' has `st_rdev'.])
-fi
+])dnl
])dnl AC_STRUCT_ST_RDEV