[Python-checkins] bpo-34652: Use AC_CHECK_FUNCS for lchmod. (GH-12799)

Benjamin Peterson webhook-mailer at python.org
Fri Apr 12 11:51:38 EDT 2019


https://github.com/python/cpython/commit/0fd5a7338cbaf7a61ab5bad270c1b0311047d0f9
commit: 0fd5a7338cbaf7a61ab5bad270c1b0311047d0f9
branch: 2.7
author: Joshua Root <jmr at macports.org>
committer: Benjamin Peterson <benjamin at python.org>
date: 2019-04-12T08:51:35-07:00
summary:

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)

files:
M configure
M configure.ac
M pyconfig.h.in

diff --git a/configure b/configure
index dd30c11ee1fa..ced0a0043fb6 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 7396c1f2ff45..13b40f2edd80 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 f828677dda01..11c4a66873c1 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
 



More information about the Python-checkins mailing list