autoconf-patches
[Top][All Lists]
Advanced

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

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


From: Akim Demaille
Subject: Re: [Patch 2/3] AS_LN_S support for non-ln programs
Date: 03 Mar 2002 20:57:47 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

| 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'

Please, no useless quotes.  And avoid macro names in comments,
especially if they don't appear to mak sense ;)

|    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

Useless quotes here.

| + '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
|  ])

It does look like what we are looking for.  But it is still wrong: you
still seem not to have understood the difference between ln foo/bar
fo/ba OT1H, and ln -s foo/bar fo/ba.  It's about the same as the one
you implemented for cp, btw.  Hm... Actually, move `ln' into `cp', and
I'm OK.  Provided you provide m4sh.at tests ;)





reply via email to

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