Commit | Line | Data |
---|---|---|
f240aacb LC |
1 | # Configure a replacement for <sys/file.h>. |
2 | ||
3 | # Copyright (C) 2008 Free Software Foundation, Inc. | |
4 | # This file is free software; the Free Software Foundation | |
5 | # gives unlimited permission to copy and/or distribute it, | |
6 | # with or without modifications, as long as this notice is preserved. | |
7 | ||
8 | # Written by Richard W.M. Jones. | |
9 | ||
10 | AC_DEFUN([gl_HEADER_SYS_FILE_H], | |
11 | [ | |
12 | AC_REQUIRE([gl_HEADER_SYS_FILE_H_DEFAULTS]) | |
13 | ||
14 | dnl Only flock is defined in a working <sys/file.h>. If that | |
15 | dnl function is already there, we don't want to do any substitution. | |
16 | AC_CHECK_FUNCS_ONCE([flock]) | |
17 | ||
18 | gl_CHECK_NEXT_HEADERS([sys/file.h]) | |
19 | SYS_FILE_H='sys/file.h' | |
20 | AC_SUBST([SYS_FILE_H]) | |
21 | ||
22 | AC_CHECK_HEADERS_ONCE([sys/file.h]) | |
23 | if test $ac_cv_header_sys_file_h = yes; then | |
24 | HAVE_SYS_FILE_H=1 | |
25 | else | |
26 | HAVE_SYS_FILE_H=0 | |
27 | fi | |
28 | AC_SUBST([HAVE_SYS_FILE_H]) | |
29 | ]) | |
30 | ||
31 | AC_DEFUN([gl_HEADER_SYS_FILE_MODULE_INDICATOR], | |
32 | [ | |
33 | AC_REQUIRE([gl_HEADER_SYS_FILE_H_DEFAULTS]) | |
34 | GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=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 | ]) |