git-merge-changelog: Simplify installation instructions.
[gnulib.git] / m4 / flock.m4
blob1277018e416addb4c2c06a030d9f39e6c23c2829
1 # flock.m4
2 # serial 4
3 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_FLOCK],
10   AC_REQUIRE([gl_SYS_FILE_H_DEFAULTS])
11   AC_CHECK_FUNCS_ONCE([flock])
12   if test $ac_cv_func_flock = no; then
13     HAVE_FLOCK=0
14   fi
17 dnl Prerequisites of lib/flock.c.
18 AC_DEFUN([gl_PREREQ_FLOCK],
20   AC_CHECK_FUNCS_ONCE([fcntl])
21   AC_CHECK_HEADERS_ONCE([unistd.h])
23   dnl Do we have a POSIX fcntl lock implementation?
24   AC_CHECK_MEMBERS([struct flock.l_type],[],[],[[#include <fcntl.h>]])