]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/status.m4 (_AC_OUTPUT_LINK): Fix AC_CONFIG_LINKS
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 12 Apr 2007 05:39:00 +0000 (05:39 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 12 Apr 2007 05:39:00 +0000 (05:39 +0000)
to prefer a link source from the build tree, if it exists.
Report by Pallav Gupta <pallavgupta@gmail.com>.

ChangeLog
lib/autoconf/status.m4

index b02ba72fb60f473f9bd3ae78260fdf32a2bf035a..4dbb9fcbbf32417c6c4e9972e8a699374f6569b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * lib/autoconf/status.m4 (_AC_OUTPUT_LINK): Fix AC_CONFIG_LINKS
+       to prefer a link source from the build tree, if it exists.
+       Report by Pallav Gupta <pallavgupta@gmail.com>.
+
 2007-04-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        * doc/autoconf.texi (Generic Types): Document the restrictions
index d24bd7446e8b663c026ddab72e9dbd73b5b980e2..2f6e2248784c4b0b7aee3d5a40aee34775bf3a8b 100644 (file)
@@ -873,22 +873,24 @@ m4_define([_AC_OUTPUT_LINK],
   # CONFIG_LINK
   #
 
-  AC_MSG_NOTICE([linking $srcdir/$ac_source to $ac_file])
+  test -r "$ac_source" || ac_source=$srcdir/$ac_source
 
-  if test ! -r "$srcdir/$ac_source"; then
-    AC_MSG_ERROR([$srcdir/$ac_source: file not found])
+  AC_MSG_NOTICE([linking $ac_source to $ac_file])
+
+  if test ! -r "$ac_source"; then
+    AC_MSG_ERROR([$ac_source: file not found])
   fi
   rm -f "$ac_file"
 
   # Try a relative symlink, then a hard link, then a copy.
   case $srcdir in
-  [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$srcdir/$ac_source ;;
-      *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;;
+  [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$ac_source ;;
+      *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
   esac
   ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
-    ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null ||
-    cp -p "$srcdir/$ac_source" "$ac_file" ||
-    AC_MSG_ERROR([cannot link or copy $srcdir/$ac_source to $ac_file])
+    ln "$ac_source" "$ac_file" 2>/dev/null ||
+    cp -p "$ac_source" "$ac_file" ||
+    AC_MSG_ERROR([cannot link or copy $ac_source to $ac_file])
 ])# _AC_OUTPUT_LINK