From 5224e6008f80cc9cb21ed5265e00eff60128dd2a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Wed, 27 Aug 2008 10:42:31 +0200
Subject: [PATCH] Check for fcntl file locking.

Rev: nettle/configure.ac:1.7
---
 configure.ac | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/configure.ac b/configure.ac
index 92d69f55..c47a81fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -364,6 +364,30 @@ LSH_GCC_ATTRIBUTES
 # sys/types.h is needed on some systems, in particular cygwin.
 AX_CREATE_STDINT_H([nettle-stdint.h], [sys/types.h])
 
+# Check for file locking. We (AC_PROG_CC?) have already checked for
+# sys/types.h and unistd.h.
+AC_CACHE_CHECK([for fcntl file locking],
+		nettle_cv_fcntl_locking,
+[AC_TRY_COMPILE([
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <fcntl.h>
+],[
+int op = F_SETLKW;
+struct flock fl;
+],
+nettle_cv_fcntl_locking=yes,
+nettle_cv_fcntl_locking=no)])
+
+AH_TEMPLATE([HAVE_FCNTL_LOCKING], [Define if fcntl file locking is available])
+if test "x$nettle_cv_fcntl_locking" = "xyes" ; then
+  AC_DEFINE(HAVE_FCNTL_LOCKING)
+fi
+
 # Checks for libraries
 AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
     [AC_MSG_WARN(
-- 
GitLab