From 6e8c08b38f509daee02a9e7b2380a07c12f9b85b Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Tue, 11 Apr 2017 15:16:08 +0200 Subject: [PATCH] Build: test if hard links are really working The AFS filesystem does not allow hard links between files in different directories. We fall back to symbolic links in that case. --- m4/sah_links.m4 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/m4/sah_links.m4 b/m4/sah_links.m4 index 5c29dc4dd1..5de1eab1c9 100644 --- a/m4/sah_links.m4 +++ b/m4/sah_links.m4 @@ -2,16 +2,19 @@ AC_DEFUN([SAH_LINKS],[ AC_PATH_PROGS(LN,[ln cp copy]) if test -n "$LN" ; then AC_MSG_CHECKING(whether '$LN' works) - if $LN ${ac_aux_dir}/config.sub erase.me$$ && \ + mkdir -p lntest + cp ${ac_aux_dir}/config.sub lntest/ + if $LN lntest/config.sub erase.me$$ && \ test -e erase.me$$ && \ - diff ${ac_aux_dir}/config.sub erase.me$$ >/dev/null 2>&5 + diff lntest/config.sub erase.me$$ >/dev/null 2>&5 then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) LN=cp fi - /bin/rm erase.me$$ + /bin/rm erase.me$$ lntest/config.sub + /bin/rmdir ln_test else LN=cp fi @@ -20,7 +23,7 @@ AC_DEFUN([SAH_LINKS],[ AC_MSG_CHECKING(whether '$LN_S' really works or whether I'm deluding myself) if $LN_S ${ac_aux_dir}/config.sub erase.me$$ && \ test -e erase.me$$ && \ - diff ${ac_aux_dir}/config.sub erase.me$$ >/dev/null 2>&5 + diff ${ac_aux_dir}/config.sub erase.me$$ >/dev/null 2>&5 then AC_MSG_RESULT(it works) else @@ -31,6 +34,4 @@ AC_DEFUN([SAH_LINKS],[ else LN_S=cp fi -]) - - +])