]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Follow Tim Van Holder's suggestions for a uniform handling of
authorAkim Demaille <akim@epita.fr>
Sat, 27 Jan 2001 13:19:14 +0000 (13:19 +0000)
committerAkim Demaille <akim@epita.fr>
Sat, 27 Jan 2001 13:19:14 +0000 (13:19 +0000)
symlinks.
* m4sh.m4: Stay in `as_', not `ac_'.
(_AS_LN_S_PREPARE): Eve out from...
* acspecific.m4 (AC_PROG_LN_S): here.  Adjust.
* m4sh.m4 (AS_LN_S): New.
(AS_SHELL_PREPARE): Call _AS_LN_S_PREPARE.

ChangeLog
acgeneral.m4
acspecific.m4
doc/autoconf.texi
lib/autoconf/general.m4
lib/autoconf/specific.m4
lib/m4sugar/m4sh.m4
m4sh.m4

index df0c2ae935e78390ca770376b65a0366e19084b7..0aa9e743b94f0b79ab8e4d68d87caed18e6d6f6e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-01-27  Akim Demaille  <akim@epita.fr>
+
+       Follow Tim Van Holder's suggestions for a uniform handling of
+       symlinks.
+
+       * m4sh.m4: Stay in `as_', not `ac_'.
+       (_AS_LN_S_PREPARE): Eve out from...
+       * acspecific.m4 (AC_PROG_LN_S): here.  Adjust.
+       * m4sh.m4 (AS_LN_S): New.
+       (AS_SHELL_PREPARE): Call _AS_LN_S_PREPARE.
+
 2001-01-26  Assar Westerlund  <assar@sics.se>
 
        * autoreconf.sh (find): Fix precedence.
index 4e77700758dfade9a066f0e87449ff13506b7d2d..075c38cc978f8129229d278dc7cbb8341bb89727 100644 (file)
@@ -4284,10 +4284,9 @@ for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
   esac
 
   # Make a symlink if possible; otherwise try a hard link.
-  if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
-     ln $srcdir/$ac_source $ac_dest; then :; else
+  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])
-  fi
 m4_ifset([AC_LIST_LINKS_COMMANDS],
 [  # Run the commands associated with the file.
   case $ac_file in
index 6fc7d401f5d6220ec35fc777a0628a413cf9872b..e8274293988b0cf8af6c32d28c3e67f428ec811e 100644 (file)
@@ -268,28 +268,8 @@ AC_SUBST(INSTALL_DATA)dnl
 # ------------
 AC_DEFUN([AC_PROG_LN_S],
 [AC_MSG_CHECKING([whether ln -s works])
-AC_CACHE_VAL(ac_cv_prog_LN_S,
-[rm -f conftest conftest.exe conftest.file
-echo >conftest.file
-dnl Don't use conftest.sym to avoid filename issues on DJGPP, where this
-dnl would yield conftest.sym.exe for DJGPP < 2.04.
-if ln -s conftest.file conftest 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conftest.exe; then
-    ac_cv_prog_LN_S="cp -p" # Don't use ln at all; we don't have any links
-  else
-    ac_cv_prog_LN_S="ln -s"
-  fi
-elif ln conftest.file conftest 2>/dev/null; then
-  ac_cv_prog_LN_S=ln
-else
-  ac_cv_prog_LN_S=cp
-fi
-rm -f conftest conftest.exe conftest.file])dnl
-ac_ln_s=$ac_cv_prog_LN_S
-AC_SUBST([LN_S], [$ac_cv_prog_LN_S])
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
+AC_SUBST([LN_S], [$as_ln_s])dnl
+if test "$LN_S" = "ln -s"; then
   AC_MSG_RESULT([yes])
 else
   AC_MSG_RESULT([no, using $LN_S])
index 794039a1316124a5511a9c81f504e7135bdf9027..acc32797274ae669e7825f82e808f28e2c217992 100644 (file)
@@ -2791,7 +2791,7 @@ distribution.
 If @samp{ln -s} works on the current file system (the operating system
 and file system support symbolic links), set output variable @code{LN_S}
 to @samp{ln -s}, otherwise if @samp{ln} works, set @code{LN_S} to
-@samp{ln}, and otherwise set to @samp{cp}.
+@samp{ln}, and otherwise set to @samp{cp -p}.
 
 If the link is put in a directory other than the current directory, its
 meaning depends on whether @samp{ln} or @samp{ln -s} is used.  To safely
index 4e77700758dfade9a066f0e87449ff13506b7d2d..075c38cc978f8129229d278dc7cbb8341bb89727 100644 (file)
@@ -4284,10 +4284,9 @@ for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
   esac
 
   # Make a symlink if possible; otherwise try a hard link.
-  if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
-     ln $srcdir/$ac_source $ac_dest; then :; else
+  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])
-  fi
 m4_ifset([AC_LIST_LINKS_COMMANDS],
 [  # Run the commands associated with the file.
   case $ac_file in
index 6fc7d401f5d6220ec35fc777a0628a413cf9872b..e8274293988b0cf8af6c32d28c3e67f428ec811e 100644 (file)
@@ -268,28 +268,8 @@ AC_SUBST(INSTALL_DATA)dnl
 # ------------
 AC_DEFUN([AC_PROG_LN_S],
 [AC_MSG_CHECKING([whether ln -s works])
-AC_CACHE_VAL(ac_cv_prog_LN_S,
-[rm -f conftest conftest.exe conftest.file
-echo >conftest.file
-dnl Don't use conftest.sym to avoid filename issues on DJGPP, where this
-dnl would yield conftest.sym.exe for DJGPP < 2.04.
-if ln -s conftest.file conftest 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conftest.exe; then
-    ac_cv_prog_LN_S="cp -p" # Don't use ln at all; we don't have any links
-  else
-    ac_cv_prog_LN_S="ln -s"
-  fi
-elif ln conftest.file conftest 2>/dev/null; then
-  ac_cv_prog_LN_S=ln
-else
-  ac_cv_prog_LN_S=cp
-fi
-rm -f conftest conftest.exe conftest.file])dnl
-ac_ln_s=$ac_cv_prog_LN_S
-AC_SUBST([LN_S], [$ac_cv_prog_LN_S])
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
+AC_SUBST([LN_S], [$as_ln_s])dnl
+if test "$LN_S" = "ln -s"; then
   AC_MSG_RESULT([yes])
 else
   AC_MSG_RESULT([no, using $LN_S])
index 9ad6a919572094475b2fe3a85f11cfe2f0cdc5aa..3f16848bd91984bbf92b21042af01eb47cebd34b 100644 (file)
@@ -67,6 +67,7 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
 fi
 
 _AS_EXPR_PREPARE
+_AS_LN_S_PREPARE
 _AS_TEST_PREPARE
 _AS_UNSET_PREPARE
 
@@ -82,9 +83,9 @@ AS_UNSET([LC_MESSAGES], [C])
 
 # IFS
 # We need space, tab and new line, in precisely that order.
-ac_nl='
+as_nl='
 '
-IFS="  $ac_nl"
+IFS="  $as_nl"
 
 # CDPATH.
 AS_UNSET([CDPATH], [:])
@@ -149,7 +150,7 @@ fi
 # AS_UNSET(VAR, [VALUE-IF-UNSET-NOT-SUPPORTED = `'])
 # --------------------------------------------------
 # Try to unset the env VAR, otherwise set it to
-# VALUE-IF-UNSET-NOT-SUPPORTED.  `ac_unset' must have been computed.
+# VALUE-IF-UNSET-NOT-SUPPORTED.  `as_unset' must have been computed.
 m4_defun([AS_UNSET],
 [m4_require([_AS_UNSET_PREPARE])dnl
 $as_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
@@ -313,22 +314,57 @@ fi
 ])# _AS_EXPR_PREPARE
 
 
+# _AS_LN_S_PREPARE
+# ----------------
+# Don't use conftest.sym to avoid filename issues on DJGPP, where this
+# would yield conftest.sym.exe for DJGPP < 2.04.
+m4_defun([_AS_LN_S_PREPARE],
+[rm -f conftest conftest.exe conftest.file
+echo >conftest.file
+if ln -s conftest.file conftest 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conftest.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conftest.file conftest 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conftest conftest.exe conftest.file
+])# _AS_LN_S_PREPARE
+
+
+# AS_LN_S(FILE, LINK)
+# -------------------
+# FIXME: Should we add the glue code to handle properly relative symlinks
+# simulated with `ln' or `cp'?
+m4_defun([AS_LN_S],
+[m4_require([_AS_LN_S_PREPARE])dnl
+$as_ln_s $1 $2
+])
+
+
 # AS_MKDIR_P(PATH)
 # ----------------
 # Emulate `mkdir -p' with plain `mkdir'.
 m4_define([AS_MKDIR_P],
 [{ case $1 in
-  [[\\/]]* | ?:[[\\/]]* ) ac_incr_dir=;;
-  *)                      ac_incr_dir=.;;
+  [[\\/]]* | ?:[[\\/]]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
 esac
-ac_dummy=$1
-for ac_mkdir_dir in `IFS='\\/'; set X $ac_dummy; shift; echo "$[@]"`; do
-  case $ac_mkdir_dir in
+as_dummy=$1
+for as_mkdir_dir in `IFS='\\/'; set X $as_dummy; shift; echo "$[@]"`; do
+  case $as_mkdir_dir in
     # Skip DOS drivespec
-    ?:) ac_incr_dir=$ac_mkdir_dir ;;
+    ?:) as_incr_dir=$as_mkdir_dir ;;
     *)
-      ac_incr_dir=$ac_incr_dir/$ac_mkdir_dir
-      test -d "$ac_incr_dir" || mkdir "$ac_incr_dir"
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
     ;;
   esac
 done; }
diff --git a/m4sh.m4 b/m4sh.m4
index 9ad6a919572094475b2fe3a85f11cfe2f0cdc5aa..3f16848bd91984bbf92b21042af01eb47cebd34b 100644 (file)
--- a/m4sh.m4
+++ b/m4sh.m4
@@ -67,6 +67,7 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
 fi
 
 _AS_EXPR_PREPARE
+_AS_LN_S_PREPARE
 _AS_TEST_PREPARE
 _AS_UNSET_PREPARE
 
@@ -82,9 +83,9 @@ AS_UNSET([LC_MESSAGES], [C])
 
 # IFS
 # We need space, tab and new line, in precisely that order.
-ac_nl='
+as_nl='
 '
-IFS="  $ac_nl"
+IFS="  $as_nl"
 
 # CDPATH.
 AS_UNSET([CDPATH], [:])
@@ -149,7 +150,7 @@ fi
 # AS_UNSET(VAR, [VALUE-IF-UNSET-NOT-SUPPORTED = `'])
 # --------------------------------------------------
 # Try to unset the env VAR, otherwise set it to
-# VALUE-IF-UNSET-NOT-SUPPORTED.  `ac_unset' must have been computed.
+# VALUE-IF-UNSET-NOT-SUPPORTED.  `as_unset' must have been computed.
 m4_defun([AS_UNSET],
 [m4_require([_AS_UNSET_PREPARE])dnl
 $as_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
@@ -313,22 +314,57 @@ fi
 ])# _AS_EXPR_PREPARE
 
 
+# _AS_LN_S_PREPARE
+# ----------------
+# Don't use conftest.sym to avoid filename issues on DJGPP, where this
+# would yield conftest.sym.exe for DJGPP < 2.04.
+m4_defun([_AS_LN_S_PREPARE],
+[rm -f conftest conftest.exe conftest.file
+echo >conftest.file
+if ln -s conftest.file conftest 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conftest.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conftest.file conftest 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conftest conftest.exe conftest.file
+])# _AS_LN_S_PREPARE
+
+
+# AS_LN_S(FILE, LINK)
+# -------------------
+# FIXME: Should we add the glue code to handle properly relative symlinks
+# simulated with `ln' or `cp'?
+m4_defun([AS_LN_S],
+[m4_require([_AS_LN_S_PREPARE])dnl
+$as_ln_s $1 $2
+])
+
+
 # AS_MKDIR_P(PATH)
 # ----------------
 # Emulate `mkdir -p' with plain `mkdir'.
 m4_define([AS_MKDIR_P],
 [{ case $1 in
-  [[\\/]]* | ?:[[\\/]]* ) ac_incr_dir=;;
-  *)                      ac_incr_dir=.;;
+  [[\\/]]* | ?:[[\\/]]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
 esac
-ac_dummy=$1
-for ac_mkdir_dir in `IFS='\\/'; set X $ac_dummy; shift; echo "$[@]"`; do
-  case $ac_mkdir_dir in
+as_dummy=$1
+for as_mkdir_dir in `IFS='\\/'; set X $as_dummy; shift; echo "$[@]"`; do
+  case $as_mkdir_dir in
     # Skip DOS drivespec
-    ?:) ac_incr_dir=$ac_mkdir_dir ;;
+    ?:) as_incr_dir=$as_mkdir_dir ;;
     *)
-      ac_incr_dir=$ac_incr_dir/$ac_mkdir_dir
-      test -d "$ac_incr_dir" || mkdir "$ac_incr_dir"
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
     ;;
   esac
 done; }