diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-10 18:39:00 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-10 18:39:00 (GMT) |
commit | a4e4ae27fc7e3d88b5d102a85d1cf1e90beb710e (patch) | |
tree | 740f93c33124b95a4c0da8a6a5c4116df02837ac /configure.in | |
parent | 66d00ad2eae52389af36e37dba64b226ede712b9 (diff) | |
download | cpython-a4e4ae27fc7e3d88b5d102a85d1cf1e90beb710e.zip cpython-a4e4ae27fc7e3d88b5d102a85d1cf1e90beb710e.tar.gz cpython-a4e4ae27fc7e3d88b5d102a85d1cf1e90beb710e.tar.bz2 |
Followup to #4026: better patch for flock detection.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/configure.in b/configure.in index 3e82da2..5caa5d7 100644 --- a/configure.in +++ b/configure.in @@ -2641,27 +2641,23 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ [AC_MSG_RESULT(no) ]) -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.) - have_flock=yes +AC_CACHE_CHECK([for flock declaration], [ac_cv_flock_decl], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include <sys/file.h>], + [void* p = flock] + )], + [ac_cv_flock_decl=yes], + [ac_cv_flock_decl=no] + ) ]) -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.) - ]) - ]) +if test "x${ac_cv_flock_decl}" = xyes; then + AC_CHECK_FUNCS(flock,, + AC_CHECK_LIB(bsd,flock, + [AC_DEFINE(HAVE_FLOCK) + AC_DEFINE(FLOCK_NEEDS_LIBBSD, 1, Define if flock needs to be linked with bsd library.) + ]) + ) fi AC_MSG_CHECKING(for getpagesize) |