From f587ed5da62c8c55762646c58b9b9fd02ed64e5d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 6 Jun 2002 17:55:47 +0000 Subject: [PATCH] (_AC_OUTPUT_LINKS): Fall back on cp if ln doesn't work. --- lib/autoconf/status.m4 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index 3749885b..18bbf375 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -777,10 +777,11 @@ for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; esac - # Make a symlink if possible; otherwise try a hard link. + # Try a symlink, then a hard link, then a copy. ln -s $ac_rel_source $ac_dest 2>/dev/null || - ln $srcdir/$ac_source $ac_dest || - AC_MSG_ERROR([cannot link $ac_dest to $srcdir/$ac_source]) + ln $srcdir/$ac_source $ac_dest 2>/dev/null || + cp -p $srcdir/$ac_source $ac_dest || + AC_MSG_ERROR([cannot link or copy $srcdir/$ac_source to $ac_dest]) m4_ifset([AC_LIST_LINKS_COMMANDS], [ # Run the commands associated with the file. case $ac_file in