Commit | Line | Data |
---|---|---|
f240aacb | 1 | # Configure a replacement for <sys/file.h>. |
61cd9dc9 | 2 | # serial 3 |
f240aacb | 3 | |
61cd9dc9 | 4 | # Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. |
f240aacb LC |
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 Only flock is defined in a working <sys/file.h>. If that | |
16 | dnl function is already there, we don't want to do any substitution. | |
17 | AC_CHECK_FUNCS_ONCE([flock]) | |
18 | ||
19 | gl_CHECK_NEXT_HEADERS([sys/file.h]) | |
f240aacb LC |
20 | |
21 | AC_CHECK_HEADERS_ONCE([sys/file.h]) | |
22 | if test $ac_cv_header_sys_file_h = yes; then | |
23 | HAVE_SYS_FILE_H=1 | |
24 | else | |
25 | HAVE_SYS_FILE_H=0 | |
26 | fi | |
27 | AC_SUBST([HAVE_SYS_FILE_H]) | |
61cd9dc9 LC |
28 | |
29 | dnl Check for declarations of anything we want to poison if the | |
30 | dnl corresponding gnulib module is not in use. | |
31 | gl_WARN_ON_USE_PREPARE([[#include <sys/file.h> | |
32 | ]], [flock]) | |
f240aacb LC |
33 | ]) |
34 | ||
35 | AC_DEFUN([gl_HEADER_SYS_FILE_MODULE_INDICATOR], | |
36 | [ | |
37 | AC_REQUIRE([gl_HEADER_SYS_FILE_H_DEFAULTS]) | |
38 | GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 | |
39 | ]) | |
40 | ||
41 | AC_DEFUN([gl_HEADER_SYS_FILE_H_DEFAULTS], | |
42 | [ | |
43 | GNULIB_FLOCK=0; AC_SUBST([GNULIB_FLOCK]) | |
44 | HAVE_FLOCK=1; AC_SUBST([HAVE_FLOCK]) | |
45 | ]) |