summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in18
1 files changed, 16 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index cbcbbf0..1d13b18 100644
--- a/configure.in
+++ b/configure.in
@@ -2775,13 +2775,27 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
])
AC_MSG_CHECKING(for flock)
+have_flock=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/file.h>
]], [[void* p = flock]])],
[AC_DEFINE(HAVE_FLOCK, 1, Define if you have the 'flock' function.)
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
+ have_flock=yes
])
+AC_MSG_RESULT($have_flock)
+
+if test "$have_flock" = yes ; then
+ AC_MSG_CHECKING(if flock requires additional libraries.)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #include <sys/file.h>
+ ]], [[void *p = flock; flock(0, 0)]])],
+ [AC_MSG_RESULT(no)],
+ [AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(bsd,flock, [
+ AC_DEFINE(FLOCK_NEEDS_LIBBSD, 1, Define if flock needs to be linked with bsd library.)
+ ])
+ ])
+fi
AC_MSG_CHECKING(for getpagesize)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[