diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-10 18:44:45 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-10 18:44:45 (GMT) |
commit | 5ea2828c663855453abdb958575595a427a5a88e (patch) | |
tree | 646ed811ab86a2e4bde5c9caf6ad75192354b0d7 /configure.in | |
parent | 0ea31a93551d352fe989d8bc2728046abc4fc6c4 (diff) | |
download | cpython-5ea2828c663855453abdb958575595a427a5a88e.zip cpython-5ea2828c663855453abdb958575595a427a5a88e.tar.gz cpython-5ea2828c663855453abdb958575595a427a5a88e.tar.bz2 |
Merged revisions 84674 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84674 | antoine.pitrou | 2010-09-10 20:39:00 +0200 (ven., 10 sept. 2010) | 3 lines
Followup to #4026: better patch for flock detection.
........
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/configure.in b/configure.in index 99e8f9d..3ccb66a 100644 --- a/configure.in +++ b/configure.in @@ -2641,29 +2641,23 @@ AC_TRY_COMPILE([ AC_MSG_RESULT(no) ) -AC_MSG_CHECKING(for flock) -have_flock=no -AC_TRY_COMPILE([ -#include "confdefs.h" -#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_TRY_LINK([ - #include "confdefs.h" - #include <sys/file.h> - ], [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) |