[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

shouldn't AC_CONFIG_LINKS make copies if it can't make links?

From: Paul Eggert
Subject: shouldn't AC_CONFIG_LINKS make copies if it can't make links?
Date: Wed, 5 Jun 2002 22:29:24 -0700 (PDT)

> From: Kevin Ryde <address@hidden>
> Date: Thu, 06 Jun 2002 07:36:44 +1000

> There's still an "ln -s || ln" in _AC_OUTPUT_LINKS I think.

Good point.  Is there a good reason why _AC_OUTPUT_LINKS avoids cp?
Would anybody object to the following patch?

2002-06-06  Paul Eggert  <address@hidden>

        * lib/autoconf/status.m4 (_AC_OUTPUT_LINKS): Fall back on cp
        if ln doesn't work.
        * NEWS: Likewise.
        * doc/autoconf.texi (Configuration Links): Likewise.
        (Limitations of Usual Tools): Prefer $(LN_S) to ln -s || ln.

--- NEWS.~1.243.~       2002-05-29 15:32:27.000000000 -0700
+++ NEWS        2002-06-05 22:26:53.264761000 -0700
@@ -11,6 +11,7 @@
 ** Macros
+- AC_CONFIG_LINKS now makes copies if it can't make links.
 - AC_FUNC_FNMATCH now tests only for POSIX compatibility, reverting to
   Autoconf 2.13 behavior.  The new macro AC_FUNC_FNMATCH_GNU also tests for
   GNU extensions to fnmatch.  Both macros now accept an optional argument
Index: doc/autoconf.texi
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.629
diff -p -u -r1.629 autoconf.texi
--- doc/autoconf.texi   29 May 2002 22:30:56 -0000      1.629
+++ doc/autoconf.texi   6 Jun 2002 05:21:45 -0000
@@ -2700,7 +2700,8 @@ built in another directory than its sour
 @cindex Links
 Make @code{AC_OUTPUT} link each of the existing files @var{source} to
 the corresponding link name @var{dest}.  Makes a symbolic link if
-possible, otherwise a hard link.  The @var{dest} and @var{source} names
+possible, otherwise a hard link if possible, otherwise a copy.
+The @var{dest} and @var{source} names
 should be relative to the top level source or build directory.  This
 macro is one of the instantiating macros, see @ref{Configuration
@@ -9849,7 +9850,7 @@ extended regular expressions and alterna
 @prindex @command{ln}
 @cindex Symbolic links
 Don't rely on @command{ln} having a @option{-f} option.  Symbolic links
-are not available on old systems, use @samp{ln} as a fall back.
+are not available on old systems; use @samp{$(LN_S)} as a portable substitute.
 For versions of the DJGPP before 2.04, @command{ln} emulates soft links
 for executables by generating a stub that in turn calls the real
Index: lib/autoconf/status.m4
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.26
diff -p -u -r1.26 status.m4
--- lib/autoconf/status.m4      29 May 2002 22:26:43 -0000      1.26
+++ lib/autoconf/status.m4      6 Jun 2002 05:21:45 -0000
@@ -778,9 +778,8 @@ for ac_file in : $CONFIG_LINKS; do test 
   # Make a symlink if possible; otherwise try a hard link.
-  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])
+  $as_ln_s $ac_rel_source $ac_dest 2>/dev/null ||
+    AC_MSG_ERROR([cannot link or copy $ac_dest to $srcdir/$ac_source])
 [  # Run the commands associated with the file.
   case $ac_file in

reply via email to

[Prev in Thread] Current Thread [Next in Thread]