4 dnl Determine whether lstat has the bug that it succeeds when given the
5 dnl zero-length file name argument. The lstat 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_lstat if the replacement function should be used. */
15 AC_DEFUN(jm_FUNC_LSTAT,
17 AC_CACHE_CHECK([for working lstat], jm_cv_func_working_lstat,
19 # include <sys/types.h>
20 # include <sys/stat.h>
26 exit (lstat ("", &sbuf) == 0 ? 1 : 0);
29 jm_cv_func_working_lstat=yes,
30 jm_cv_func_working_lstat=no,
31 dnl When crosscompiling, assume lstat is broken.
32 jm_cv_func_working_lstat=no)
34 if test $jm_cv_func_working_lstat = no; then
35 LIBOBJS="$LIBOBJS lstat.o"
36 AC_DEFINE_UNQUOTED(lstat, rpl_lstat)