Merge remote-tracking branch 'origin/stable-2.0'
[bpt/guile.git] / m4 / sys_file_h.m4
1 # Configure a replacement for <sys/file.h>.
2 # serial 6
3
4 # Copyright (C) 2008-2013 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # Written by Richard W.M. Jones.
10
11 AC_DEFUN([gl_HEADER_SYS_FILE_H],
12 [
13 AC_REQUIRE([gl_HEADER_SYS_FILE_H_DEFAULTS])
14
15 dnl <sys/file.h> is always overridden, because of GNULIB_POSIXCHECK.
16 gl_CHECK_NEXT_HEADERS([sys/file.h])
17
18 if test $ac_cv_header_sys_file_h = yes; then
19 HAVE_SYS_FILE_H=1
20 else
21 HAVE_SYS_FILE_H=0
22 fi
23 AC_SUBST([HAVE_SYS_FILE_H])
24
25 dnl Check for declarations of anything we want to poison if the
26 dnl corresponding gnulib module is not in use.
27 gl_WARN_ON_USE_PREPARE([[#include <sys/file.h>
28 ]], [flock])
29 ])
30
31 AC_DEFUN([gl_HEADER_SYS_FILE_MODULE_INDICATOR],
32 [
33 AC_REQUIRE([gl_HEADER_SYS_FILE_H_DEFAULTS])
34 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
35 ])
36
37 AC_DEFUN([gl_HEADER_SYS_FILE_H_DEFAULTS],
38 [
39 GNULIB_FLOCK=0; AC_SUBST([GNULIB_FLOCK])
40 HAVE_FLOCK=1; AC_SUBST([HAVE_FLOCK])
41 ])