From: Ralf Wildenhues Date: Thu, 12 Apr 2007 05:39:00 +0000 (+0000) Subject: * lib/autoconf/status.m4 (_AC_OUTPUT_LINK): Fix AC_CONFIG_LINKS X-Git-Tag: v2.62~331 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d09b87930981335e2c5e7a9cbecc61fcbfe0e4c4;p=thirdparty%2Fautoconf.git * 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 . --- diff --git a/ChangeLog b/ChangeLog index b02ba72f..4dbb9fcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-12 Ralf Wildenhues + + * 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 . + 2007-04-11 Paul Eggert * doc/autoconf.texi (Generic Types): Document the restrictions diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4 index d24bd744..2f6e2248 100644 --- a/lib/autoconf/status.m4 +++ b/lib/autoconf/status.m4 @@ -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