Message115768
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] |
|
Date |
User |
Action |
Args |
2010-09-07 14:51:18 | sable | set | recipients:
+ sable, pitrou, drj, inkblotter, darkside, haubi |
2010-09-07 14:51:18 | sable | set | messageid: <1283871078.3.0.375167820076.issue4026@psf.upfronthosting.co.za> |
2010-09-07 14:51:17 | sable | link | issue4026 messages |
2010-09-07 14:51:16 | sable | create | |
|