4 dnl Determine whether stat has the bug that it succeeds when given the
5 dnl zero-length file name argument. The stat from SunOS4.1.4 does this.
7 dnl If it doesn't, arrange to use the replacement function.
9 dnl If you use this macro in a package, you should
10 dnl add the following two lines to acconfig.h:
11 dnl /* Define to rpl_stat if the replacement function should be used. */
15 AC_DEFUN(jm_FUNC_STAT,
17 AC_CACHE_CHECK([for working stat], jm_cv_func_working_stat,
19 # include <sys/types.h>
20 # include <sys/stat.h>
26 exit (stat ("", &sbuf) == 0 ? 1 : 0);
29 jm_cv_func_working_stat=yes,
30 jm_cv_func_working_stat=no,
31 dnl When crosscompiling, assume stat is broken.
32 jm_cv_func_working_stat=no)
34 if test $jm_cv_func_working_stat = no; then
35 LIBOBJS="$LIBOBJS stat.o"
36 AC_DEFINE_UNQUOTED(stat, rpl_stat)