[issue4026] fcntl extension fails to build on AIX 6.1

Sébastien Sablé report at bugs.python.org
Tue Sep 7 16:51:18 CEST 2010


Sébastien Sablé <sable at users.sourceforge.net> added the comment:

Here is a new test for flock. HAVE_FLOCK is defined if we can link a C application calling flock, or if flock is defined in libbsd.
FLOCK_NEEDS_LIBBSD is also defined in the second case.

AC_MSG_CHECKING(for flock)
have_flock=no
AC_TRY_LINK([
#include "confdefs.h" 
#include <sys/file.h>
], [void* p = flock; flock(0, 0)],
  [AC_CHECK_LIB(bsd,flock, [
    AC_DEFINE(FLOCK_NEEDS_LIBBSD, 1, Define if flock needs to be linked with bsd library.)
    have_flock=yes
    ])],
  [have_flock=yes]
)
if test "$have_flock" = yes ; then
  AC_DEFINE(HAVE_FLOCK, 1, Define if you have the 'flock' function.)
fi
AC_MSG_RESULT($have_flock)

I think that this new test would also cover your case with a broken AIX libbsd? [I haven't actually tried to compile it yet, if the behavior is OK I will test it in both autoconf formats and provide some new patches tomorrow]

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4026>
_______________________________________


More information about the Python-bugs-list mailing list