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-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.
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
# ------------
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])
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
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
# ------------
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])
fi
_AS_EXPR_PREPARE
+_AS_LN_S_PREPARE
_AS_TEST_PREPARE
_AS_UNSET_PREPARE
# 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], [:])
# 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; }])
])# _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; }
fi
_AS_EXPR_PREPARE
+_AS_LN_S_PREPARE
_AS_TEST_PREPARE
_AS_UNSET_PREPARE
# 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], [:])
# 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; }])
])# _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; }