(original) (raw)
changeset: 105781:51b09b10d4f8 branch: 3.6 parent: 105779:cc61d1d45291 user: Xavier de Gaye xdegaye@users.sourceforge.net date: Thu Dec 22 10:38:59 2016 +0100 files: Misc/NEWS configure configure.ac pyconfig.h.in description: Issue #28762: lockf() is available on Android API level 24, but the F_LOCK macro is not defined in android-ndk-r13. diff -r cc61d1d45291 -r 51b09b10d4f8 Misc/NEWS --- a/Misc/NEWS Thu Dec 22 15:31:22 2016 +0800 +++ b/Misc/NEWS Thu Dec 22 10:38:59 2016 +0100 @@ -84,6 +84,9 @@ Build ----- +- Issue #28762: lockf() is available on Android API level 24, but the F_LOCK + macro is not defined in android-ndk-r13. + - Issue #28538: Fix the compilation error that occurs because if_nameindex() is available on Android API level 24, but the if_nameindex structure is not defined. diff -r cc61d1d45291 -r 51b09b10d4f8 configure --- a/configure Thu Dec 22 15:31:22 2016 +0800 +++ b/configure Thu Dec 22 10:38:59 2016 +0100 @@ -11198,7 +11198,7 @@ futimens futimes gai_strerror getentropy \ getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \ - initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \ + initgroups kill killpg lchmod lchown linkat lstat lutimes mmap \ memrchr mbrtowc mkdirat mkfifo \ mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \ posix_fallocate posix_fadvise pread \ @@ -12690,6 +12690,35 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +# Issue #28762: lockf() is available on Android API level 24, but the F_LOCK +# macro is not defined in android-ndk-r13. +{ asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: checking for lockf" >&5 +$as_echo_n "checking for lockf... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +lockf(0, F_LOCK, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +$as_echo "#define HAVE_LOCKF 1" >>confdefs.h + + { asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. { asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 diff -r cc61d1d45291 -r 51b09b10d4f8 configure.ac --- a/configure.ac Thu Dec 22 15:31:22 2016 +0800 +++ b/configure.ac Thu Dec 22 10:38:59 2016 +0100 @@ -3384,7 +3384,7 @@ futimens futimes gai_strerror getentropy \ getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \ - initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \ + initgroups kill killpg lchmod lchown linkat lstat lutimes mmap \ memrchr mbrtowc mkdirat mkfifo \ mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \ posix_fallocate posix_fadvise pread \ @@ -3761,6 +3761,15 @@ [AC_MSG_RESULT(no) ]) +# Issue #28762: lockf() is available on Android API level 24, but the F_LOCK +# macro is not defined in android-ndk-r13. +AC_MSG_CHECKING(for lockf) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],[[lockf(0, F_LOCK, 0);]])], + [AC_DEFINE(HAVE_LOCKF, 1, Define to 1 if you have the 'lockf' function and the F_LOCK macro.) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) +]) + # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. AC_MSG_CHECKING(for getaddrinfo) diff -r cc61d1d45291 -r 51b09b10d4f8 pyconfig.h.in --- a/pyconfig.h.in Thu Dec 22 15:31:22 2016 +0800 +++ b/pyconfig.h.in Thu Dec 22 10:38:59 2016 +0100 @@ -472,7 +472,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IEEEFP_H -/* Define to 1 if you have the `if_nameindex' function. */ +/* Define to 1 if you have the 'if_nameindex' function. */ #undef HAVE_IF_NAMEINDEX /* Define if you have the 'inet_aton' function. */ @@ -574,7 +574,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_TIPC_H -/* Define to 1 if you have the `lockf' function. */ +/* Define to 1 if you have the 'lockf' function and the F_LOCK macro. */ #undef HAVE_LOCKF /* Define to 1 if you have the `log1p' function. *//xdegaye@users.sourceforge.net