autoconf-patches
[Top][All Lists]
Advanced

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

[Patch 2/3] AS_LN_S support for non-ln programs


From: Tim Van Holder
Subject: [Patch 2/3] AS_LN_S support for non-ln programs
Date: Sun, 3 Mar 2002 19:34:13 +0100

The case in AS_LN_S may need to be enclosed in {} or (); not sure.

2002-03-03  Tim Van Holder  <address@hidden>

        * lib/m4sugar/m4sh.m4: Enhance AS_LN_S so it has
        ln-like behaviour even if $as_ln_s isn't ln (i.e. 'cp -p').
        * lib/autoconf/status.m4: Use AS_LN_S.

Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvs/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.74
diff -u -r1.74 m4sh.m4
--- lib/m4sugar/m4sh.m4 7 Feb 2002 15:49:33 -0000       1.74
+++ lib/m4sugar/m4sh.m4 3 Mar 2002 18:21:15 -0000
@@ -551,6 +551,8 @@
 # would yield conftest.sym.exe for DJGPP < 2.04.  And don't use
`conftest'
 # as base name to avoid prohibiting concurrency (e.g., concurrent
 # config.statuses).
+# Note: any possible setting for $as_ln_s must have a corresponding
entry
+# in AS_LN_S.
 m4_defun([_AS_LN_S_PREPARE],
 [rm -f conf$$ conf$$.exe conf$$.file
 echo >conf$$.file
@@ -558,13 +560,14 @@
   # 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 conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
+    # Plain ln makes a copy, so we can use that and avoid the extra
magic in
+    # AS_LN_S
+    as_ln_s='ln'
   else
     as_ln_s='ln -s'
   fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  as_ln_s='ln'
 else
   as_ln_s='cp -p'
 fi
@@ -622,7 +625,17 @@
 # simulated with `ln' or `cp'?
 m4_defun([AS_LN_S],
 [AS_REQUIRE([_AS_LN_S_PREPARE])dnl
-$as_ln_s $1 $2
+case "$as_ln_s" in
+ 'ln' | 'ln -s') $as_ln_s $1 $2;;
+ 'cp -p')
+   case "$1" in
+    [[\\/]]* | ?:[[\\//]]) # Absolute -> no change
+      $as_ln_s $1 $2;;
+    *) # Relative -> use ln semantics
+      $as_ln_s AS_DIRNAME($2)/$1 $2;;
+   esac;;
+ *) AS_ERROR([[AS_LN_S] is not set up to handle `$as_ln_s' yet])
+esac
 ])
 
 




reply via email to

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