]> Savannah Git Hosting - gnulib.git/commitdiff
linkat_nofollow: Add fallback case for cross compiling
authorKevin Cernekee <cernekee@google.com>
Wed, 11 Feb 2015 23:22:55 +0000 (15:22 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 11 Feb 2015 23:47:45 +0000 (15:47 -0800)
* m4/linkat.m4: Guess no for Darwin, yes otherwise.

ChangeLog
m4/linkat.m4

index fea5f0ff374bbdd2f6dc54553008ddeeece0cc8d..9fc1f5621b7c66cf710194236b2d5ae2b9d762e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,6 +49,9 @@
        * modules/euidaccess (Depends-on): Add fcntl-h to ensure that
        AT_EACCESS gets declared.
 
+       linkat_nofollow: Add fallback case for cross compiling
+       * m4/linkat.m4: Guess no for Darwin, yes otherwise.
+
 2015-02-08  Daiki Ueno  <ueno@gnu.org>
 
        uniname/unimame-tests: don't link with -lunistring
index 83429c534df0c44ca0597e012852747c8807c59e..567cb5dcaae9536f31a58f28a1667a6b97f5f0bc 100644 (file)
@@ -38,7 +38,16 @@ AC_DEFUN([gl_FUNC_LINKAT],
          [gl_cv_func_linkat_nofollow=yes
           LINKAT_SYMLINK_NOTSUP=0],
          [gl_cv_func_linkat_nofollow=no
-          LINKAT_SYMLINK_NOTSUP=1])
+          LINKAT_SYMLINK_NOTSUP=1],
+         [case "$host_os" in
+           darwin*)
+             gl_cv_func_linkat_nofollow="guessing no"
+             LINKAT_SYMLINK_NOTSUP=1 ;;
+           *)
+             gl_cv_func_linkat_nofollow="guessing yes"
+             LINKAT_SYMLINK_NOTSUP=0 ;;
+          esac])
+
        rm -rf conftest.l1 conftest.l2])
 
     AC_CACHE_CHECK([whether linkat handles trailing slash correctly],
@@ -90,7 +99,12 @@ AC_DEFUN([gl_FUNC_LINKAT],
       *)    gl_linkat_slash_bug=1 ;;
     esac
 
-    if test "$gl_cv_func_linkat_nofollow" != yes \
+    case "$gl_cv_func_linkat_nofollow" in
+      *yes) linkat_nofollow=yes ;;
+      *) linkat_nofollow=no ;;
+    esac
+
+    if test "$linkat_nofollow" != yes \
        || test $gl_linkat_slash_bug = 1; then
       REPLACE_LINKAT=1
       AC_DEFINE_UNQUOTED([LINKAT_TRAILING_SLASH_BUG], [$gl_linkat_slash_bug],