+2007-05-01 Bruno Haible <bruno@clisp.org>
+
+ * lib/sys_stat_.h: Test HAVE_LSTAT, HAVE_DECL_MKDIR, HAVE_IO_H at
+ configure time.
+ * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Substitute HAVE_LSTAT,
+ HAVE_DECL_MKDIR, HAVE_IO_H via AC_SUBST.
+ * modules/sys_stat (Makefile.am): Substitute their values into
+ sys/stat.h.
+
2007-05-01 Bruno Haible <bruno@clisp.org>
* lib/glob_.h: Test HAVE_SYS_CDEFS_H at configure time.
* m4/isc-posix.m4: New file.
-1998-05-10 Jim Meyering <meyering@ascend.com>
+1998-05-10 Jim Meyering <meyering@ascend.com>
\ No newline at end of file
/* mingw does not support symlinks, therefore it does not have lstat. But
without links, stat does just fine. */
-#if ! HAVE_LSTAT
+#if ! @HAVE_LSTAT@
# define lstat stat
#endif
/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
Additionally, it declares _mkdir (and depending on compile flags, an
alias mkdir), only in the nonstandard io.h. */
-#if ! HAVE_DECL_MKDIR && HAVE_IO_H
+#if ! @HAVE_DECL_MKDIR@ && @HAVE_IO_H@
# include <io.h>
static inline int
-# sys_stat_h.m4 serial 4 -*- Autoconf -*-
-dnl Copyright (C) 2006 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 5 -*- Autoconf -*-
+dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl Check for lstat. Systems that lack it (mingw) also lack symlinks, so
dnl stat is a good replacement.
AC_CHECK_FUNCS_ONCE([lstat])
+ if test $ac_cv_func_lstat = yes; then
+ HAVE_LSTAT=1
+ else
+ HAVE_LSTAT=0
+ fi
+ AC_SUBST([HAVE_LSTAT])
dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard <io.h>
dnl instead.
[],
[AC_CHECK_HEADERS([io.h])],
[#include <sys/stat.h>])
+ if test $ac_cv_have_decl_mkdir = yes; then
+ HAVE_DECL_MKDIR=1
+ else
+ HAVE_DECL_MKDIR=0
+ fi
+ AC_SUBST([HAVE_DECL_MKDIR])
+ if test "$ac_cv_header_io_h" = yes; then
+ HAVE_IO_H=1
+ else
+ HAVE_IO_H=0
+ fi
+ AC_SUBST([HAVE_IO_H])
AC_REQUIRE([AC_C_INLINE])
dnl Check for broken stat macros.
rm -f $@-t $@
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \
+ -e 's|@''HAVE_IO_H''@|$(HAVE_IO_H)|g' \
+ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+ -e 's|@''HAVE_DECL_MKDIR''@|$(HAVE_DECL_MKDIR)|g' \
< $(srcdir)/sys_stat_.h; \
} > $@-t
mv $@-t $@