From 0fd5a7338cbaf7a61ab5bad270c1b0311047d0f9 Mon Sep 17 00:00:00 2001 From: Joshua Root Date: Sat, 13 Apr 2019 01:51:35 +1000 Subject: bpo-34652: Use AC_CHECK_FUNCS for lchmod. (GH-12799) A fix for 69e96910153219b0b15a18323b917bd74336d229, which resulted in lchmod being disabled on all platforms, not just Linux. (cherry picked from commit ed709d5699716bf7237856dc20aba321e2dfff6d) --- configure | 6 ++++++ configure.ac | 2 +- pyconfig.h.in | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure b/configure index dd30c11..ced0a00 100755 --- a/configure +++ b/configure @@ -10632,10 +10632,16 @@ done # links. Some libc implementations have a stub lchmod implementation that always # returns an error. if test "$MACHDEP" != linux; then + for ac_func in lchmod +do : ac_fn_c_check_func "$LINENO" "lchmod" "ac_cv_func_lchmod" if test "x$ac_cv_func_lchmod" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LCHMOD 1 +_ACEOF fi +done fi diff --git a/configure.ac b/configure.ac index 7396c1f..13b40f2 100644 --- a/configure.ac +++ b/configure.ac @@ -3138,7 +3138,7 @@ AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \ # links. Some libc implementations have a stub lchmod implementation that always # returns an error. if test "$MACHDEP" != linux; then - AC_CHECK_FUNC(lchmod) + AC_CHECK_FUNCS(lchmod) fi # For some functions, having a definition is not sufficient, since diff --git a/pyconfig.h.in b/pyconfig.h.in index f828677..11c4a66 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -439,6 +439,9 @@ /* Define to 1 if you have the 'lchflags' function. */ #undef HAVE_LCHFLAGS +/* Define to 1 if you have the `lchmod' function. */ +#undef HAVE_LCHMOD + /* Define to 1 if you have the `lchown' function. */ #undef HAVE_LCHOWN -- cgit v0.12