1 # sys_stat_h.m4 serial 4 -*- Autoconf -*-
2 dnl Copyright (C) 2006 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])
16 dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard <io.h>
18 AC_CHECK_DECLS([mkdir],
20 [AC_CHECK_HEADERS([io.h])],
21 [#include <sys/stat.h>])
22 AC_REQUIRE([AC_C_INLINE])
24 dnl Check for broken stat macros.
25 AC_REQUIRE([AC_HEADER_STAT])
27 gl_ABSOLUTE_HEADER([sys/stat.h])
28 ABSOLUTE_SYS_STAT_H=\"$gl_cv_absolute_sys_stat_h\"
29 AC_SUBST([ABSOLUTE_SYS_STAT_H])
30 SYS_STAT_H='sys/stat.h'
31 AC_SUBST([SYS_STAT_H])
32 ]) # gl_HEADER_SYS_STAT_H