comparison m4/sys_stat_h.m4 @ 9954:0f61f5040489

Fix compilation errors related to rpl_mkdir on mingw.
author Bruno Haible <bruno@clisp.org>
date Mon, 21 Apr 2008 23:57:39 +0200
parents 6c1b311583d7
children 3eb22f9808e0
comparison
equal deleted inserted replaced
9953:5605642e7756 9954:0f61f5040489
1 # sys_stat_h.m4 serial 7 -*- Autoconf -*- 1 # sys_stat_h.m4 serial 8 -*- Autoconf -*-
2 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. 2 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation 3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it, 4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved. 5 dnl with or without modifications, as long as this notice is preserved.
6 6
7 dnl From Eric Blake. 7 dnl From Eric Blake.
8 dnl Test whether <sys/stat.h> contains lstat and mkdir or must be substituted. 8 dnl Test whether <sys/stat.h> contains lstat and mkdir or must be substituted.
9 9
10 AC_DEFUN([gl_HEADER_SYS_STAT_H], 10 AC_DEFUN([gl_HEADER_SYS_STAT_H],
11 [ 11 [
12 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
13
12 dnl Check for lstat. Systems that lack it (mingw) also lack symlinks, so 14 dnl Check for lstat. Systems that lack it (mingw) also lack symlinks, so
13 dnl stat is a good replacement. 15 dnl stat is a good replacement.
14 AC_CHECK_FUNCS_ONCE([lstat]) 16 AC_CHECK_FUNCS_ONCE([lstat])
15 if test $ac_cv_func_lstat = yes; then 17 if test $ac_cv_func_lstat = yes; then
16 HAVE_LSTAT=1 18 HAVE_LSTAT=1
17 else 19 else
18 HAVE_LSTAT=0 20 HAVE_LSTAT=0
19 fi 21 fi
20 AC_SUBST([HAVE_LSTAT]) 22 AC_SUBST([HAVE_LSTAT])
21 23
22 dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard <io.h> 24 dnl For the mkdir substitute.
23 dnl instead.
24 AC_CHECK_DECLS([mkdir],
25 [],
26 [AC_CHECK_HEADERS([io.h])],
27 [#include <sys/stat.h>])
28 if test $ac_cv_have_decl_mkdir = yes; then
29 HAVE_DECL_MKDIR=1
30 else
31 HAVE_DECL_MKDIR=0
32 fi
33 AC_SUBST([HAVE_DECL_MKDIR])
34 if test "$ac_cv_header_io_h" = yes; then
35 HAVE_IO_H=1
36 else
37 HAVE_IO_H=0
38 fi
39 AC_SUBST([HAVE_IO_H])
40 AC_REQUIRE([AC_C_INLINE]) 25 AC_REQUIRE([AC_C_INLINE])
41 26
42 dnl Check for broken stat macros. 27 dnl Check for broken stat macros.
43 AC_REQUIRE([AC_HEADER_STAT]) 28 AC_REQUIRE([AC_HEADER_STAT])
44 29
53 [Define to the type of st_nlink in struct stat, or a supertype.])], 38 [Define to the type of st_nlink in struct stat, or a supertype.])],
54 [#include <sys/types.h> 39 [#include <sys/types.h>
55 #include <sys/stat.h>]) 40 #include <sys/stat.h>])
56 41
57 ]) # gl_HEADER_SYS_STAT_H 42 ]) # gl_HEADER_SYS_STAT_H
43
44 AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
45 [
46 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
47 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
48 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
49 ])
50
51 AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
52 [
53 dnl Assume proper GNU behavior unless another module says otherwise.
54 REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
55 ])