1
# sys_stat_h.m4 serial 6 -*- Autoconf -*-
2
dnl Copyright (C) 2006-2007 Free Software Foundation, Inc.
3
dnl This file is free software; the Free Software Foundation
4
dnl gives unlimited permission to copy and/or distribute it,
5
dnl with or without modifications, as long as this notice is preserved.
8
dnl Test whether <sys/stat.h> contains lstat and mkdir or must be substituted.
10
AC_DEFUN([gl_HEADER_SYS_STAT_H],
12
dnl Check for lstat. Systems that lack it (mingw) also lack symlinks, so
13
dnl stat is a good replacement.
14
AC_CHECK_FUNCS_ONCE([lstat])
15
if test $ac_cv_func_lstat = yes; then
20
AC_SUBST([HAVE_LSTAT])
22
dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard <io.h>
24
AC_CHECK_DECLS([mkdir],
26
[AC_CHECK_HEADERS([io.h])],
27
[#include <sys/stat.h>])
28
if test $ac_cv_have_decl_mkdir = yes; then
33
AC_SUBST([HAVE_DECL_MKDIR])
34
if test "$ac_cv_header_io_h" = yes; then
40
AC_REQUIRE([AC_C_INLINE])
42
dnl Check for broken stat macros.
43
AC_REQUIRE([AC_HEADER_STAT])
45
gl_CHECK_NEXT_HEADERS([sys/stat.h])
46
SYS_STAT_H='sys/stat.h'
47
AC_SUBST([SYS_STAT_H])
48
]) # gl_HEADER_SYS_STAT_H