]> Savannah Git Hosting - gnulib.git/commitdiff
lchmod: Improve cross-compilation guess.
authorBruno Haible <bruno@clisp.org>
Sun, 16 Feb 2020 18:51:25 +0000 (19:51 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 16 Feb 2020 18:51:25 +0000 (19:51 +0100)
* m4/lchmod.m4 (gl_FUNC_LCHMOD): Require AC_CANONICAL_HOST. When
cross-compiling, guess depending on the platform.

ChangeLog
m4/lchmod.m4

index 288bae705f32a68bcbaf897aea003876ee13b1f3..beacc09263366d1aba095f46cf8276cc5806fb2f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-02-16  Bruno Haible  <bruno@clisp.org>
+
+       lchmod: Improve cross-compilation guess.
+       * m4/lchmod.m4 (gl_FUNC_LCHMOD): Require AC_CANONICAL_HOST. When
+       cross-compiling, guess depending on the platform.
+
 2020-02-16  Bruno Haible  <bruno@clisp.org>
 
        fstrcmp: Add API to clean up resources.
index 68dab7a4ac484a9a359e1b7ebdf5329de38348ba..1646bd7db345a2a31c046a6febffe3e876dc78c1 100644 (file)
@@ -1,4 +1,4 @@
-#serial 4
+#serial 5
 
 dnl Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
@@ -15,6 +15,8 @@ AC_DEFUN([gl_FUNC_LCHMOD],
   dnl Persuade glibc <sys/stat.h> to declare lchmod().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
   AC_CHECK_FUNCS_ONCE([fchmodat lchmod lstat])
   if test "$ac_cv_func_lchmod" = no; then
     HAVE_LCHMOD=0
@@ -56,7 +58,12 @@ AC_DEFUN([gl_FUNC_LCHMOD],
             ]])],
          [gl_cv_func_lchmod_works=yes],
          [gl_cv_func_lchmod_works=no],
-         [gl_cv_func_lchmod_works=$gl_cross_guess_normal])
+         [case "$host_os" in
+            dnl Guess no on Linux with glibc, yes otherwise.
+            linux-gnu*) gl_cv_func_lchmod_works="guessing no" ;;
+            *)          gl_cv_func_lchmod_works="$gl_cross_guess_normal" ;;
+          esac
+         ])
        rm -f conftest.lchmod])
     case $gl_cv_func_lchmod_works in
       *yes) ;;